/* ── WooCommerce CSS ── */

/* Shop Archive */
.hb-shop-toolbar {
  background: var(--hb-white);
  padding: 12px 16px;
  border-radius: 6px;
  box-shadow: var(--hb-shadow-sm);
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.hb-shop-count {
  color: var(--hb-text-muted);
  font-size: var(--hb-font-size-sm);
}

/* Product Grid */
.hb-product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.hb-product-card {
  background: var(--hb-white);
  border-radius: 6px;
  box-shadow: var(--hb-shadow-sm);
  overflow: hidden;
  transition:
    transform var(--hb-transition-fast),
    box-shadow var(--hb-transition-fast);
}

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

/* Cart */
.hb-cart-wrap {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 32px;
}

.hb-cart-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 32px;
}

.hb-cart-item {
  background: var(--hb-white);
  border-radius: 8px;
  padding: 16px;
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 16px;
  align-items: center;
}

.hb-cart-summary {
  background: var(--hb-gradient-card);
  border-radius: 12px;
  padding: 24px;
}

/* Checkout */
.hb-checkout-steps {
  display: flex;
  gap: 24px;
}

.hb-checkout-step {
  flex: 1;
}

.hb-checkout-step--active {
  border: 2px solid var(--hb-green);
}

/* My Account */
.hb-account-nav {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
}

.hb-account-nav-link {
  padding: 8px 16px;
  border-radius: 4px;
  font-weight: var(--hb-font-weight-medium);
}

.hb-account-nav-link--active {
  background: var(--hb-cream);
}

/* Quantity Controls */
.hb-qty {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hb-qty__btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--hb-cream);
  border: 1px solid #ddd;
  border-radius: 4px;
  cursor: pointer;
}

.hb-qty__input {
  width: 48px;
  height: 32px;
  text-align: center;
  border: 1px solid #ddd;
  border-radius: 4px;
}

/* Responsive */
@media (max-width: 1024px) {
  .hb-cart-grid {
    grid-template-columns: 1fr;
  }
  /* .hb-checkout-steps {
    flex-direction: column;
  } */
}

@media (max-width: 768px) {
  .hb-product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
  .hb-cart-wrap {
    padding: 24px 16px;
  }
}

/* ══════════════════════════════════════════════════
   WooCommerce Native Form Overrides
   Maps WC's native classes to HB form component styles.
   Source of truth: CSS variables defined in style.css (:root)
   ══════════════════════════════════════════════════ */

/* Inputs & selects — address edit + classic checkout */
/* Note: Select2-enhanced selects excluded via :not(.select2-hidden-accessible) */
.hb-acct-form .input-text,
.hb-acct-form select:not(.select2-hidden-accessible),
.woocommerce-checkout .input-text,
.woocommerce-checkout select:not(.select2-hidden-accessible),
.wc-block-checkout input[type="text"],
.wc-block-checkout input[type="email"],
.wc-block-checkout input[type="tel"],
.wc-block-checkout input[type="password"],
.wc-block-checkout select:not(.select2-hidden-accessible) {
  width: 100%;
  height: var(--hb-input-height);
  padding: 0 var(--hb-input-padding-x);
  background: var(--hb-white);
  border: 2px solid var(--hb-input-border-color) !important;
  border-radius: var(--hb-input-border-radius) !important;
  font-family: var(--hb-font-body);
  font-size: var(--hb-font-size-base);
  color: var(--hb-brown);
  outline: none;
  box-shadow: none !important;
  transition: border-color var(--hb-transition-fast);
  -webkit-appearance: none;
  appearance: none;
}

/* Focus state */
.hb-acct-form .input-text:focus,
.hb-acct-form select:not(.select2-hidden-accessible):focus,
.woocommerce-checkout .input-text:focus,
.woocommerce-checkout select:not(.select2-hidden-accessible):focus,
.wc-block-checkout input:focus,
.wc-block-checkout select:not(.select2-hidden-accessible):focus {
  border-color: var(--hb-input-focus-color) !important;
  outline: none;
  box-shadow: none !important;
}

/* Placeholder */
.hb-acct-form .input-text::placeholder,
.woocommerce-checkout .input-text::placeholder,
.wc-block-checkout input::placeholder {
  color: var(--hb-input-placeholder-color);
}

/* Select2 container width (Select2's CSS handles hiding the original select) */
.hb-acct-form .select2-container,
.woocommerce-checkout .select2-container,
.wc-block-checkout .select2-container {
  width: 100% !important;
}

/* Labels — scoped to form field wrappers to avoid conflicting with inline radio/checkbox labels */
.hb-acct-form .form-row label,
.hb-acct-form .hb-form-field label,
.woocommerce-checkout .form-row > label,
.wc-block-checkout .wc-block-components-form-token-field label,
.wc-block-checkout .wc-block-components-text-input label {
  display: block;
  font-size: var(--hb-font-size-base);
  font-weight: var(--hb-font-weight-semibold);
  color: var(--hb-label-color);
  margin-bottom: 6px;
}

/* Remove WC input wrapper interference */
.hb-acct-form .woocommerce-input-wrapper,
.woocommerce-checkout .woocommerce-input-wrapper {
  display: block;
  width: 100%;
}

/* ══════════════════════════════════════════════════
   Stripe Hidden Style Extraction Input (v10.5.0+)
   The WC Stripe JS reads getComputedStyle() from this element on
   add-payment-method and order-pay pages to build the Stripe Appearance object.
   Styling it here ensures the iframe fields match HB design tokens.
   ══════════════════════════════════════════════════ */
#wc-stripe-hidden-style-input {
  font-family: "Plus Jakarta Sans", sans-serif !important;
  font-size: 14px !important;
  color: #3d2b1f !important;
  background-color: #ffffff !important;
  border: 2px solid rgba(61, 43, 31, 0.1) !important;
  border-radius: 14px !important;
  padding: 11px 16px !important;
  box-shadow: none !important;
}

/* ══════════════════════════════════════════════════
   Coupon Form Styles
   ══════════════════════════════════════════════════ */

.hb-coupon-form {
  margin-bottom: 20px;
}

.hb-coupon-input-wrap {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.hb-coupon-input {
  flex: 1;
  height: var(--hb-input-height);
  padding: 0 var(--hb-input-padding-x);
  background: var(--hb-white);
  border: 2px solid var(--hb-input-border-color) !important;
  border-radius: var(--hb-input-border-radius) !important;
  font-family: var(--hb-font-body);
  font-size: var(--hb-font-size-base);
  color: var(--hb-brown);
  outline: none;
  box-shadow: none !important;
  transition: border-color var(--hb-transition-fast);
}

.hb-coupon-input:focus {
  border-color: var(--hb-input-focus-color) !important;
}

.hb-coupon-input::placeholder {
  color: var(--hb-input-placeholder-color);
}

.hb-coupon-btn {
  height: var(--hb-input-height);
  padding: 0 16px;
  background: var(--hb-cream);
  border: 2px solid var(--hb-input-border-color);
  border-radius: var(--hb-input-border-radius);
  font-family: var(--hb-font-body);
  font-size: var(--hb-font-size-base);
  font-weight: var(--hb-font-weight-semibold);
  color: var(--hb-brown);
  cursor: pointer;
  transition:
    background var(--hb-transition-fast),
    border-color var(--hb-transition-fast);
}

.hb-coupon-btn:hover {
  background: var(--hb-gold);
  border-color: var(--hb-gold);
  color: var(--hb-white);
}

.hb-coupon-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.hb-coupon-applied {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(212, 138, 40, 0.1);
  border: 1px solid var(--hb-gold);
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 8px;
}

.hb-coupon-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: var(--hb-font-weight-semibold);
  color: var(--hb-gold);
}

.hb-coupon-badge i {
  font-size: 14px;
}

.hb-coupon-remove {
  background: none;
  border: none;
  color: var(--hb-text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--hb-transition-fast);
}

.hb-coupon-remove:hover {
  color: var(--hb-red);
}

.hb-coupon-message {
  font-size: var(--hb-font-size-sm);
  padding: 8px 12px;
  margin-top: 8px;
  border-radius: 6px;
  display: none;
}

.hb-coupon-message--success,
.hb-coupon-message--error {
  display: block;
}

.hb-coupon-message--success {
  background: rgba(75, 107, 68, 0.1);
  color: var(--hb-green);
}

.hb-coupon-message--error {
  background: rgba(216, 31, 41, 0.1);
  color: var(--hb-red);
  font-weight: var(--hb-font-weight-medium);
}

/* Discount row styling */
.hb-summary-row--discount .hb-discount-amount {
  color: var(--hb-green);
  font-weight: var(--hb-font-weight-semibold);
}
