/* ============================================================
   COMPONENTS — Reusable UI Components
   Buttons, Badges, Forms, Cards, Toast, Modal
   Each block is independent and composable.
   ============================================================ */

/* ╔══════════════════════════════════╗
   ║  BUTTONS                         ║
   ╚══════════════════════════════════╝ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: 11px 24px;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.3px;
  border-radius: var(--r-full);
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: all var(--t-fast) var(--ease-out);
  white-space: nowrap;
  text-decoration: none;
  user-select: none;
  position: relative;
  overflow: hidden;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

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

.btn--primary:hover:not(:disabled) {
  background: var(--accent);
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px var(--accent-muted2);
}

.btn--primary:active:not(:disabled) {
  transform: translateY(0);
}

/* Accent */
.btn--accent {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.btn--accent:hover:not(:disabled) {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px var(--accent-muted2);
}

/* Ghost */
.btn--ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border-2);
}

.btn--ghost:hover:not(:disabled) {
  background: var(--surface);
  border-color: var(--border-2);
}

/* Danger */
.btn--danger {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: rgba(194, 60, 30, 0.2);
}

.btn--danger:hover:not(:disabled) {
  background: var(--danger);
  color: #fff;
}

/* Sizes */
.btn--sm {
  padding: 8px 18px;
  font-size: var(--text-xs);
}

.btn--lg {
  padding: 15px 36px;
  font-size: var(--text-base);
}

.btn--xl {
  padding: 18px 48px;
  font-size: var(--text-md);
}

.btn--icon {
  padding: 10px;
  border-radius: var(--r-sm);
}

/* Mobile: make buttons easier to tap */
@media (max-width: 640px) {
  .btn {
    padding: 12px 20px;
    font-size: var(--text-sm);
  }

  .btn--sm {
    padding: 10px 16px;
  }

  .btn--lg {
    padding: 16px 32px;
  }

  .btn--xl {
    padding: 18px 40px;
  }
}

/* Loading state */
.btn.is-loading {
  pointer-events: none;
  color: transparent;
}

.btn.is-loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}


/* ╔══════════════════════════════════╗
   ║  BADGES                          ║
   ╚══════════════════════════════════╝ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  padding: 3px 10px;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  border-radius: var(--r-full);
}

.badge--accent {
  background: var(--accent-light);
  color: var(--accent-hover);
}

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

.badge--danger {
  background: var(--danger-bg);
  color: var(--danger);
}

.badge--warning {
  background: var(--warning-bg);
  color: var(--warning);
}

.badge--neutral {
  background: var(--surface);
  color: var(--text-2);
}

.badge--dark {
  background: var(--text);
  color: var(--bg);
}


/* ╔══════════════════════════════════╗
   ║  FORM ELEMENTS                   ║
   ╚══════════════════════════════════╝ */

.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.form-group--row {
  flex-direction: row;
  align-items: center;
  gap: var(--sp-4);
}

.form-label {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text-2);
}

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

.form-control {
  width: 100%;
  padding: 11px 16px;
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  line-height: 1;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}

.form-control:hover {
  border-color: var(--border-2);
}

.form-control:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-muted);
}

.form-control.is-error {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(194, 60, 30, 0.10);
}

.form-control::placeholder {
  color: var(--text-3);
}

.form-control[type="select"],
select.form-control {
  appearance: none;
  cursor: pointer;
}

.form-error {
  font-size: var(--text-xs);
  color: var(--danger);
  display: flex;
  align-items: center;
  gap: var(--sp-1);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-4);
}

.form-grid .form-group--full {
  grid-column: 1 / -1;
}

@media (max-width: 600px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}

/* Payment option cards */
.pay-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-3);
}

/* Mobile: stack payment options */
@media (max-width: 640px) {
  .pay-options {
    grid-template-columns: 1fr;
    gap: var(--sp-2);
  }

  .pay-option {
    flex-direction: row;
    justify-content: flex-start;
    padding: var(--sp-3) var(--sp-4);
  }

  .pay-option__icon {
    font-size: 20px;
  }

  .pay-option__label {
    font-size: var(--text-sm);
  }
}

.pay-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: var(--sp-4) var(--sp-3);
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--r);
  cursor: pointer;
  transition: all var(--t-fast) var(--ease-out);
}

.pay-option:hover {
  border-color: var(--border-2);
  background: var(--surface);
}

.pay-option.is-selected {
  border-color: var(--accent);
  background: var(--accent-light);
  box-shadow: 0 0 0 3px var(--accent-muted);
}

.pay-option__icon {
  font-size: 24px;
}

.pay-option__label {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: 0.3px;
}

.pay-option.is-selected .pay-option__label {
  color: var(--accent-hover);
}


/* ╔══════════════════════════════════╗
   ║  PRODUCT CARD                    ║
   ╚══════════════════════════════════╝ */

.product-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform var(--t) var(--ease-out), box-shadow var(--t) var(--ease-out), border-color var(--t-fast);
  cursor: pointer;
}

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

.product-card__image {
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 80px;
  line-height: 1;
  position: relative;
  overflow: hidden;
}

/* Hide emoji placeholder - user requested no emojis */
.product-card__image .product-card__placeholder {
  display: none !important;
}

.product-card__image span[role="img"] {
  display: none !important;
}

/* Mobile: smaller emoji */
@media (max-width: 640px) {
  .product-card__image {
    font-size: 60px;
  }

  .product-card__body {
    padding: var(--sp-3) var(--sp-4) var(--sp-4);
  }

  .product-card__name {
    font-size: var(--text-base);
  }

  .product-card__desc {
    font-size: 12px;
  }

  .product-card__price {
    font-size: var(--text-lg);
  }
}

.product-card__image::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  transition: background var(--t-fast);
}

.product-card:hover .product-card__image::after {
  background: rgba(0, 0, 0, 0.03);
}

.product-card__badges {
  position: absolute;
  top: var(--sp-3);
  left: var(--sp-3);
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}

.product-card__out-of-stock {
  position: absolute;
  inset: 0;
  background: rgba(248, 243, 235, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-2);
  backdrop-filter: blur(2px);
}

.product-card__body {
  padding: var(--sp-4) var(--sp-5) var(--sp-5);
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: var(--sp-3);
}

.product-card__category {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent);
}

.product-card__name {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  color: var(--text);
  line-height: 1.3;
}

.product-card__desc {
  font-size: var(--text-sm);
  color: var(--text-2);
  line-height: 1.55;
  flex: 1;
}

.product-card__footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-top: auto;
  padding-top: var(--sp-3);
  border-top: 1px solid var(--border);
  gap: var(--sp-3);
}

.product-card__price-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.product-card__price {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  color: var(--text);
  line-height: 1;
}

.product-card__original-price {
  font-size: var(--text-xs);
  color: var(--text-3);
  text-decoration: line-through;
}

.product-card__savings {
  font-size: var(--text-xs);
  color: var(--success);
  font-weight: 600;
}

.product-card__add-btn {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--text);
  color: var(--bg);
  border: none;
  border-radius: var(--r-full);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: all var(--t-fast) var(--ease-out);
  padding-bottom: 1px;
}

.product-card__add-btn:hover {
  background: var(--accent);
  transform: scale(1.1);
}

.product-card__add-btn:active {
  transform: scale(0.95);
}

.product-card__add-btn.is-in-cart {
  background: var(--accent);
}

/* Rating */
.product-card__rating {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  font-size: var(--text-xs);
  color: var(--text-2);
}




/* ╔══════════════════════════════════╗
   ║  CART ITEM                       ║
   ╚══════════════════════════════════╝ */

.cart-item {
  display: flex;
  align-items: center;
  gap: var(--sp-5);
  padding: var(--sp-5);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  transition: box-shadow var(--t-fast);
}

.cart-item:hover {
  box-shadow: var(--shadow-xs);
}

.cart-item__thumb {
  flex-shrink: 0;
  width: 80px;
  height: 80px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 42px;
  border: 1px solid var(--border);
}

/* Hide emoji in cart - user requested no emojis */
.cart-item__thumb span[role="img"] {
  display: none !important;
}

.cart-item__info {
  flex: 1;
  min-width: 0;
}

.cart-item__category {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 2px;
}

.cart-item__name {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-item__unit-price {
  font-size: var(--text-sm);
  color: var(--text-3);
  margin-top: 2px;
}

.cart-item__controls {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-shrink: 0;
}

.qty-control {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  padding: var(--sp-1) var(--sp-2);
}

.qty-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 50%;
  font-size: 16px;
  color: var(--text);
  cursor: pointer;
  transition: all var(--t-fast);
  line-height: 1;
  flex-shrink: 0;
}

.qty-btn:hover {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

.qty-btn:active {
  transform: scale(0.9);
}

.qty-value {
  min-width: 28px;
  text-align: center;
  font-weight: 700;
  font-size: var(--text-sm);
}

.cart-item__subtotal {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  color: var(--text);
  min-width: 90px;
  text-align: right;
}

.cart-item__remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  color: var(--text-3);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: all var(--t-fast);
  font-size: 14px;
  background: none;
  border: none;
  flex-shrink: 0;
}

.cart-item__remove:hover {
  color: var(--danger);
  background: var(--danger-bg);
}

@media (max-width: 600px) {
  .cart-item {
    flex-wrap: wrap;
    gap: var(--sp-3);
    padding: var(--sp-4);
  }

  .cart-item__thumb {
    width: 60px;
    height: 60px;
    font-size: 32px;
  }

  .cart-item__name {
    font-size: var(--text-base);
  }

  .cart-item__controls {
    width: 100%;
    justify-content: space-between;
  }

  .cart-item__subtotal {
    min-width: 70px;
    font-size: var(--text-lg);
  }
}


/* ╔══════════════════════════════════╗
   ║  ORDER SUMMARY CARD              ║
   ╚══════════════════════════════════╝ */

.summary-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-6);
  position: sticky;
  top: calc(var(--navbar-h) + var(--sp-6));
}

/* Mobile: remove sticky behavior */
@media (max-width: 900px) {
  .summary-card {
    position: relative;
    top: auto;
  }
}

.summary-card__title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  margin-bottom: var(--sp-5);
}

.summary-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--sp-2) 0;
  font-size: var(--text-sm);
  color: var(--text-2);
}

.summary-line:not(:last-child) {
  border-bottom: 1px dashed var(--border);
}

.summary-line--total {
  padding: var(--sp-4) 0 0;
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text);
  border-top: 2px solid var(--text);
  margin-top: var(--sp-2);
  border-bottom: none;
}

.summary-line__val {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  color: var(--text);
}

.summary-line--total .summary-line__val {
  font-size: var(--text-2xl);
}

.summary-line--free .summary-line__val {
  color: var(--success);
  font-size: var(--text-base);
  font-family: var(--font-body);
  font-weight: 600;
}

.summary-mini-items {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  margin-bottom: var(--sp-5);
}

.summary-mini-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  font-size: var(--text-sm);
}

.summary-mini-item__emoji {
  /* Hidden - user requested to remove emojis */
  display: none !important;
}

.summary-mini-item__name {
  flex: 1;
  color: var(--text);
  font-weight: 500;
}

.summary-mini-item__qty {
  color: var(--text-3);
}

.summary-mini-item__price {
  font-family: var(--font-display);
  font-size: var(--text-md);
  color: var(--text);
  min-width: 70px;
  text-align: right;
}


/* ╔══════════════════════════════════╗
   ║  TOAST NOTIFICATIONS             ║
   ╚══════════════════════════════════╝ */

#toast-mount {
  position: fixed;
  top: calc(var(--navbar-h) + var(--sp-4));
  right: var(--sp-6);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  pointer-events: none;
}

/* Mobile: center toasts and adjust position */
@media (max-width: 640px) {
  #toast-mount {
    left: var(--sp-4);
    right: var(--sp-4);
    top: calc(var(--navbar-h) + var(--sp-3));
    align-items: center;
  }
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-5);
  background: var(--text);
  color: var(--bg);
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-md);
  font-size: var(--text-sm);
  font-weight: 500;
  max-width: 340px;
  animation: toast-in 0.3s var(--ease-out) forwards;
  pointer-events: auto;
}

.toast.is-leaving {
  animation: toast-out 0.25s var(--ease-out) forwards;
}

.toast--success {
  border-left: 3px solid var(--success);
}

.toast--danger {
  border-left: 3px solid var(--danger);
}

.toast--info {
  border-left: 3px solid var(--info);
}

.toast--warning {
  border-left: 3px solid var(--warning);
}

.toast__icon {
  font-size: 16px;
  flex-shrink: 0;
}

.toast__msg {
  flex: 1;
}

/* Mobile: adjust toast size */
@media (max-width: 640px) {
  .toast {
    max-width: 100%;
    font-size: 12px;
    padding: var(--sp-2) var(--sp-4);
  }
}


/* ╔══════════════════════════════════╗
   ║  SECTION TITLE                   ║
   ╚══════════════════════════════════╝ */

.section-header {
  margin-bottom: var(--sp-8);
}

.section-header__eyebrow {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--sp-2);
}

.section-header__title {
  font-family: var(--font-display);
  font-size: var(--text-4xl);
  color: var(--text);
  line-height: 1.15;
}

.section-header__subtitle {
  color: var(--text-2);
  margin-top: var(--sp-3);
  max-width: 480px;
  font-size: var(--text-base);
}


/* ╔══════════════════════════════════╗
   ║  PRODUCT MODAL                   ║
   ╚══════════════════════════════════╝ */

.product-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  background: rgba(0, 0, 0, 0);
  backdrop-filter: blur(0px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-6);
  opacity: 0;
  pointer-events: none;
  /* Fix: prevent blocking clicks when hidden */
  transition: opacity var(--t) var(--ease-out), backdrop-filter var(--t) var(--ease-out);
}

.product-modal-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
  /* Fix: enable interactions when open */
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
}

.product-modal-overlay.is-closing {
  opacity: 0;
  backdrop-filter: blur(0px);
}

.product-modal {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  width: 100%;
  max-width: 920px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: scale(0.95);
  opacity: 0;
  transition: transform var(--t) var(--ease-out), opacity var(--t) var(--ease-out);
  position: relative;
}

.product-modal-overlay.is-open .product-modal {
  transform: scale(1);
  opacity: 1;
}

.product-modal__close {
  position: absolute;
  top: var(--sp-6);
  right: var(--sp-6);
  z-index: 10;
  width: 40px;
  height: 40px;
  border: none;
  background: var(--surface);
  color: var(--text-2);
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--t-fast);
}

.product-modal__close:hover {
  background: var(--danger-bg);
  color: var(--danger);
  transform: rotate(90deg);
}

.product-modal__grid {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: var(--sp-8);
}

.product-modal__image-col {
  position: sticky;
  top: 0;
  height: fit-content;
}

.product-modal__image {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-lg) 0 0 var(--r-lg);
  position: relative;
  overflow: hidden;
}

.product-modal__emoji {
  /* Hidden - user requested to remove emojis */
  display: none !important;
}

.product-modal__out-badge {
  position: absolute;
  inset: 0;
  background: rgba(248, 243, 235, 0.85);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-base);
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--danger);
}

.product-modal__info-col {
  padding: var(--sp-8) var(--sp-8) var(--sp-8) 0;
}

.product-modal__title {
  font-size: var(--text-3xl);
  margin-bottom: var(--sp-3);
  line-height: 1.2;
}

.product-modal__rating {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--text-sm);
  margin-bottom: var(--sp-5);
}

.product-modal__price-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-5);
  flex-wrap: wrap;
}

.product-modal__price {
  font-family: var(--font-display);
  font-size: var(--text-4xl);
  color: var(--text);
  line-height: 1;
}

.product-modal__original-price {
  font-size: var(--text-lg);
  color: var(--text-3);
  text-decoration: line-through;
}

.product-modal__description {
  font-size: var(--text-base);
  line-height: 1.7;
  color: var(--text-2);
  margin-bottom: var(--sp-6);
}

.product-modal__stock-alert {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4);
  background: var(--warning-bg);
  border: 1px solid rgba(153, 104, 0, 0.2);
  border-radius: var(--r-sm);
  font-size: var(--text-sm);
  color: var(--warning);
  margin-top: var(--sp-5);
}

/* ── Variant Selector ──────────────────────────────────── */

.variant-selector {
  margin-bottom: var(--sp-5);
}

.variant-selector__label {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-2);
  margin-bottom: var(--sp-3);
}

.variant-selector__options {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

.variant-option {
  padding: var(--sp-2) var(--sp-4);
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: var(--r-sm);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--t-fast) var(--ease-out);
  font-family: var(--font-body);
  white-space: nowrap;
}

.variant-option:hover {
  border-color: var(--border-2);
  background: var(--card);
}

.variant-option.is-selected {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
  font-weight: 600;
}

/* ── Product Detail Rows ───────────────────────────────── */

.product-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--border);
  font-size: var(--text-sm);
  gap: var(--sp-4);
}

.product-detail-row:last-child {
  border-bottom: none;
}

.product-detail-row__label {
  font-weight: 600;
  color: var(--text-2);
  min-width: 120px;
}

.product-detail-row__value {
  color: var(--text);
  text-align: right;
  flex: 1;
}

/* ── Responsive ──────────────────────────────────────────── */

@media (max-width: 900px) {
  .product-modal__grid {
    grid-template-columns: 1fr;
  }

  .product-modal__image-col {
    position: relative;
  }

  .product-modal__image {
    border-radius: var(--r-lg) var(--r-lg) 0 0;
  }

  .product-modal__info-col {
    padding: 0 var(--sp-6) var(--sp-8);
  }

  .product-modal__close {
    top: var(--sp-4);
    right: var(--sp-4);
  }
}

@media (max-width: 640px) {
  .product-modal-overlay {
    padding: 0;
    align-items: flex-end;
  }

  .product-modal {
    max-height: 95vh;
    border-radius: var(--r-xl) var(--r-xl) 0 0;
  }

  .product-modal__emoji {
    font-size: 120px;
  }

  .product-modal__title {
    font-size: var(--text-2xl);
  }

  .product-modal__price {
    font-size: var(--text-3xl);
  }
}

.cart-item__variants {
  font-size: var(--text-xs);
  color: var(--text-3);
  margin-top: 2px;
  font-style: italic;
}


/* ╔══════════════════════════════════╗
   ║  CATALOG LOADING SPINNER         ║
   ╚══════════════════════════════════╝ */

.catalog-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  gap: var(--sp-5);
}

.catalog-loading__spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.catalog-loading__text {
  font-size: var(--text-sm);
  color: var(--text-3);
  letter-spacing: 0.5px;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 0.5;
  }

  50% {
    opacity: 1;
  }
}

/* Image support for product cards */
.product-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--t) var(--ease-out);
}

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

/* Hide emoji when image is present */
.product-card__image.has-image span[role="img"] {
  display: none;
}

/* Product Modal Image */
.product-modal__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-modal__image.has-image .product-modal__emoji {
  display: none;
}

/* Cart Item Image */
.cart-item__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cart-item__thumb.has-image {
  padding: 0;
  overflow: hidden;
}

/* Checkout Summary Image */
.summary-mini-item__image {
  width: 40px;
  height: 40px;
  border-radius: var(--r-sm);
  object-fit: cover;
  background: var(--surface);
}


/* ╔══════════════════════════════════╗
   ║  PAGINATION                      ║
   ╚══════════════════════════════════╝ */

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  margin-top: var(--sp-10);
}

.pagination-pages {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.pagination-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 var(--sp-2);
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--r-full);
  color: var(--text-2);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--t-fast) var(--ease-out);
}

.pagination-btn:hover:not(:disabled) {
  border-color: var(--border-2);
  color: var(--text);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.pagination-btn.is-active {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
  cursor: default;
  pointer-events: none;
}

.pagination-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background: transparent;
  border-color: transparent;
}

.pagination-btn--prev,
.pagination-btn--next {
  font-size: 18px;
  padding-bottom: 2px;
  /* optical alignment for arrow */
}

@media (max-width: 480px) {
  .pagination-pages {
    gap: var(--sp-1);
  }

  .pagination-btn {
    min-width: 36px;
    height: 36px;
    font-size: var(--text-xs);
  }
}


/* ╔══════════════════════════════════╗
   ║  BOUQUET BUILDER DIALOG          ║
   ╚══════════════════════════════════╝ */

.bouquet-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  background: rgba(0, 0, 0, 0);
  backdrop-filter: blur(0);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-6);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t) var(--ease-out), backdrop-filter var(--t) var(--ease-out);
}

.bouquet-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
}

.bouquet-dialog {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: scale(0.92);
  opacity: 0;
  transition: transform var(--t) var(--ease-out), opacity var(--t) var(--ease-out);
  position: relative;
  padding: var(--sp-8);
}

.bouquet-overlay.is-open .bouquet-dialog {
  transform: scale(1);
  opacity: 1;
}

.bouquet-close {
  position: absolute;
  top: var(--sp-6);
  right: var(--sp-6);
  width: 40px;
  height: 40px;
  border: none;
  background: var(--surface);
  color: var(--text-2);
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--t-fast);
}

.bouquet-close:hover {
  background: var(--danger-bg);
  color: var(--danger);
}

.bouquet-title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  color: var(--text);
  margin-bottom: var(--sp-6);
  padding-right: 48px;
}

.bouquet-steps {
  display: flex;
  gap: var(--sp-2);
  margin-bottom: var(--sp-6);
  flex-wrap: wrap;
}

.bouquet-step {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-3);
  transition: all var(--t-fast);
}

.bouquet-step.is-active {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent-hover);
}

.bouquet-step.is-done {
  background: var(--success-bg);
  border-color: rgba(74, 158, 110, 0.3);
  color: var(--success);
}

.bouquet-step__num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: var(--card);
  border-radius: 50%;
  font-size: 11px;
}

.bouquet-step.is-active .bouquet-step__num,
.bouquet-step.is-done .bouquet-step__num {
  background: var(--accent);
  color: #fff;
}

.bouquet-step.is-done .bouquet-step__num {
  background: var(--success);
}

.bouquet-phase__title {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text);
  margin-bottom: var(--sp-2);
}

.bouquet-phase__subtitle {
  font-size: var(--text-sm);
  color: var(--text-2);
  margin-bottom: var(--sp-5);
}

.bouquet-phase__content {
  min-height: 120px;
  margin-bottom: var(--sp-6);
}

.bouquet-options {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
}

.bouquet-options--sizes {
  flex-direction: column;
}

.bouquet-option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--sp-1);
  padding: var(--sp-4) var(--sp-5);
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--r);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--t-fast) var(--ease-out);
  text-align: left;
  position: relative;
}

.bouquet-option:hover:not(.is-disabled) {
  border-color: var(--accent);
  background: var(--accent-light);
}

.bouquet-option.is-selected {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--accent-hover);
}

.bouquet-option.is-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.bouquet-option--size {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
}

.bouquet-option__emoji {
  /* Hidden - user requested to remove emojis */
  display: none !important;
}

.bouquet-option__label {
  font-weight: 600;
}

.bouquet-option__detail {
  font-size: var(--text-xs);
  color: var(--text-2);
  width: 100%;
  margin-left: 40px;
}

.bouquet-option__price {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  color: var(--accent);
  margin-left: auto;
}

.bouquet-option__check {
  /* Hidden - user requested to remove checkmark emoji */
  display: none !important;
}

.bouquet-summary {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: var(--sp-5);
  margin-bottom: var(--sp-5);
}

.bouquet-summary__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--sp-2) 0;
  font-size: var(--text-sm);
}

.bouquet-summary__row:not(:last-child) {
  border-bottom: 1px dashed var(--border);
}

.bouquet-summary__row--total {
  border-bottom: none;
  border-top: 2px solid var(--text);
  margin-top: var(--sp-2);
  padding-top: var(--sp-4);
  font-weight: 700;
  font-size: var(--text-base);
}

.bouquet-summary__label {
  color: var(--text-2);
}

.bouquet-summary__value {
  color: var(--text);
  font-weight: 500;
}

.bouquet-add-btn {
  width: 100%;
  justify-content: center;
}

.bouquet-nav {
  display: flex;
  justify-content: space-between;
  gap: var(--sp-4);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--border);
}


/* ╔══════════════════════════════════╗
   ║  AUTH MODAL                      ║
   ╚══════════════════════════════════╝ */

.auth-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  background: rgba(0, 0, 0, 0);
  backdrop-filter: blur(0px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-6);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t) var(--ease-out), backdrop-filter var(--t) var(--ease-out);
}

.auth-modal-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
}

.auth-modal {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  width: 100%;
  max-width: 440px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: scale(0.95);
  opacity: 0;
  transition: transform var(--t) var(--ease-out), opacity var(--t) var(--ease-out);
  position: relative;
  padding: var(--sp-8);
}

.auth-modal-overlay.is-open .auth-modal {
  transform: scale(1);
  opacity: 1;
}

.auth-modal__close {
  position: absolute;
  top: var(--sp-5);
  right: var(--sp-5);
  width: 36px;
  height: 36px;
  border: none;
  background: var(--surface);
  color: var(--text-2);
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--t-fast);
}

.auth-modal__close:hover {
  background: var(--danger-bg);
  color: var(--danger);
  transform: rotate(90deg);
}

.auth-modal__header {
  margin-bottom: var(--sp-5);
  padding-right: 40px;
}

.auth-modal__title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  color: var(--text);
  margin-bottom: var(--sp-2);
}

.auth-modal__message {
  font-size: var(--text-sm);
  color: var(--accent);
  font-weight: 500;
  display: none;
}

/* Tabs */
.auth-modal__tabs {
  display: flex;
  gap: var(--sp-1);
  margin-bottom: var(--sp-5);
  background: var(--surface);
  border-radius: var(--r-full);
  padding: 3px;
}

.auth-tab {
  flex: 1;
  padding: var(--sp-2) var(--sp-4);
  border: none;
  background: transparent;
  color: var(--text-3);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  border-radius: var(--r-full);
  cursor: pointer;
  transition: all var(--t-fast);
}

.auth-tab:hover {
  color: var(--text);
}

.auth-tab.is-active {
  background: var(--card);
  color: var(--text);
  box-shadow: var(--shadow-xs);
}

/* Auth form */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.auth-form__submit {
  margin-top: var(--sp-2);
}

/* Divider */
.auth-divider {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  margin: var(--sp-5) 0;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth-divider span {
  font-size: var(--text-xs);
  color: var(--text-3);
  white-space: nowrap;
}

/* Google button */
.auth-google-btn {
  gap: var(--sp-2);
}

@media (max-width: 640px) {
  .auth-modal-overlay {
    padding: 0;
    align-items: flex-end;
  }

  .auth-modal {
    max-height: 95vh;
    border-radius: var(--r-xl) var(--r-xl) 0 0;
    padding: var(--sp-6);
  }
}