/*
Theme Name: MTM Theme
Theme URI: https://minhtuanmobile.top
Author: MTM Dev
Author URI: https://minhtuanmobile.top
Description: Custom e-commerce theme for Minh Tuấn Mobile - Electronics & Mobile Store
Version: 1.0.0
Requires at least: 6.0
Tested up to: 7.0
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: mtm-theme
Tags: e-commerce, woocommerce, custom-header, custom-logo

Minh Tuấn Mobile - Your trusted electronics store.
*/

/* === CSS Reset & Base === */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-primary);
  color: var(--color-text);
  background-color: var(--color-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  text-decoration: none;
  color: inherit;
  transition: color 0.2s ease;
}

ul, ol {
  list-style: none;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.3;
}

/* === Design Tokens === */
:root {
  /* Primary */
  --color-primary: #E53935;
  --color-primary-dark: #C62828;
  --color-primary-light: #FF5252;
  --color-primary-rgb: 229, 57, 53;

  /* Secondary */
  --color-secondary: #1A237E;
  --color-secondary-light: #283593;

  /* Neutrals */
  --color-bg: #F5F5F5;
  --color-bg-alt: #EEEEEE;
  --color-white: #FFFFFF;
  --color-black: #000000;
  --color-text: #222222;
  --color-text-secondary: #555555;
  --color-text-light: #888888;
  --color-border: #E0E0E0;
  --color-border-light: #F0F0F0;

  /* Accent */
  --color-sale: #FF1744;
  --color-sale-bg: #FFF0F0;
  --color-success: #4CAF50;
  --color-warning: #FF9800;
  --color-info: #2196F3;
  --color-star: #FFB400;

  /* Typography */
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI',
    Roboto, Oxygen, Ubuntu, sans-serif;
  --font-heading: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI',
    Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* Font Sizes */
  --text-xs: 0.75rem;
  --text-sm: 0.8125rem;
  --text-base: 0.875rem;
  --text-md: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;

  /* Spacing */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;

  /* Layout */
  --container-max: 1200px;
  --container-wide: 1400px;
  --header-height: 70px;
  --topbar-height: 36px;
  --nav-height: 44px;

  /* Border Radius */
  --radius-xs: 2px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 50%;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.12);
  --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-card-hover: 0 8px 24px rgba(0, 0, 0, 0.12);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 350ms ease;

  /* Z-index */
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-fixed: 300;
  --z-overlay: 400;
  --z-modal: 500;
  --z-toast: 600;
}

/* === Utility Classes === */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-4);
}

.container-wide {
  width: 100%;
  max-width: var(--container-wide);
  margin: 0 auto;
  padding: 0 var(--space-4);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-primary { color: var(--color-primary); }
.text-sale { color: var(--color-sale); }

.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.grid { display: grid; }

/* === Base Typography === */
.price {
  font-weight: 700;
  color: var(--color-primary);
}

.price-old {
  text-decoration: line-through;
  color: var(--color-text-light);
  font-size: var(--text-sm);
  font-weight: 400;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  font-size: var(--text-xs);
  font-weight: 600;
  border-radius: var(--radius-sm);
}

.badge-sale {
  background-color: var(--color-sale);
  color: var(--color-white);
}

.badge-new {
  background-color: var(--color-info);
  color: var(--color-white);
}

.badge-gift {
  background-color: var(--color-success);
  color: var(--color-white);
}

/* === Button Base === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 10px 20px;
  font-weight: 600;
  font-size: var(--text-base);
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
  cursor: pointer;
  border: none;
  line-height: 1.4;
}

.btn-primary {
  background-color: var(--color-primary);
  color: var(--color-white);
}

.btn-primary:hover {
  background-color: var(--color-primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background-color: var(--color-secondary);
  color: var(--color-white);
}

.btn-outline {
  background-color: transparent;
  border: 2px solid var(--color-primary);
  color: var(--color-primary);
}

.btn-outline:hover {
  background-color: var(--color-primary);
  color: var(--color-white);
}

.btn-sm {
  padding: 6px 14px;
  font-size: var(--text-sm);
}

.btn-lg {
  padding: 14px 28px;
  font-size: var(--text-md);
}

.btn-full {
  width: 100%;
}

/* === Animations === */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes slideDown {
  from { transform: translateY(-10px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.animate-fadeIn { animation: fadeIn var(--transition-base) ease forwards; }
.animate-slideUp { animation: slideUp var(--transition-slow) ease forwards; }

/* === Skeleton Loading === */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--color-border-light) 25%,
    var(--color-bg) 50%,
    var(--color-border-light) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

/* === WooCommerce Base Overrides === */
.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
  border-top-color: var(--color-primary) !important;
}

.woocommerce-message::before {
  color: var(--color-primary) !important;
}

.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button {
  background-color: var(--color-primary) !important;
  color: var(--color-white) !important;
  border-radius: var(--radius-md) !important;
  font-weight: 600 !important;
}

.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce input.button:hover {
  background-color: var(--color-primary-dark) !important;
}
