:root {
  --primary: #1565c0;
  --primary-dark: #0d47a1;
  --primary-light: #1e88e5;
  --accent: #ff9800;
  --accent-dark: #f57c00;
  --danger: #e53935;
  --success: #43a047;
  --text: #263238;
  --text-muted: #607d8b;
  --bg: #f5f7fa;
  --white: #ffffff;
  --border: #e0e6ed;
  --shadow: 0 4px 20px rgba(21, 101, 192, 0.08);
  --radius: 8px;
  --font: "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  color: var(--accent);
}

.container {
  width: min(1200px, 92%);
  margin: 0 auto;
}

/* Top bar */
.top-bar {
  background: var(--primary-dark);
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.85rem;
  padding: 8px 0;
}

.top-bar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.top-bar a {
  color: rgba(255, 255, 255, 0.9);
}

.top-bar a:hover {
  color: var(--accent);
}

/* Header */
.site-header {
  background: var(--white);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-main {
  padding: 16px 0;
}

.header-main .container {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 24px;
  align-items: center;
}

.logo-link {
  display: flex;
  align-items: center;
}

.logo-link img,
.logo-link svg {
  height: 42px;
  width: auto;
}

.search-form {
  display: flex;
  max-width: 560px;
  width: 100%;
  margin: 0 auto;
}

.search-form input {
  flex: 1;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-right: none;
  border-radius: var(--radius) 0 0 var(--radius);
  font-size: 1rem;
}

.search-form input:focus {
  outline: none;
  border-color: var(--primary-light);
}

.search-form button {
  padding: 12px 24px;
  background: var(--primary);
  color: var(--white);
  border: none;
  border-radius: 0 var(--radius) var(--radius) 0;
  cursor: pointer;
  font-weight: 600;
}

.search-form button:hover {
  background: var(--primary-dark);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

.header-actions a,
.cart-trigger {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 0.75rem;
  color: var(--text);
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.header-actions .icon {
  font-size: 1.4rem;
  color: var(--primary);
}

.badge-count {
  background: var(--danger);
  color: var(--white);
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

/* Nav */
.nav-bar {
  background: var(--primary);
}

.nav-inner {
  display: flex;
  align-items: stretch;
  flex-wrap: wrap;
}

.departments-btn {
  background: var(--primary-dark);
  color: var(--white);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
}

.nav-links {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1;
  flex-wrap: wrap;
}

.nav-links a {
  color: var(--white);
  padding: 14px 18px;
  display: block;
  font-weight: 500;
  transition: background 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
  background: rgba(255, 255, 255, 0.15);
  color: var(--white);
}

.nav-cta {
  background: var(--danger);
  color: var(--white) !important;
  margin: 6px 8px;
  border-radius: var(--radius);
  align-self: center;
}

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--white);
  font-size: 1.5rem;
  padding: 10px;
  cursor: pointer;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  transition: transform 0.15s, background 0.2s;
  font-family: inherit;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--primary);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--primary-dark);
  color: var(--white);
}

.btn-accent {
  background: var(--accent);
  color: var(--white);
}

.btn-accent:hover {
  background: var(--accent-dark);
  color: var(--white);
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
}

.btn-danger {
  background: var(--danger);
  color: var(--white);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.85rem;
}

/* Hero layout */
.hero-section {
  padding: 24px 0;
}

.hero-grid {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 20px;
}

.category-sidebar {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.category-sidebar h3 {
  background: var(--primary);
  color: var(--white);
  margin: 0;
  padding: 14px 16px;
  font-size: 1rem;
}

.category-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.category-list li a {
  display: flex;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-size: 0.9rem;
}

.category-list li a:hover {
  background: #f0f4f8;
  color: var(--primary);
}

.category-list .count {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.hero-slider {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  min-height: 380px;
  background: linear-gradient(135deg, #1565c0 0%, #42a5f5 50%, #ff9800 100%);
}

.hero-slide {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  padding: 40px;
  min-height: 380px;
  color: var(--white);
}

.hero-slide h1 {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  margin: 0 0 12px;
  line-height: 1.2;
}

.hero-slide p {
  font-size: 1.05rem;
  opacity: 0.95;
  margin-bottom: 24px;
}

.hero-slide img {
  border-radius: var(--radius);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
  max-height: 300px;
  object-fit: cover;
  width: 100%;
}

.hero-dots {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
}

.hero-dots button {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
}

.hero-dots button.active {
  background: var(--white);
  width: 28px;
  border-radius: 5px;
}

/* Promo banners */
.promo-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 24px 0;
}

.promo-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  align-items: center;
  box-shadow: var(--shadow);
  min-height: 140px;
}

.promo-card img {
  width: 45%;
  height: 140px;
  object-fit: cover;
}

.promo-card .promo-text {
  padding: 16px;
}

.promo-card h4 {
  margin: 0 0 8px;
  color: var(--primary);
}

.promo-strip {
  background: linear-gradient(90deg, var(--primary) 0%, #ffc107 100%);
  color: var(--white);
  text-align: center;
  padding: 14px;
  border-radius: var(--radius);
  font-weight: 600;
  margin-bottom: 32px;
}

/* Section */
.section {
  padding: 48px 0;
}

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 12px;
}

.section-title h2 {
  margin: 0;
  font-size: 1.75rem;
  color: var(--text);
  position: relative;
  padding-left: 16px;
}

.section-title h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 4px;
  background: var(--accent);
  border-radius: 2px;
}

/* Products */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}

.product-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.2s;
  position: relative;
}

.product-card:hover {
  transform: translateY(-4px);
}

.product-thumb {
  position: relative;
  padding: 16px;
  background: #fafbfc;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  max-height: 180px;
}

.product-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--white);
  text-transform: uppercase;
}

.product-badge.hot {
  background: var(--danger);
}

.product-badge.new {
  background: var(--success);
}

.product-body {
  padding: 16px;
}

.product-body h3 {
  margin: 0 0 8px;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.35;
  min-height: 2.7em;
}

.product-body h3 a {
  color: var(--text);
}

.product-body h3 a:hover {
  color: var(--primary);
}

.price-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 12px;
}

.price {
  color: var(--danger);
  font-size: 1.15rem;
  font-weight: 700;
}

.price-old {
  color: var(--text-muted);
  text-decoration: line-through;
  font-size: 0.85rem;
}

.product-actions {
  display: flex;
  gap: 8px;
}

.product-actions .btn {
  flex: 1;
}

/* Deals */
.deals-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 20px;
}

.deal-featured {
  background: var(--white);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  text-align: center;
}

.deal-featured img {
  max-height: 200px;
  margin: 0 auto 16px;
  object-fit: contain;
}

.countdown {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 16px 0;
}

.countdown span {
  background: var(--primary-dark);
  color: var(--white);
  padding: 8px 10px;
  border-radius: 4px;
  font-size: 0.85rem;
  min-width: 48px;
}

.countdown span b {
  display: block;
  font-size: 1.1rem;
}

/* Blog cards */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
}

.blog-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.blog-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.blog-card-body {
  padding: 20px;
}

.blog-date {
  display: inline-block;
  background: var(--accent);
  color: var(--white);
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.75rem;
  margin-bottom: 10px;
}

/* Clearance banner */
.clearance-banner {
  background: linear-gradient(135deg, #263238 0%, #37474f 100%);
  color: var(--white);
  text-align: center;
  padding: 56px 24px;
  border-radius: var(--radius);
  margin: 32px 0;
}

.clearance-banner h2 {
  font-size: 2rem;
  margin: 0 0 12px;
}

/* Brands */
.brand-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 32px;
  padding: 24px;
  background: var(--white);
  border-radius: var(--radius);
  opacity: 0.7;
  font-weight: 700;
  color: var(--text-muted);
  font-size: 1.1rem;
}

/* Footer */
.site-footer {
  margin-top: 48px;
}

.footer-top {
  background: var(--primary);
  color: var(--white);
  padding: 40px 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
}

.footer-grid h4 {
  margin: 0 0 16px;
  font-size: 1.1rem;
}

.footer-grid p,
.footer-grid li {
  font-size: 0.9rem;
  opacity: 0.92;
  line-height: 1.8;
}

.footer-grid ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-grid a {
  color: rgba(255, 255, 255, 0.9);
}

.footer-grid a:hover {
  color: var(--accent);
}

.social-links {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.social-links a {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.social-links a:hover {
  background: var(--accent);
}

.footer-newsletter input {
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: var(--radius);
  margin-bottom: 8px;
}

.footer-bottom {
  background: var(--primary-dark);
  color: rgba(255, 255, 255, 0.85);
  padding: 20px 0;
  font-size: 0.85rem;
}

.footer-bottom .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.payment-icons {
  display: flex;
  gap: 8px;
  font-size: 0.75rem;
  font-weight: 600;
}

.payment-icons span {
  background: var(--white);
  color: var(--text);
  padding: 4px 10px;
  border-radius: 4px;
}

/* Page hero */
.page-hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: var(--white);
  padding: 48px 0;
  text-align: center;
}

.page-hero h1 {
  margin: 0 0 8px;
  font-size: 2.25rem;
}

.breadcrumb {
  font-size: 0.9rem;
  opacity: 0.9;
}

.breadcrumb a {
  color: var(--white);
}

/* Content pages */
.content-page {
  padding: 48px 0 64px;
}

.content-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 40px;
  box-shadow: var(--shadow);
  max-width: 900px;
  margin: 0 auto;
}

.content-card h2 {
  color: var(--primary);
  margin-top: 2rem;
  font-size: 1.35rem;
}

.content-card h2:first-child {
  margin-top: 0;
}

.content-card p,
.content-card li {
  color: var(--text);
  line-height: 1.75;
}

.content-wide {
  max-width: 1200px;
  margin: 0 auto;
}

/* Forms */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  font-size: 0.9rem;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary-light);
}

.form-group input.invalid,
.form-group textarea.invalid,
.form-group select.invalid {
  border-color: var(--danger);
}

.field-error {
  color: var(--danger);
  font-size: 0.8rem;
  margin-top: 4px;
  display: none;
}

.field-error.visible {
  display: block;
}

.checkbox-group {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 20px;
}

.checkbox-group input[type="checkbox"] {
  width: 20px;
  height: 20px;
  min-width: 20px;
  margin: 2px 0 0;
  accent-color: var(--primary);
  cursor: pointer;
  flex-shrink: 0;
}

.checkbox-group label {
  font-weight: 400;
  font-size: 0.9rem;
  line-height: 1.5;
  cursor: pointer;
  flex: 1;
}

.form-success {
  background: #e8f5e9;
  border: 2px solid var(--success);
  color: #2e7d32;
  padding: 20px;
  border-radius: var(--radius);
  font-weight: 600;
  text-align: center;
  display: none;
}

.form-success.visible {
  display: block;
}

/* Cart drawer */
.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s;
}

.cart-overlay.open {
  opacity: 1;
  visibility: visible;
}

.cart-drawer {
  position: fixed;
  top: 0;
  right: -420px;
  width: min(400px, 92vw);
  height: 100vh;
  background: var(--white);
  z-index: 2001;
  display: flex;
  flex-direction: column;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
  transition: right 0.3s;
}

.cart-drawer.open {
  right: 0;
}

.cart-header {
  padding: 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.cart-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.cart-item img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  background: #f5f5f5;
  border-radius: 4px;
}

.cart-item-info {
  flex: 1;
}

.cart-item-info h4 {
  margin: 0 0 4px;
  font-size: 0.85rem;
}

.cart-footer {
  padding: 20px;
  border-top: 1px solid var(--border);
}

.cart-total {
  display: flex;
  justify-content: space-between;
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 16px;
}

.qty-control {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.qty-control button {
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  background: var(--white);
  cursor: pointer;
  border-radius: 4px;
}

/* Shop filters */
.shop-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 24px;
  padding: 32px 0;
}

.filter-panel {
  background: var(--white);
  padding: 20px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  height: fit-content;
}

.filter-panel h3 {
  margin: 0 0 12px;
  font-size: 1rem;
}

.filter-list {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
}

.filter-list label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  cursor: pointer;
  font-size: 0.9rem;
}

.filter-list input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

/* About */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
}

.about-grid img {
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-top: 40px;
}

.stat-box {
  background: var(--primary);
  color: var(--white);
  padding: 24px;
  border-radius: var(--radius);
  text-align: center;
}

.stat-box b {
  display: block;
  font-size: 2rem;
}

/* Contact */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}

.contact-info-block {
  background: var(--white);
  padding: 32px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* Triple columns */
.triple-columns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.mini-product-list .item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.mini-product-list img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  background: #fafbfc;
  border-radius: 4px;
}

.mini-product-list .price {
  font-size: 0.95rem;
}

.column-card {
  background: var(--white);
  padding: 20px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.column-card h3 {
  margin: 0 0 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--primary);
  font-size: 1.1rem;
}

/* Responsive */
@media (max-width: 992px) {
  .hero-grid,
  .deals-grid,
  .shop-layout {
    grid-template-columns: 1fr;
  }

  .category-sidebar {
    display: none;
  }

  .hero-slide {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .promo-row {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .about-grid,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .triple-columns {
    grid-template-columns: 1fr;
  }

  .stats-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .header-main .container {
    grid-template-columns: 1fr auto;
  }

  .search-form {
    grid-column: 1 / -1;
    order: 3;
    max-width: none;
  }

  .mobile-toggle {
    display: block;
  }

  .nav-links {
    display: none;
    width: 100%;
    flex-direction: column;
  }

  .nav-links.open {
    display: flex;
  }

  .departments-btn {
    display: none;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .content-card {
    padding: 24px;
  }
}