/* ===== CSS Variables ===== */
:root {
  --primary: #0066cc;
  --primary-dark: #004c99;
  --secondary: #00a8e8;
  --accent: #ff6b35;
  --success: #28a745;
  --dark: #1a1a2e;
  --gray-900: #212529;
  --gray-800: #343a40;
  --gray-700: #495057;
  --gray-600: #6c757d;
  --gray-500: #adb5bd;
  --gray-400: #ced4da;
  --gray-300: #dee2e6;
  --gray-200: #f8f9fa;
  --white: #ffffff;
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.12);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.16);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --transition: 0.3s ease;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--gray-800);
  background: var(--gray-200);
}

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

a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
}

/* ===== Typography ===== */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.3;
  color: var(--gray-900);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ===== Header ===== */
.header {
  background: var(--white);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
}

.logo-icon {
  font-size: 2rem;
}

.logo span {
  color: var(--accent);
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-menu a {
  font-weight: 500;
  color: var(--gray-700);
  transition: var(--transition);
}

.nav-menu a:hover {
  color: var(--primary);
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
}

/* ===== Hero Section ===== */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: var(--white);
  padding: 80px 0;
  text-align: center;
}

.hero h1 {
  color: var(--white);
  font-size: 3rem;
  margin-bottom: 20px;
}

.hero p {
  font-size: 1.25rem;
  opacity: 0.95;
  max-width: 600px;
  margin: 0 auto 30px;
}

.search-box {
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  gap: 10px;
}

.search-box input {
  flex: 1;
  padding: 16px 24px;
  border: none;
  border-radius: var(--radius-lg);
  font-size: 1rem;
  box-shadow: var(--shadow-md);
}

.search-box button {
  padding: 16px 32px;
  background: var(--accent);
  color: var(--white);
  border: none;
  border-radius: var(--radius-lg);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.search-box button:hover {
  background: #e55a2b;
  transform: translateY(-2px);
}

/* ===== Categories Section ===== */
.categories {
  padding: 60px 0;
  background: var(--white);
}

.section-title {
  text-align: center;
  margin-bottom: 40px;
}

.section-title h2 {
  margin-bottom: 10px;
}

.section-title p {
  color: var(--gray-600);
}

.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

.category-card {
  background: var(--gray-200);
  padding: 30px 20px;
  border-radius: var(--radius-lg);
  text-align: center;
  transition: var(--transition);
  cursor: pointer;
}

.category-card:hover {
  background: var(--primary);
  color: var(--white);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.category-card:hover h3,
.category-card:hover p {
  color: var(--white);
}

.category-icon {
  font-size: 3rem;
  margin-bottom: 15px;
}

.category-card h3 {
  margin-bottom: 5px;
  transition: var(--transition);
}

.category-card p {
  font-size: 0.9rem;
  color: var(--gray-600);
  transition: var(--transition);
}

/* ===== Products Section ===== */
.products {
  padding: 60px 0;
}

.products-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  flex-wrap: wrap;
  gap: 20px;
}

.filter-group {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 10px 20px;
  background: var(--white);
  border: 2px solid var(--gray-300);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-weight: 500;
  transition: var(--transition);
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--white);
}

.sort-select {
  padding: 10px 16px;
  border: 2px solid var(--gray-300);
  border-radius: var(--radius-md);
  background: var(--white);
  cursor: pointer;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.product-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

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

.product-image {
  height: 200px;
  background: linear-gradient(135deg, var(--gray-300) 0%, var(--gray-200) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
}

.product-badge {
  position: absolute;
  top: 15px;
  left: 15px;
  background: var(--accent);
  color: var(--white);
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
}

.product-content {
  padding: 20px;
}

.product-brand {
  font-size: 0.85rem;
  color: var(--primary);
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.product-name {
  font-size: 1.1rem;
  margin-bottom: 10px;
  color: var(--gray-900);
}

.product-specs {
  display: flex;
  gap: 15px;
  font-size: 0.85rem;
  color: var(--gray-600);
  margin-bottom: 15px;
}

.product-rating {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 15px;
}

.stars {
  color: #ffc107;
}

.reviews-count {
  color: var(--gray-500);
  font-size: 0.85rem;
}

.product-price {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 15px;
}

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

.price-original {
  font-size: 1rem;
  color: var(--gray-500);
  text-decoration: line-through;
}

.price-discount {
  font-size: 0.8rem;
  color: var(--success);
  font-weight: 600;
}

.btn {
  display: inline-block;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  border: none;
}

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

.btn-primary:hover {
  background: var(--primary-dark);
}

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

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

.btn-block {
  width: 100%;
}

/* ===== Brands Section ===== */
.brands {
  padding: 60px 0;
  background: var(--white);
}

.brands-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
}

.brand-card {
  background: var(--gray-200);
  padding: 25px;
  border-radius: var(--radius-md);
  text-align: center;
  transition: var(--transition);
}

.brand-card:hover {
  background: var(--gray-300);
  transform: scale(1.02);
}

.brand-logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gray-700);
  margin-bottom: 8px;
}

.brand-card p {
  font-size: 0.85rem;
  color: var(--gray-600);
}

/* ===== Footer ===== */
.footer {
  background: var(--dark);
  color: var(--gray-400);
  padding: 60px 0 30px;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 40px;
  margin-bottom: 40px;
}

.footer-col h4 {
  color: var(--white);
  margin-bottom: 20px;
}

.footer-col ul li {
  margin-bottom: 10px;
}

.footer-col a:hover {
  color: var(--primary);
}

.footer-bottom {
  text-align: center;
  padding-top: 30px;
  border-top: 1px solid var(--gray-700);
}

/* ===== About Page ===== */
.page-hero {
  background: linear-gradient(135deg, var(--gray-900) 0%, var(--gray-800) 100%);
  color: var(--white);
  padding: 60px 0;
  text-align: center;
}

.page-hero h1 {
  color: var(--white);
  margin-bottom: 15px;
}

.page-hero p {
  opacity: 0.8;
  max-width: 600px;
  margin: 0 auto;
}

.about-content {
  padding: 60px 0;
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 40px;
}

.about-card {
  background: var(--white);
  padding: 30px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.about-card h3 {
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ===== Product Detail Page ===== */
.product-detail {
  padding: 40px 0;
}

.product-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  background: var(--white);
  padding: 40px;
  border-radius: var(--radius-lg);
}

.product-gallery {
  position: relative;
}

.gallery-main {
  width: 100%;
  height: 400px;
  background: linear-gradient(135deg, var(--gray-300) 0%, var(--gray-200) 100%);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8rem;
}

.gallery-thumbs {
  display: flex;
  gap: 10px;
  margin-top: 15px;
}

.thumb {
  width: 80px;
  height: 80px;
  background: var(--gray-200);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.thumb:hover,
.thumb.active {
  border: 3px solid var(--primary);
}

.product-info {
  display: flex;
  flex-direction: column;
}

.product-info .product-brand {
  margin-bottom: 10px;
}

.product-info .product-name {
  font-size: 2rem;
  margin-bottom: 15px;
}

.product-info .product-rating {
  margin-bottom: 20px;
}

.specs-table {
  width: 100%;
  margin-bottom: 25px;
}

.specs-table tr {
  border-bottom: 1px solid var(--gray-300);
}

.specs-table td {
  padding: 12px 0;
}

.specs-table td:first-child {
  font-weight: 600;
  width: 40%;
  color: var(--gray-600);
}

.features-list {
  margin-bottom: 25px;
}

.features-list li {
  padding: 8px 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.features-list li::before {
  content: '✓';
  color: var(--success);
  font-weight: 700;
}

.price-box {
  background: var(--gray-200);
  padding: 20px;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
}

.price-box .price-current {
  font-size: 2rem;
}

.retailers-section {
  margin-top: 30px;
}

.retailer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px;
  background: var(--gray-200);
  border-radius: var(--radius-md);
  margin-bottom: 10px;
}

.retailer-info {
  display: flex;
  align-items: center;
  gap: 15px;
}

.retailer-name {
  font-weight: 600;
}

.retailer-price {
  font-weight: 700;
  color: var(--accent);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .nav-menu {
    display: none;
  }
  
  .mobile-menu-btn {
    display: block;
  }
  
  .hero h1 {
    font-size: 2rem;
  }
  
  .search-box {
    flex-direction: column;
  }
  
  .product-detail-grid {
    grid-template-columns: 1fr;
  }
  
  .products-header {
    flex-direction: column;
    align-items: stretch;
  }
  
  .filter-group {
    overflow-x: auto;
    padding-bottom: 10px;
  }
}

/* ===== Language Selector ===== */
.language-selector-wrapper {
  display: flex;
  align-items: center;
  margin-left: 20px;
}

#language-selector {
  padding: 8px 12px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  background: var(--white);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--gray-700);
  cursor: pointer;
  transition: var(--transition);
  min-width: 100px;
}

#language-selector:hover {
  border-color: var(--primary);
}

#language-selector:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

/* ===== Region Notice ===== */
.region-notice {
  margin-top: 15px;
  padding: 12px 20px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  color: var(--white);
  display: inline-block;
}

.region-notice strong {
  font-weight: 600;
}

/* ===== Availability Badges ===== */
.availability-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  z-index: 5;
}

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

.availability-badge.unavailable {
  background: var(--gray-600);
  color: var(--white);
}

/* ===== Availability Notice (Product Detail) ===== */
.availability-notice {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 15px;
  font-weight: 500;
  font-size: 0.95rem;
}

.availability-notice.available {
  background: rgba(40, 167, 69, 0.1);
  color: var(--success);
  border: 1px solid var(--success);
}

.availability-notice.unavailable {
  background: rgba(108, 117, 125, 0.1);
  color: var(--gray-600);
  border: 1px solid var(--gray-400);
}

/* ===== Unavailable Product Card ===== */
.product-card.product-unavailable {
  opacity: 0.7;
}

.product-card.product-unavailable .product-image {
  filter: grayscale(30%);
}

.product-card.product-unavailable .btn-primary {
  background: var(--gray-500);
  cursor: not-allowed;
}

.product-card.product-unavailable .btn-primary:hover {
  background: var(--gray-500);
  transform: none;
}

/* ===== Retailer Domain ===== */
.retailer-domain {
  font-size: 0.8rem;
  color: var(--gray-500);
}

.not-available {
  color: var(--gray-500);
  font-style: italic;
  padding: 20px;
  text-align: center;
}

/* ===== Responsive Adjustments ===== */
@media (max-width: 768px) {
  .language-selector-wrapper {
    margin-left: 0;
    margin-top: 10px;
    width: 100%;
  }
  
  #language-selector {
    width: 100%;
  }
  
  .header-inner {
    flex-wrap: wrap;
  }
  
  .nav-menu {
    order: 3;
    width: 100%;
    justify-content: center;
    margin-top: 15px;
    gap: 20px;
  }
}
