/* Trần Thanh Quang - Premium Design System */
/* Based on Frontend Design Pro principles */

:root {
  /* Strategic Color Palette - OKLCH inspired */
  --primary: #0a7ea4;  /* Teal blue - trust, quality */
  --primary-dark: #085c78;
  --accent: #f97316;  /* Orange - energy, action */
  --accent-dark: #ea580c;
  
  /* Neutral colors with tone (warm gray) */
  --text: #1c1917;  /* Warm black */
  --text-light: #78716c;  /* Warm gray */
  --border: #e7e5e4;
  --bg: #fafaf9;
  --white: #ffffff;
  
  /* Dark mode colors */
  --dark-bg: #0f0f0f;  /* Not pure black */
  --dark-text: #fafaf9;
  
  /* 8px spacing system */
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;
  --space-5: 40px;
  --space-6: 48px;
  --space-8: 64px;
  --space-10: 80px;
  
  /* Typography scale (1.25 ratio) */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;
  --text-5xl: 3rem;
  
  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --duration-fast: 150ms;
  --duration-base: 200ms;
  --duration-slow: 300ms;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 12px 24px rgba(0,0,0,0.12);
  --shadow-xl: 0 24px 48px rgba(0,0,0,0.16);
  
  /* Border radius */
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 24px;
}

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

/* Base */
html { 
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--text);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h1 { font-size: var(--text-5xl); }
h2 { font-size: var(--text-4xl); }
h3 { font-size: var(--text-3xl); }
h4 { font-size: var(--text-2xl); }

p { max-width: 65ch; }

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out);
}

a:hover { color: var(--primary-dark); }

/* Container */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--space-4);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  font-weight: 600;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--duration-base) var(--ease-out);
  white-space: nowrap;
}

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

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

.btn-secondary {
  background: var(--white);
  color: var(--text);
  border: 2px solid var(--border);
}

.btn-secondary:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* Header */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  transition: box-shadow var(--duration-base) var(--ease-out);
}

.header.scrolled {
  box-shadow: var(--shadow-md);
}

.header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.logo {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.logo-text {
  font-size: var(--text-xl);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--primary);
}

.logo-sub {
  font-size: var(--text-xs);
  color: var(--text-light);
  letter-spacing: 0.05em;
}

.nav {
  display: flex;
  gap: var(--space-5);
}

.nav a {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text);
  position: relative;
}

.nav a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width var(--duration-base) var(--ease-out);
}

.nav a:hover::after {
  width: 100%;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.cart-btn, .search-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-out);
}

.cart-btn:hover, .search-btn:hover {
  background: var(--bg);
}

.cart-count {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 18px;
  height: 18px;
  background: var(--accent);
  color: var(--white);
  font-size: 11px;
  font-weight: 700;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.menu-btn {
  display: none;
  width: 40px;
  height: 40px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: transparent;
  border: none;
  cursor: pointer;
}

.menu-btn span {
  width: 20px;
  height: 2px;
  background: var(--text);
  transition: transform var(--duration-base) var(--ease-out);
}

/* Hero */
.hero {
  position: relative;
  min-height: calc(100vh - 72px);
  margin-top: 72px;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #0a7ea4 0%, #085c78 100%);
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 640px;
  padding: var(--space-10);
  color: var(--white);
}

.hero-tag {
  display: inline-block;
  background: rgba(255,255,255,0.2);
  backdrop-filter: blur(8px);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-2xl);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: var(--space-4);
}

.hero-title {
  font-size: clamp(var(--text-4xl), 8vw, var(--text-5xl));
  margin-bottom: var(--space-3);
  line-height: 1.1;
}

.hero-desc {
  font-size: var(--text-lg);
  opacity: 0.9;
  margin-bottom: var(--space-6);
  max-width: 50ch;
}

/* Categories */
.categories {
  padding: var(--space-10) 0;
  background: var(--bg);
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
}

.category-card {
  background: var(--white);
  padding: var(--space-5);
  border-radius: var(--radius-xl);
  text-align: center;
  transition: transform var(--duration-base) var(--ease-out), 
              box-shadow var(--duration-base) var(--ease-out);
  border: 1px solid var(--border);
}

.category-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
}

.category-icon {
  font-size: 48px;
  margin-bottom: var(--space-2);
}

.category-card h3 {
  font-size: var(--text-base);
  margin-bottom: var(--space-1);
}

.category-card span {
  font-size: var(--text-sm);
  color: var(--text-light);
}

/* Products */
.products {
  padding: var(--space-10) 0;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-6);
}

.section-title {
  font-size: var(--text-3xl);
}

.view-all {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--primary);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
}

.product-card {
  background: var(--white);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: transform var(--duration-base) var(--ease-out),
              box-shadow var(--duration-base) var(--ease-out);
  border: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  display: block;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.product-image {
  position: relative;
  aspect-ratio: 1;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--duration-slow) var(--ease-out);
}

.product-card:hover .product-image img {
  transform: scale(1.1);
}

.product-placeholder {
  font-size: 64px;
}

.product-badge {
  position: absolute;
  top: var(--space-2);
  left: var(--space-2);
  padding: 4px 8px;
  background: var(--primary);
  color: var(--white);
  font-size: 12px;
  font-weight: 700;
  border-radius: var(--radius);
  text-transform: uppercase;
}

.product-badge.sale, .product-badge.hot {
  background: #dc2626;
}

.product-badge::before {
  content: '';
}

.product-badge.hot::before {
  content: '';
}

.product-info {
  padding: var(--space-3);
}

.product-category {
  font-size: var(--text-xs);
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-1);
}

.product-name {
  font-size: var(--text-base);
  font-weight: 600;
  margin-bottom: var(--space-1);
  line-height: 1.4;
}

.product-price {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.price-current {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--accent);
}

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

/* Features */
.features {
  padding: var(--space-10) 0;
  border-top: 1px solid var(--border);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-6);
  text-align: center;
}

.feature-icon {
  font-size: 40px;
  margin-bottom: var(--space-2);
}

.feature h3 {
  font-size: var(--text-base);
  margin-bottom: var(--space-1);
}

.feature p {
  font-size: var(--text-sm);
  color: var(--text-light);
}

/* Footer */
.footer {
  background: var(--dark-bg);
  color: var(--dark-text);
  padding: var(--space-10) 0 var(--space-4);
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: var(--space-4);
  text-align: center;
}

.footer-bottom p {
  font-size: var(--text-sm);
  opacity: 0.7;
  margin-bottom: var(--space-1);
}

/* Social Links */
.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: rgba(255,255,255,0.1);
  border-radius: 50%;
  font-size: 20px;
  text-decoration: none;
  transition: all var(--duration-base) var(--ease-out);
}

.social-link:hover {
  background: var(--accent);
  transform: translateY(-4px);
}

/* Blog Section */
.blog-section .section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
}

.blog-section a[href^="/blog/"]:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

@media (max-width: 768px) {
  .blog-section .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
}

/* Contact Info Update */
.contact-item strong {
  color: var(--text);
  font-size: var(--text-base);
  display: block;
  margin-bottom: 4px;
}

.contact-item p {
  color: var(--text-light);
  font-size: var(--text-sm);
  margin: 0;
}

/* Back to top */
.back-to-top {
  position: fixed;
  bottom: var(--space-5);
  right: var(--space-5);
  width: 48px;
  height: 48px;
  background: var(--primary);
  color: var(--white);
  border: none;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all var(--duration-base) var(--ease-out);
  z-index: 100;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  background: var(--primary-dark);
  transform: translateY(-4px);
}

/* Responsive */
@media (max-width: 1024px) {
  .nav { display: none; }
  .menu-btn { display: flex; }
  .product-grid { grid-template-columns: repeat(3, 1fr); }
  .category-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .hero-content { padding: var(--space-5); }
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: var(--space-2); }
  .category-grid { grid-template-columns: 1fr 1fr; gap: var(--space-2); }
  .features-grid { grid-template-columns: 1fr 1fr; }
  .section-header { flex-direction: column; align-items: flex-start; gap: var(--space-2); }
  .container { padding: 0 var(--space-2); }
  
  /* Mobile menu */
  .mobile-menu {
    display: none;
    position: fixed;
    top: 72px;
    left: 0;
    right: 0;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: var(--space-3);
    z-index: 999;
  }
  
  .mobile-menu.active { display: block; }
  
  .mobile-nav a {
    display: block;
    padding: var(--space-2) 0;
    font-size: var(--text-base);
    font-weight: 500;
    border-bottom: 1px solid var(--border);
  }
}

@media (max-width: 480px) {
  .product-grid { grid-template-columns: 1fr; }
  .hero-title { font-size: var(--text-3xl); }
  .hero-desc { font-size: var(--text-base); }
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.product-card, .category-card {
  animation: fadeInUp 0.5s var(--ease-out) backwards;
}

.product-card:nth-child(1) { animation-delay: 0.1s; }
.product-card:nth-child(2) { animation-delay: 0.15s; }
.product-card:nth-child(3) { animation-delay: 0.2s; }
.product-card:nth-child(4) { animation-delay: 0.25s; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Floating Hotline Button */
.floating-hotline {
  position: fixed;
  bottom: 120px;
  right: var(--space-5);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: #d32f2f;
  color: var(--white);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-2xl);
  text-decoration: none;
  font-weight: 700;
  font-size: var(--text-lg);
  box-shadow: var(--shadow-xl);
  z-index: 1000;
  transition: transform var(--duration-base) var(--ease-out);
  animation: shake 2s ease-in-out infinite;
}

.floating-hotline:hover {
  transform: scale(1.05);
}

.hotline-icon {
  font-size: 28px;
}

.hotline-text {
  animation: fadeIn 0.5s ease-out;
}

.hotline-pulse {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  background: #d32f2f;
  border-radius: var(--radius-2xl);
  transform: translate(-50%, -50%);
  animation: pulse 2s ease-out infinite;
  z-index: -1;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

@keyframes pulse {
  0% { transform: translate(-50%, -50%) scale(1); opacity: 0.8; }
  100% { transform: translate(-50%, -50%) scale(1.5); opacity: 0; }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Floating Zalo Button */
.floating-zalo {
  position: fixed;
  bottom: var(--space-10);
  right: var(--space-5);
  width: 56px;
  height: 56px;
  background: #0068ff;
  color: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 24px;
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  transition: transform var(--duration-base) var(--ease-out);
}

.floating-zalo:hover {
  transform: scale(1.1);
}

/* Search Bar */
.search-container {
  position: relative;
  flex: 1;
  max-width: 400px;
  margin: 0 var(--space-4);
}

.search-input {
  width: 100%;
  padding: var(--space-2) var(--space-4);
  padding-left: 40px;
  border: 2px solid var(--border);
  border-radius: var(--radius-2xl);
  font-size: var(--text-sm);
  transition: border-color var(--duration-fast) var(--ease-out);
}

.search-input:focus {
  outline: none;
  border-color: var(--primary);
}

.search-icon {
  position: absolute;
  left: var(--space-2);
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  color: var(--text-light);
}

/* Mobile Hotline */
@media (max-width: 768px) {
  .floating-hotline {
    bottom: 100px;
    right: var(--space-3);
    padding: var(--space-2);
    font-size: var(--text-sm);
  }
  
  .hotline-text {
    display: none;
  }
  
  .floating-zalo {
    bottom: var(--space-4);
    right: var(--space-3);
    width: 48px;
    height: 48px;
  }
  
  .search-container {
    display: none;
  }
}