:root {
  --primary: #e74c3c;
  --primary-dark: #c0392b;
  --secondary: #2c3e50;
  --accent: #f39c12;
  --success: #27ae60;
  --light-bg: #f8f9fa;
  --border-color: #e9ecef;
  --text-muted: #6c757d;
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
  --radius: 8px;
  --radius-sm: 6px;
}

* {
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: #333;
  background: #f5f5f5;
  line-height: 1.5;
}

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

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

/* Top bar */
.top-bar {
  background: var(--secondary);
  color: #fff;
  font-size: 0.8rem;
  padding: 6px 0;
}

.top-bar a {
  color: #ddd;
}

.top-bar a:hover {
  color: #fff;
}

/* Header */
.main-header {
  background: #fff;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 1030;
}

.brand-logo-link {
  display: inline-flex;
  align-items: center;
  line-height: 0;
}

.brand-logo {
  display: block;
  height: auto;
  max-width: 100%;
}

.brand-logo--header {
  width: 180px;
}

.brand-logo--menu {
  width: 175px;
}

.brand-logo--auth {
  width: 220px;
}

@media (max-width: 575.98px) {
  .brand-logo--header {
    width: 122px;
  }
}

.search-form .form-control {
  border-radius: var(--radius) 0 0 var(--radius);
  border-right: 0;
  height: 44px;
}

.search-form .btn {
  border-radius: 0 var(--radius) var(--radius) 0;
  height: 44px;
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.search-form .btn:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
}

.header-actions .btn-link {
  color: var(--secondary);
  font-size: 0.85rem;
  position: relative;
}

.header-actions .btn-link:hover {
  color: var(--primary);
}

.header-actions .badge {
  position: absolute;
  top: -4px;
  right: -8px;
  font-size: 0.65rem;
  background: var(--primary);
}

/* Nav */
.main-nav {
  background: #fff;
  border-bottom: 1px solid var(--border-color);
}

.main-nav .nav-link {
  color: var(--secondary);
  font-weight: 500;
  font-size: 0.9rem;
  padding: 0.75rem 1rem;
}

.main-nav .nav-link:hover,
.main-nav .nav-link.active {
  color: var(--primary);
}

.dropdown-menu {
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: none;
}

/* Hero */
.hero-carousel .carousel-item img {
  height: 380px;
  object-fit: cover;
  border-radius: var(--radius);
}

.hero-carousel .carousel-caption {
  background: rgba(0, 0, 0, 0.45);
  border-radius: var(--radius);
  padding: 1.5rem;
  bottom: 2rem;
  left: 10%;
  right: 10%;
}

@media (max-width: 768px) {
  .hero-carousel .carousel-item img {
    height: 200px;
  }

  .hero-carousel .carousel-caption {
    padding: 0.75rem;
    bottom: 1rem;
    font-size: 0.85rem;
  }
}

/* Category cards */
.category-card {
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  text-align: center;
  border: 1px solid var(--border-color);
}

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

.category-card img {
  width: 100%;
  height: 120px;
  object-fit: cover;
}

.category-card .card-body {
  padding: 0.75rem;
}

.category-card .card-title {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.category-card .text-muted {
  font-size: 0.75rem;
}

/* Product cards */
.product-card {
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
  height: 100%;
  display: flex;
  flex-direction: column;
}

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

.product-card .img-wrap {
  position: relative;
  padding-top: 100%;
  overflow: hidden;
  background: #f0f0f0;
}

.product-card .img-wrap img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.product-card:hover .img-wrap img {
  transform: scale(1.05);
}

.product-card .discount-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--primary);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  z-index: 2;
}

.product-card .wishlist-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: #fff;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  z-index: 2;
  color: #999;
  cursor: pointer;
}

.product-card .wishlist-btn:hover,
.product-card .wishlist-btn.active {
  color: var(--primary);
}

.product-card .card-body {
  padding: 0.75rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.product-card .product-title {
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 0.35rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.4em;
}

.product-card .rating {
  font-size: 0.75rem;
  color: var(--accent);
  margin-bottom: 0.35rem;
}

.product-card .price-old {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-decoration: line-through;
}

.product-card .price-current {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--primary);
}

.product-card .card-footer {
  padding: 0.5rem 0.75rem;
  background: transparent;
  border-top: 1px solid var(--border-color);
}

.btn-add-cart {
  background: var(--primary);
  color: #fff;
  border: none;
  font-size: 0.8rem;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  width: 100%;
}

.btn-add-cart:hover {
  background: var(--primary-dark);
  color: #fff;
}

/* Section */
.section-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.section-title a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--primary);
}

/* Flash sale */
.flash-sale-header {
  background: linear-gradient(90deg, #e74c3c, #c0392b);
  color: #fff;
  padding: 0.75rem 1rem;
  border-radius: var(--radius) var(--radius) 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.countdown span {
  background: rgba(0, 0, 0, 0.3);
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
  margin: 0 2px;
}

/* Sidebar filters */
.filter-card {
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  padding: 1rem;
  margin-bottom: 1rem;
}

.filter-card h6 {
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.filter-card .form-check {
  margin-bottom: 0.4rem;
  font-size: 0.875rem;
}

/* Breadcrumb */
.breadcrumb {
  background: transparent;
  padding: 0.5rem 0;
  font-size: 0.85rem;
}

/* Product details */
.product-gallery .main-img {
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.product-gallery .thumb {
  width: 70px;
  height: 70px;
  object-fit: cover;
  border-radius: 4px;
  border: 2px solid transparent;
  cursor: pointer;
  margin-right: 0.5rem;
}

.product-gallery .thumb.active,
.product-gallery .thumb:hover {
  border-color: var(--primary);
}

.qty-control {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
}

.qty-control button {
  border: none;
  background: #f8f9fa;
  width: 36px;
  height: 36px;
  font-size: 1.1rem;
}

.qty-control input {
  width: 50px;
  text-align: center;
  border: none;
  height: 36px;
}

/* Cart */
.cart-item img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 4px;
}

.cart-summary {
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  padding: 1.25rem;
  position: sticky;
  top: 90px;
}

/* Footer */
.site-footer {
  background: var(--secondary);
  color: #bbb;
  padding: 3rem 0 1.5rem;
  margin-top: 3rem;
}

.site-footer h6 {
  color: #fff;
  font-weight: 600;
  margin-bottom: 1rem;
}

.site-footer a {
  color: #bbb;
  font-size: 0.875rem;
}

.site-footer a:hover {
  color: #fff;
}

.site-footer .copyright {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 1rem;
  margin-top: 2rem;
  font-size: 0.8rem;
}

/* Account sidebar */
.account-sidebar .list-group-item {
  border: none;
  border-radius: var(--radius-sm) !important;
  margin-bottom: 0.25rem;
  font-size: 0.9rem;
}

.account-sidebar .list-group-item.active {
  background: var(--primary);
  color: #fff;
}

/* Toast */
.toast-container {
  z-index: 1090;
}

/* Empty states */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  background: #fff;
  border-radius: var(--radius);
}

.empty-state i {
  font-size: 3rem;
  color: #ccc;
  margin-bottom: 1rem;
}

/* Responsive tweaks */
@media (max-width: 991.98px) {
  .search-form {
    margin-top: 0.5rem;
  }
}

@media (max-width: 575.98px) {
  .product-card .product-title {
    font-size: 0.8rem;
  }

  .product-card .price-current {
    font-size: 0.95rem;
  }
}

/* Loading spinner */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

/* Buttons */
.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
}

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

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

.btn-outline-primary:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* ============================================================
 *  Variant Modal — modern UI
 * ============================================================ */
.variant-modal .modal-content {
  border: 0;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
}

/* Close button */
.variant-modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 10;
  background: rgba(255, 255, 255, .9);
  border-radius: 50%;
  padding: 10px;
  opacity: .85;
  transition: opacity .2s, transform .2s;
}

.variant-modal__close:hover {
  opacity: 1;
  transform: rotate(90deg);
}

/* ── Media (left column) ─────────────────────────────── */
.variant-modal__media {
  position: relative;
  background: #f5f5f7;
  min-height: 340px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.variant-modal__image {
  max-width: 100%;
  max-height: 400px;
  object-fit: contain;
  border-radius: 12px;
  transition: transform .3s ease;
}

.variant-modal__image:hover {
  transform: scale(1.04);
}

.variant-modal__badge {
  position: absolute;
  top: 16px;
  left: 16px;
  padding: 6px 12px;
  background: #ff3b30;
  color: #fff;
  font-size: .75rem;
  font-weight: 700;
  border-radius: 999px;
  box-shadow: 0 4px 14px rgba(255, 59, 48, .35);
  animation: pulseBadge 1.6s ease-in-out infinite;
}

@keyframes pulseBadge {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.06);
  }
}

/* ── Info (right column) ─────────────────────────────── */
.variant-modal__info {
  padding: 28px 32px;
}

.variant-modal__title {
  font-size: 1.15rem;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 12px;
  padding-right: 40px;
  /* leave room for close button */
  line-height: 1.4;
}

/* Price block */
.variant-modal__price {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 6px;
}

.variant-modal__price .price-current {
  font-size: 1.6rem;
  font-weight: 700;
  color: #ff3b30;
}

.variant-modal__price .price-old {
  font-size: .95rem;
  color: #999;
  text-decoration: line-through;
}

.variant-modal__price .price-save {
  font-size: .75rem;
  padding: 3px 8px;
  border-radius: 6px;
  background: #e7f6ec;
  color: #198754;
  font-weight: 600;
}

.variant-modal__divider {
  height: 1px;
  background: #ececec;
  margin: 18px 0;
}

/* ── Rows ───────────────────────────────────────────── */
.variant-modal__row {
  margin-bottom: 22px;
}

.variant-modal__row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.variant-modal__row-head label {
  font-weight: 600;
  font-size: .9rem;
  color: #1a1a1a;
  margin: 0;
}

/* ── Color swatches ─────────────────────────────────── */
.variant-modal__swatches {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 10px 12px;
}

.variant-modal__swatch-option {
  min-width: 48px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.variant-modal__swatch-name {
  max-width: 84px;
  color: #555;
  font-size: .75rem;
  line-height: 1.2;
  text-align: center;
  overflow-wrap: anywhere;
}

.swatch {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid #e0e0e0;
  background: #fff;
  cursor: pointer;
  position: relative;
  transition: transform .15s ease, border-color .15s ease;
  padding: 2px;
}

.swatch:hover {
  transform: scale(1.08);
  border-color: #999;
}

.swatch__inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #ccc;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06);
}

.swatch.is-active {
  border-color: #0d6efd;
  box-shadow: 0 0 0 3px rgba(13, 110, 253, .15);
}

.swatch.is-active::after {
  content: '\F26E';
  /* bi-check-lg */
  font-family: 'bootstrap-icons';
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: .85rem;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .4);
  pointer-events: none;
}

.swatch.is-out {
  opacity: .35;
  cursor: not-allowed;
  position: relative;
}

.swatch.is-out::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg,
      transparent 45%,
      #999 47%, #999 53%,
      transparent 55%);
  border-radius: 50%;
  pointer-events: none;
}

/* ── Size pills ─────────────────────────────────────── */
.variant-modal__sizes {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.size-pill {
  min-width: 52px;
  height: 42px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid #e0e0e0;
  border-radius: 10px;
  background: #fff;
  color: #1a1a1a;
  font-size: .9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s ease;
}

.size-pill:hover:not(.is-out) {
  border-color: #0d6efd;
  color: #0d6efd;
  transform: translateY(-1px);
}

.size-pill.is-active {
  background: #0d6efd;
  border-color: #0d6efd;
  color: #fff;
  box-shadow: 0 4px 12px rgba(13, 110, 253, .35);
}

.size-pill.is-out {
  color: #bbb;
  background: #f7f7f7;
  cursor: not-allowed;
  position: relative;
}

.size-pill.is-out::after {
  content: '';
  position: absolute;
  left: 8px;
  right: 8px;
  top: 50%;
  height: 1px;
  background: #bbb;
  transform: rotate(-12deg);
}

/* ── Quantity stepper ───────────────────────────────── */
.qty-stepper {
  display: inline-flex;
  align-items: center;
  border: 1.5px solid #e0e0e0;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

.qty-stepper__btn {
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  color: #1a1a1a;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background .15s ease;
}

.qty-stepper__btn:hover {
  background: #f2f2f2;
}

.qty-stepper__btn:active {
  background: #e6e6e6;
}

.qty-stepper input {
  width: 56px;
  height: 44px;
  border: 0;
  text-align: center;
  font-weight: 600;
  font-size: 1rem;
  background: transparent;
  -moz-appearance: textfield;
  appearance: textfield;
}

.qty-stepper input::-webkit-outer-spin-button,
.qty-stepper input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* ── Sticky footer ──────────────────────────────────── */
.variant-modal__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 28px;
  background: #fafafa;
  border-top: 1px solid #ececec;
  gap: 16px;
}

.variant-modal__total strong {
  font-size: 1.35rem;
  color: #1a1a1a;
  font-weight: 700;
}

.variant-modal__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.variant-modal__actions .btn-primary {
  padding: 12px 28px;
  font-weight: 600;
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(13, 110, 253, .3);
  transition: transform .15s ease, box-shadow .15s ease;
}

.variant-modal__actions .btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(13, 110, 253, .4);
}

.variant-modal__actions .btn-primary:disabled {
  box-shadow: none;
}

/* ── Mobile: bottom sheet ───────────────────────────── */
@media (max-width: 767.98px) {
  .variant-modal .modal-dialog {
    margin: 0;
    align-items: flex-end;
    min-height: 100vh;
  }

  .variant-modal .modal-content {
    border-radius: 20px 20px 0 0;
    max-height: 92vh;
  }

  .variant-modal__media {
    min-height: 220px;
    padding: 16px;
  }

  .variant-modal__image {
    max-height: 220px;
  }

  .variant-modal__info {
    padding: 20px 20px 8px;
  }

  .variant-modal__title {
    font-size: 1rem;
  }

  .variant-modal__price .price-current {
    font-size: 1.35rem;
  }

  .variant-modal__footer {
    padding: 14px 20px;
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .variant-modal__total {
    text-align: center;
  }

  .variant-modal__actions {
    width: 100%;
  }

  .variant-modal__actions .btn {
    flex: 1;
  }
}

/* ── Fade-in for modal content ──────────────────────── */
.variant-modal.show .modal-content {
  animation: modalSlideIn .3s cubic-bezier(.22, 1, .36, 1);
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
.product-color-swatch {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 1px solid rgba(0, 0, 0, .18);
  border-radius: 50%;
  vertical-align: -0.15rem;
  margin-right: .35rem;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .15);
}
