/* ===========================================================
   Shop styles: product grids, detail page, quantity stepper,
   flavor selector, and cart line items.
   Loaded after styles.css so it can rely on the shared
   CSS variables (:root) defined there.
   =========================================================== */

:root {
  --color-border: #ece6db;
  --color-text-light: #8A7F71;
  --color-amber-dark: #8a5e12;
}

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

.product-card {
  background: var(--color-white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.4s cubic-bezier(.22,.61,.36,1), box-shadow 0.4s ease;
  border: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
}

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

.product-card-link:hover .product-view-btn {
  background: var(--color-amber-dark, #c98a00);
}

.product-image {
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  position: relative;
  overflow: hidden;
}

.product-image .product-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.product-image::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(17, 17, 17, 0.25));
  pointer-events: none;
}

.product-info {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.product-info h3 {
  font-size: 1.15rem;
  margin-bottom: 8px;
  color: var(--color-dark);
}

.product-info .description {
  font-size: 0.85rem;
  color: var(--color-text-light);
  margin-bottom: 12px;
  line-height: 1.5;
}

.product-info .price {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--color-amber);
  margin-bottom: 16px;
}

.product-view-btn {
  margin-top: auto;
  width: 100%;
  text-align: center;
  padding: 11px 24px;
  font-size: 0.9rem;
  border-radius: 8px;
  background: var(--color-amber);
  color: #fff;
  font-weight: 600;
}

.add-to-cart-btn {
  margin-top: 10px;
  width: 100%;
  text-align: center;
  padding: 11px 24px;
  font-size: 0.9rem;
  border-radius: 8px;
  background: transparent;
  color: var(--color-amber);
  border: 2px solid var(--color-amber);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

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

.products-intro {
  text-align: center;
  max-width: 600px;
  margin: 0 auto 48px;
}

.products-intro p {
  font-size: 1.05rem;
}

.products-loading {
  padding: 64px 20px;
  text-align: center;
  color: var(--color-text-light);
}

/* ---------- Product detail page ---------- */
.back-link {
  display: inline-block;
  margin-bottom: 24px;
  color: var(--color-text-light);
  font-size: 0.9rem;
  text-decoration: none;
  font-weight: 500;
}

.back-link:hover {
  color: var(--color-amber);
}

.product-detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 48px;
  align-items: start;
}

.product-detail-image {
  height: 420px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8rem;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.product-detail-image .product-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-detail-panel {
  padding-top: 8px;
}

.product-detail-title {
  font-size: 2rem;
  color: var(--color-dark);
  margin-bottom: 12px;
  line-height: 1.2;
}

.product-detail-price {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--color-amber);
  margin-bottom: 20px;
}

.product-detail-desc {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--color-text-light);
  margin-bottom: 28px;
}

.product-buy {
  max-width: 360px;
}

/* Quantity stepper */
.qty-stepper,
.qty-control {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  border: 2px solid var(--color-border);
  border-radius: 8px;
  padding: 6px 10px;
  margin-bottom: 20px;
}

.qty-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-text);
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background 0.2s ease, color 0.2s ease;
}

.qty-btn:hover {
  background: var(--color-honey-soft, #fdf3d8);
  color: var(--color-amber);
}

.qty-value {
  min-width: 24px;
  text-align: center;
  font-weight: 600;
  font-size: 1rem;
}

.qty-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--color-text-light);
  margin-right: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Flavor selector */
.flavor-options {
  margin-bottom: 24px;
}

.flavor-label {
  display: block;
  font-weight: 600;
  color: var(--color-dark);
  margin-bottom: 10px;
  font-size: 0.95rem;
}

.flavor-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.flavor-chip {
  border: 2px solid var(--color-border);
  background: var(--color-white);
  color: var(--color-text);
  border-radius: 50px;
  padding: 9px 18px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.flavor-chip:hover {
  border-color: var(--color-amber);
}

.flavor-chip.selected {
  background: var(--color-amber);
  border-color: var(--color-amber);
  color: #fff;
}

.flavor-hint {
  font-size: 0.82rem;
  color: #c0392b;
  margin-top: 10px;
  text-align: center;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* ---------- Cart line items ---------- */
.cart-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px dashed var(--color-border);
}

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

.cart-item-main h4 {
  font-size: 0.95rem;
  margin-bottom: 2px;
  color: var(--color-dark);
}

.cart-item-flavor {
  display: block;
  font-size: 0.8rem;
  color: var(--color-amber);
  font-weight: 600;
  margin-bottom: 2px;
}

.cart-item-price {
  font-size: 0.82rem;
  color: var(--color-text-light);
}

.cart-item-main .qty-control {
  margin: 12px 0 0;
}

.cart-item-line {
  font-weight: 700;
  color: var(--color-amber);
  font-size: 0.95rem;
  white-space: nowrap;
}

/* Order summary item rows (renderCartSummary) */
.cart-item-actions {
  display: flex;
  align-items: center;
}

.cart-remove {
  background: none;
  border: none;
  color: var(--color-text-light);
  font-size: 0.78rem;
  text-decoration: underline;
  cursor: pointer;
  margin-left: 10px;
}

.cart-remove:hover {
  color: #c0392b;
}

.btn-block {
  width: 100%;
  margin-top: 8px;
  text-align: center;
}

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  .product-detail-layout {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .product-detail-image {
    height: 300px;
    font-size: 6rem;
  }
}

/* ---------- Product filters (Buy Honey) ---------- */
.product-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-end;
  margin-bottom: 32px;
  padding: 20px;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.filter-group label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--color-dark);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.filter-select {
  min-width: 180px;
  padding: 10px 14px;
  border: 2px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-white);
  font-size: 0.9rem;
  color: var(--color-text);
  cursor: pointer;
}

.filter-select:focus {
  outline: none;
  border-color: var(--color-amber);
}

.filter-clear {
  margin-left: auto;
}

/* ===========================================================
   Cart & checkout — "natural luxury" styling
   =========================================================== */

/* ---------- Page header ---------- */
.page-header {
  text-align: center;
  padding: 72px 0 44px;
  position: relative;
  background:
    radial-gradient(120% 130% at 50% -10%, rgba(224, 163, 58, 0.16), transparent 58%),
    linear-gradient(180deg, var(--color-cream-2) 0%, var(--color-cream) 100%);
  border-bottom: 1px solid var(--color-line);
  overflow: hidden;
}

.page-header::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -1px;
  transform: translateX(-50%);
  width: 120px;
  height: 3px;
  border-radius: 3px;
  background: linear-gradient(90deg, transparent, var(--color-honey), transparent);
}

.page-header h1 {
  margin-bottom: 10px;
}

.page-header p {
  font-size: 1.05rem;
  margin-bottom: 0;
}

/* ---------- Layout ---------- */
.cart-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  gap: 36px;
  align-items: start;
}

.cart-form,
.order-summary {
  background: var(--color-white);
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
  padding: 34px 32px;
  box-shadow: var(--shadow-sm);
}

.cart-form h3,
.order-summary h3 {
  margin-bottom: 6px;
}

.section-hint {
  font-size: 0.9rem;
  color: var(--color-text-light);
  margin: -4px 0 22px;
}

/* ---------- Form fields ---------- */
.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-light);
  margin-bottom: 8px;
}

.form-group input {
  width: 100%;
  padding: 13px 16px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--color-ink);
  background: var(--color-cream);
  border: 1.5px solid var(--color-line);
  border-radius: var(--radius-sm);
  transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.form-group input::placeholder {
  color: rgba(138, 127, 113, 0.6);
}

.form-group input:focus {
  outline: none;
  background: #fff;
  border-color: var(--color-honey);
  box-shadow: 0 0 0 4px var(--color-honey-soft);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: 16px;
}

.field-hint {
  display: block;
  font-size: 0.78rem;
  color: var(--color-text-light);
  margin-top: 6px;
  line-height: 1.5;
}

.checkout-section {
  margin-top: 32px;
}

.checkout-section h3 {
  margin-bottom: 6px;
}

/* ---------- Shipping options ---------- */
.shipping-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 18px;
}

.shipping-option {
  position: relative;
  display: block;
  cursor: pointer;
}

.shipping-option input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.shipping-option-body {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  border: 1.5px solid var(--color-line);
  border-radius: var(--radius-sm);
  background: var(--color-cream);
  transition: border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.shipping-option:hover .shipping-option-body {
  border-color: rgba(224, 163, 58, 0.5);
  transform: translateY(-1px);
}

.shipping-option input:checked ~ .shipping-option-body {
  border-color: var(--color-honey);
  background: var(--color-honey-soft);
  box-shadow: 0 0 0 3px rgba(224, 163, 58, 0.14);
}

.shipping-option-icon {
  flex-shrink: 0;
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: #fff;
  color: var(--color-amber);
  border: 1px solid var(--color-line);
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.shipping-option input:checked ~ .shipping-option-body .shipping-option-icon {
  background: var(--color-honey);
  color: var(--color-ink);
  border-color: var(--color-honey);
}

.shipping-option-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.shipping-option-text strong {
  font-family: var(--font-body);
  font-size: 0.96rem;
  font-weight: 700;
  color: var(--color-ink);
}

.shipping-option-text small {
  color: var(--color-text-light);
  font-size: 0.8rem;
  margin-top: 1px;
}

.shipping-option-price {
  font-weight: 700;
  color: var(--color-amber);
  white-space: nowrap;
  font-size: 0.95rem;
}

/* ---------- Order summary ---------- */
.order-summary {
  position: sticky;
  top: calc(var(--nav-height) + 24px);
}

.order-summary h3 {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--color-line);
}

#cartSummary {
  margin-bottom: 6px;
}

.summary-lines {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--color-line);
}

.summary-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.95rem;
  color: var(--color-text-light);
  padding: 7px 0;
}

.summary-line span:last-child {
  color: var(--color-ink);
  font-weight: 600;
}

.summary-total {
  margin-top: 6px;
  padding-top: 14px;
  border-top: 1px dashed var(--color-line);
}

.summary-total span {
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--color-ink);
}

.summary-total span:last-child {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--color-amber);
}

.agree-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--color-text-light);
  margin-top: 16px;
}

.agree-row input {
  flex-shrink: 0;
  margin-top: 2px;
  width: 16px;
  height: 16px;
  accent-color: var(--color-honey);
}

.agree-row a {
  color: var(--color-amber);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.order-note {
  font-size: 0.8rem;
  text-align: center;
  margin-top: 12px;
  margin-bottom: 0;
}

/* ---------- Cart line items ---------- */
.cart-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px dashed var(--color-line);
}

.cart-item-thumb {
  flex-shrink: 0;
  width: 54px;
  height: 54px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  background: var(--color-honey-soft);
  border: 1px solid rgba(224, 163, 58, 0.3);
}

/* ---------- Empty & success states ---------- */
.cart-empty,
.order-success {
  max-width: 460px;
  margin: 36px auto;
  text-align: center;
  background: var(--color-white);
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
  padding: 56px 40px;
  box-shadow: var(--shadow-sm);
}

.cart-empty-icon,
.order-success .icon {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 22px;
  background: var(--color-honey-soft);
  color: var(--color-amber);
  border: 1.5px solid rgba(224, 163, 58, 0.35);
}

.cart-empty h3,
.order-success h3 {
  margin-bottom: 10px;
}

.cart-empty p {
  margin-bottom: 24px;
}

.order-success .icon {
  background: rgba(46, 160, 67, 0.12);
  color: #2ea043;
  border-color: rgba(46, 160, 67, 0.3);
}

/* ---------- Responsive ---------- */
@media (max-width: 880px) {
  .cart-layout {
    grid-template-columns: 1fr;
  }
  .order-summary {
    position: static;
  }
}

@media (max-width: 760px) {
  .cart-form,
  .order-summary {
    padding: 26px 20px;
  }
  .page-header {
    padding: 50px 0 32px;
  }
}

/* ---------- Shippo live rates ---------- */
.shippo-rates {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px dashed var(--color-line);
}

.shippo-rates-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.shippo-rates-title {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-light);
}

.shippo-refresh {
  background: none;
  border: none;
  color: var(--color-amber);
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 8px;
  transition: background 0.2s ease;
}

.shippo-refresh:hover {
  background: var(--color-honey-soft);
  text-decoration: underline;
}

.shippo-rate-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.shippo-rate {
  display: block;
  cursor: pointer;
}

.shippo-rate {
  position: relative;
}

.shippo-rate input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.shippo-rate-body {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 16px;
  border: 1.5px solid var(--color-line);
  border-radius: var(--radius-sm);
  background: #fff;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.shippo-rate:hover .shippo-rate-body {
  border-color: rgba(224, 163, 58, 0.5);
}

.shippo-rate input:checked ~ .shippo-rate-body {
  border-color: var(--color-honey);
  background: var(--color-honey-soft);
  box-shadow: 0 0 0 3px rgba(224, 163, 58, 0.14);
}

.shippo-rate-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.shippo-rate-text strong {
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--color-ink);
}

.shippo-rate-text small {
  font-size: 0.78rem;
  color: var(--color-text-light);
  margin-top: 2px;
}

.shippo-rate-price {
  font-weight: 700;
  color: var(--color-amber);
  white-space: nowrap;
}

.shippo-msg {
  font-size: 0.84rem;
  color: var(--color-text-light);
  margin: 10px 0 0;
  line-height: 1.5;
}

.shipping-note {
  margin: 10px 0 0;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--color-honey-deep);
}

.store-closed-notice {
  border: 1px solid rgba(198, 145, 30, .35);
  border-radius: 14px;
  background: #fffaf0;
  color: #3a3020;
  padding: 28px;
  margin: 20px 0;
  text-align: center;
}

.store-closed-notice h2 {
  margin: 0 0 8px;
  color: #191815;
}

.store-closed-notice p {
  margin: 0;
  line-height: 1.6;
}
