/* ============================================================
   Nobo Deal — Global Button Design System (nd-buttons.css)
   ------------------------------------------------------------
   Single source of truth for EVERY button across the storefront.
   Loaded AFTER nd-modern.css so these rules win the cascade;
   `!important` is used where needed to beat nd-modern.css and the
   legacy style.css specificity (nd-modern.css itself uses
   !important on .theme-btn rules).

   Brand tokens reused from nd-modern.css:
     --nd-gold-grad, --nd-emerald-grad, --nd-emerald, --nd-gold,
     --nd-gold-bright, --nd-emerald-deep, --nd-ink, --nd-cream,
     --nd-ease, --nd-transition

   System rules
   - Pill shape everywhere: border-radius 60px
   - Standalone buttons: min-height 44px, font-size 14px
   - Product-card action buttons: min-height 40px, font-size ~12.5px
   - Motion: transform / box-shadow / background ~0.3s
   - Hover: lift + brand glow · Active: pressed · Focus: visible ring
   - Mobile (<=575.98px): every tappable target >= 44px tall,
     buttons wrap instead of overflowing their container
   ============================================================ */

/* ---------- Shared base: every pill button ---------- */
.theme-btn,
.ht-pill,
.ht-pill-outline,
.ht-pill-solid,
.nd-action-btn,
.qty-btn {
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  transition:
    transform 0.3s var(--nd-ease),
    box-shadow 0.3s ease,
    background-color 0.3s ease,
    background-image 0.3s ease,
    color 0.3s ease,
    border-color 0.3s ease !important;
}

/* ---------- 1. .theme-btn — primary gold (hero, detail, auth) ---------- */
.theme-btn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px !important;
  padding: 12px 28px !important;
  border-radius: 60px !important;
  border: none !important;
  background: var(--nd-gold-grad) !important;
  color: #fff !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  letter-spacing: 0.3px !important;
  line-height: 1.2 !important;
  text-decoration: none !important;
  white-space: nowrap;
  cursor: pointer;
  position: relative;      /* keeps the click-ripple clipping intact */
  overflow: hidden;
  box-shadow: 0 8px 22px rgba(201, 162, 75, 0.4) !important;
}

.theme-btn:hover {
  transform: translateY(-3px) scale(1.02) !important;
  color: #fff !important;
  box-shadow:
    0 6px 14px rgba(201, 162, 75, 0.45),
    0 16px 34px rgba(201, 162, 75, 0.55) !important;
}

.theme-btn:active {
  transform: translateY(-1px) scale(0.97) !important;
  box-shadow: 0 4px 12px rgba(201, 162, 75, 0.35) !important;
}

/* ---------- 2. .theme-btn.secondary / .btn-outline — emerald ---------- */
.theme-btn.secondary,
.theme-btn.btn-outline {
  background: var(--nd-emerald-grad) !important;
  color: #fff !important;
  box-shadow: 0 8px 22px rgba(11, 92, 67, 0.35) !important;
}

/* Hover inverts to white with an emerald ring (established brand move) */
.theme-btn.secondary:hover,
.theme-btn.btn-outline:hover {
  background: #ffffff !important;
  color: var(--nd-emerald-deep) !important;
  transform: translateY(-3px) scale(1.02) !important;
  box-shadow:
    inset 0 0 0 2px var(--nd-emerald),
    0 6px 14px rgba(11, 92, 67, 0.22),
    0 16px 30px rgba(5, 45, 35, 0.28) !important;
}

.theme-btn.secondary:active,
.theme-btn.btn-outline:active {
  transform: translateY(-1px) scale(0.97) !important;
  box-shadow: inset 0 0 0 2px var(--nd-emerald), 0 4px 12px rgba(5, 45, 35, 0.2) !important;
}

/* ---------- 3. Product-card action buttons (add-to-cart / buy now) ---------- */
.tp-product-card .product-card-action {
  display: flex !important;
  align-items: stretch;
  gap: 7px;
  width: 100%;
}

.tp-product-card .product-card-action > .theme-btn,
.tp-product-card.style-6 .product-card-action > .theme-btn,
.nd-home .tp-product-card.style-6 .product-card-action > .theme-btn {
  flex: 1 1 0 !important;
  min-width: 0 !important;
  width: auto !important;
  min-height: 40px !important;
  padding: 8px 10px !important;
  border-radius: 60px !important;
  font-size: 12.5px !important;
  font-weight: 700 !important;
  letter-spacing: 0 !important;
  line-height: 1.1 !important;
  white-space: nowrap;
  box-sizing: border-box;
}

/* Card "Add to Cart" — transparent pill, emerald outline + text (contract) */
.tp-product-card .product-card-action .addToCartWithQty {
  background: transparent !important;
  color: #0E3B2E !important;
  border: 2px solid #0E3B2E !important;
  box-shadow: 0 5px 12px rgba(14, 59, 46, 0.18) !important;
}

.tp-product-card .product-card-action .addToCartWithQty:hover {
  background: rgba(14, 59, 46, 0.08) !important;
  color: #0E3B2E !important;
  border-color: #0E3B2E !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 18px rgba(14, 59, 46, 0.24) !important;
}

/* Card "Buy Now" — solid deep emerald (contract) */
.tp-product-card .product-card-action .nd-buy-now {
  background: #0E3B2E !important;
  color: #fff !important;
  border: 0 !important;
  box-shadow: 0 5px 12px rgba(14, 59, 46, 0.28) !important;
}

.tp-product-card .product-card-action .nd-buy-now:hover {
  background: #155843 !important;
  color: #fff !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 18px rgba(14, 59, 46, 0.4) !important;
}

/* Product-detail "Buy Now" shares the emerald identity (keeps its pulse animation) */
.product-detail-action .buy-now-btn {
  background: #0E3B2E !important;
  color: #fff !important;
  border: 0 !important;
  box-shadow: 0 5px 12px rgba(14, 59, 46, 0.28) !important;
}

.product-detail-action .buy-now-btn:hover {
  background: #155843 !important;
  color: #fff !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 18px rgba(14, 59, 46, 0.4) !important;
}

/* Product-detail standalone buttons keep the 44px pill + 60px radius */
.product-detail-action > .theme-btn {
  min-height: 44px !important;
  border-radius: 60px !important;
  font-size: 14px !important;
}

/* ---------- 4. .nd-action-btn — header icon buttons (wishlist/cart/etc.) ---------- */
.nd-action-btn {
  display: inline-flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 44px;
  min-height: 44px !important;
  padding: 8px 12px;
  border-radius: 14px !important;
  border: none !important;
  background: transparent !important;
  color: var(--nd-emerald-deep) !important;
  text-decoration: none !important;
  cursor: pointer;
}

.nd-action-btn:hover {
  background: var(--nd-cream) !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 18px rgba(5, 45, 35, 0.12) !important;
}

.nd-action-btn:hover i {
  transform: translateY(-2px) scale(1.08);
  color: var(--nd-gold-dark, var(--nd-gold)) !important;
}

.nd-action-btn:active {
  transform: translateY(0) scale(0.94) !important;
  box-shadow: none !important;
}

/* ---------- 5. .ht-pill — topbar pills (login/register/admin) ---------- */
.ht-pill,
.ht-pill-outline,
.ht-pill-solid {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px !important;
  padding: 6px 14px !important;
  border-radius: 60px !important;
  font-size: 12.5px !important;
  font-weight: 600 !important;
  letter-spacing: 0.2px;
  text-decoration: none !important;
  white-space: nowrap;
  cursor: pointer;
}

.ht-pill {
  background: rgba(201, 162, 75, 0.14);
  color: var(--nd-gold-bright);
}

.ht-pill-outline {
  border: 1px solid rgba(201, 162, 75, 0.55) !important;
  background: rgba(201, 162, 75, 0.08);
  color: var(--nd-gold-bright);
}

.ht-pill-solid {
  background: var(--nd-gold-grad);
  color: #fff;
  box-shadow: 0 4px 12px rgba(201, 162, 75, 0.35);
}

.ht-pill-outline:hover,
.ht-pill:hover {
  background: var(--nd-gold-grad) !important;
  color: #fff !important;
  border-color: var(--nd-gold) !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 8px 18px rgba(201, 162, 75, 0.45) !important;
}

.ht-pill-solid:hover {
  transform: translateY(-1px) !important;
  box-shadow: 0 8px 20px rgba(201, 162, 75, 0.55) !important;
}

.ht-pill:active,
.ht-pill-outline:active,
.ht-pill-solid:active {
  transform: translateY(0) scale(0.96) !important;
  box-shadow: 0 2px 8px rgba(201, 162, 75, 0.3) !important;
}

/* ---------- 6. Quantity selector (.qty-btn / .qty-input) ---------- */
.quantity-selector {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.qty-btn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  min-height: 44px !important;
  border-radius: 60px !important;
  border: 2px solid var(--nd-emerald) !important;
  background: var(--nd-cream) !important;
  color: var(--nd-emerald-deep) !important;
  font-size: 18px !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(5, 45, 35, 0.12) !important;
}

.qty-btn:hover {
  transform: translateY(-2px) !important;
  border-color: var(--nd-gold) !important;
  box-shadow: 0 8px 18px rgba(201, 162, 75, 0.35) !important;
}

.qty-btn:active {
  transform: translateY(0) scale(0.93) !important;
  box-shadow: 0 2px 6px rgba(5, 45, 35, 0.1) !important;
}

.form-control.qty-input {
  min-height: 44px !important;
  border-radius: 60px !important;
  border: 2px solid var(--nd-emerald) !important;
  background: #fff !important;
  color: var(--nd-ink) !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  text-align: center !important;
  -moz-appearance: textfield;
  appearance: textfield;
}

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

/* ---------- 7. Keyboard accessibility — visible focus ring ---------- */
.theme-btn:focus-visible,
.nd-action-btn:focus-visible,
.ht-pill:focus-visible,
.qty-btn:focus-visible {
  outline: 3px solid var(--nd-gold) !important;
  outline-offset: 2px !important;
  box-shadow: 0 0 0 5px rgba(201, 162, 75, 0.25) !important;
}

/* ---------- 8. Mobile (<=575.98px): touch-friendly, no overflow ---------- */
@media (max-width: 575.98px) {
  /* Standalone buttons: keep 44px+ touch height, wrap instead of overflow */
  .theme-btn {
    min-height: 44px !important;
    padding: 10px 16px !important;
    font-size: 14px !important;
    white-space: normal !important;
    overflow-wrap: anywhere;
  }

  .product-detail-action > .theme-btn {
    font-size: 13px !important;
    padding: 10px 10px !important;
  }

  /* Card action buttons: 44px tap target, wrap gracefully */
  .tp-product-card .product-card-action > .theme-btn,
  .tp-product-card.style-6 .product-card-action > .theme-btn,
  .nd-home .tp-product-card.style-6 .product-card-action > .theme-btn {
    min-height: 44px !important;
    padding: 6px 8px !important;
    font-size: 12.5px !important;
    white-space: normal !important;
    line-height: 1.15 !important;
  }

  /* Header icon buttons: proper 44px squares */
  .nd-action-btn {
    min-width: 44px !important;
    min-height: 44px !important;
    padding: 8px !important;
  }

  /* Topbar pills: full-height tap targets */
  .ht-pill,
  .ht-pill-outline,
  .ht-pill-solid {
    min-height: 44px !important;
    padding: 8px 14px !important;
    font-size: 12px !important;
  }

  /* Quantity selector stays 44px round */
  .qty-btn {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
  }

  .form-control.qty-input {
    min-height: 44px !important;
  }
}
