/* ===================================================================
   WGAN FARMS — STORE EXTENSION CSS
   Additive only. Does not override existing styles.css
   Reuses existing design variables: --primary, --accent, --premium,
   --bg, --panel, --text, --muted, --border, --radius, --serif, --sans
=================================================================== */

/* ---- Nav active state (store pages) ---- */
.nav a.nav-active {
  color: var(--primary);
  background: rgba(31,95,58,.06);
}

/* ---- Cart count badge on Store nav link ---- */
.cart-count {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
  opacity: .75;
}

/* ---- Toast notification ---- */
.cart-toast {
  position: fixed;
  bottom: 140px;
  right: 24px;
  z-index: 9999;
  background: var(--primary);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(31,95,58,.30);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity .22s ease, transform .22s ease;
}
.cart-toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* ===================================================================
   STORE PAGE — PRODUCT GRID
=================================================================== */
.store-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-top: 32px;
}

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

/* Product card extends existing .card */
.product-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.product-card-image-wrap {
  overflow: hidden;
  height: 240px;
  flex-shrink: 0;
}

.product-card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .55s ease, filter .35s ease;
}

.product-card:hover .product-card-image {
  transform: scale(1.04);
  filter: saturate(1.05);
}

.product-card-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 8px;
}

.product-card-name {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
  margin: 0;
  line-height: 1.2;
}

.product-card-origin {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--premium);
  margin: 0;
}

.product-card-desc {
  color: var(--muted);
  font-size: 14px;
  margin: 0;
  line-height: 1.65;
}

.pack-sizes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.pack-badge {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(31,95,58,.05);
  border: 1px solid rgba(31,95,58,.12);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
}

/* Clickable size buttons on store product cards */
.pack-size-btn {
  padding: 4px 10px;
  border-radius: 999px;
  background: transparent;
  border: 1px solid rgba(31,95,58,.14);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--sans);
  transition: border-color .18s, background .18s, color .18s;
}

.pack-size-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(31,95,58,.05);
}

.pack-size-btn.selected {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.product-card-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}

.product-card-actions .btn {
  width: 100%;
  justify-content: center;
  text-align: center;
  font-size: 13px;
  padding: 10px 12px !important;
}

.product-card-actions .ghost {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 2px 0 !important;
  font-size: 12px;
  color: var(--muted) !important;
  text-decoration: underline;
  text-align: center;
  justify-content: center;
  min-width: unset;
  flex: none;
}

.card-shipping-nudge {
  font-size: 11.5px;
  color: var(--muted);
  margin: 0;
}

/* ===================================================================
   PRODUCT DETAIL PAGE
=================================================================== */
.product-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: start;
  margin-top: 28px;
}

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

.product-hero-img {
  width: 100%;
  height: 420px;
  object-fit: cover;
  border-radius: var(--radius);
  display: block;
  border: 1px solid rgba(31,95,58,.10);
}

@media(max-width: 540px) {
  .product-hero-img { height: 260px; }
}

.product-specs {
  margin: 16px 0;
}

.spec-row {
  display: flex;
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px solid rgba(31,95,58,.08);
  font-size: 14px;
  line-height: 1.5;
}

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

.spec-label {
  font-weight: 700;
  color: var(--text);
  min-width: 130px;
  flex-shrink: 0;
  font-size: 13px;
}

.spec-value {
  color: var(--muted);
}

/* Pack size selector */
.pack-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 16px;
}

.pack-option input[type="radio"] { display: none; }

.pack-option {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 16px;
  border-radius: 12px;
  border: 1px solid rgba(31,95,58,.16);
  background: transparent;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .18s, background .18s, color .18s;
  line-height: 1.3;
}

.pack-option:hover {
  border-color: var(--primary);
  background: rgba(31,95,58,.05);
  color: var(--primary);
}

/* :has() is supported in all modern browsers */
.pack-option:has(input[type="radio"]:checked) {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.pack-option:has(input[type="radio"]:checked) .pack-option-price {
  opacity: 1;
}

.pack-option-price {
  font-size: 11px;
  font-weight: 500;
  opacity: .80;
  margin-top: 2px;
}

.product-price-display {
  font-size: 26px;
  font-weight: 800;
  color: var(--primary);
  font-family: var(--serif);
  margin: 4px 0 8px;
}

.product-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.product-actions .btn,
.product-actions .ghost {
  flex: 1;
  min-width: 140px;
  justify-content: center;
  text-align: center;
  padding: 14px 20px !important;
  font-size: 15px;
}

.product-uses-list {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.product-uses-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: var(--muted);
}

.product-uses-list li::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--premium);
  flex-shrink: 0;
}

/* ===================================================================
   CART PAGE
=================================================================== */
.cart-empty {
  text-align: center;
  padding: 64px 24px;
  color: var(--muted);
}

.cart-empty h2 {
  font-family: var(--serif);
  color: var(--primary);
  margin: 0 0 10px;
  font-size: 26px;
}

.cart-items {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 24px;
}

.cart-item {
  display: grid;
  grid-template-columns: 80px 1fr auto auto auto;
  gap: 18px;
  align-items: center;
  padding: 18px 0;
  border-bottom: 1px solid rgba(31,95,58,.08);
}

@media(max-width: 640px) {
  .cart-item {
    grid-template-columns: 64px 1fr auto;
    grid-template-rows: auto auto;
    gap: 10px 12px;
  }
  .cart-item-img { grid-row: 1 / 3; }
  .cart-item-info { grid-column: 2 / 3; }
  .cart-qty { grid-column: 3 / 4; grid-row: 1; }
  .cart-item-price { grid-column: 2 / 3; grid-row: 2; }
  .cart-remove { grid-column: 3 / 4; grid-row: 2; justify-self: end; }
}

.cart-item-img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid rgba(31,95,58,.10);
  background: rgba(31,95,58,.04);
}

.cart-item-name {
  font-weight: 700;
  color: var(--text);
  font-size: 15px;
  margin: 0 0 3px;
  line-height: 1.3;
}

.cart-item-meta {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
}

.cart-qty {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1px solid rgba(31,95,58,.16);
  border-radius: 10px;
  overflow: hidden;
}

.cart-qty-btn {
  width: 34px;
  height: 34px;
  border: none;
  background: transparent;
  color: var(--primary);
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cart-qty-btn:hover { background: rgba(31,95,58,.07); }

.cart-qty-val {
  min-width: 30px;
  text-align: center;
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
}

.cart-item-price {
  font-weight: 800;
  font-size: 16px;
  color: var(--primary);
  white-space: nowrap;
  font-family: var(--serif);
}

.cart-remove {
  background: none;
  border: none;
  color: rgba(31,42,31,.30);
  cursor: pointer;
  font-size: 16px;
  padding: 6px;
  border-radius: 8px;
  transition: color .18s, background .18s;
  line-height: 1;
}

.cart-remove:hover {
  color: #c0392b;
  background: rgba(192,57,43,.07);
}

.cart-summary-box {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 14px;
  padding: 24px 0 0;
  border-top: 1px solid rgba(31,95,58,.10);
}

.cart-subtotal-label {
  font-size: 13px;
  color: var(--muted);
  text-align: right;
}

.cart-subtotal-amount {
  font-size: 24px;
  font-weight: 800;
  color: var(--primary);
  font-family: var(--serif);
  margin: 2px 0 0;
}

.cart-summary-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.cart-clear-btn {
  font-size: 14px;
  padding: 12px 20px !important;
  color: var(--muted);
  border-color: var(--muted);
}

.cart-clear-btn:hover {
  color: #c0392b;
  border-color: #c0392b;
}

.cart-checkout-btn {
  min-width: 220px;
  justify-content: center;
  padding: 14px 24px !important;
  font-size: 15px;
}

/* ===================================================================
   CHECKOUT PAGE
=================================================================== */
.checkout-grid {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 28px;
  align-items: start;
  margin-top: 28px;
}

@media(max-width: 820px) {
  .checkout-grid { grid-template-columns: 1fr; }
  /* On mobile, show order summary first */
  .checkout-grid { direction: ltr; }
  .checkout-summary-col { order: -1; }
}

.order-summary-items {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.checkout-order-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 0;
  border-bottom: 1px solid rgba(31,95,58,.07);
  font-size: 14px;
  gap: 12px;
}

.checkout-order-item:last-child { border-bottom: none; }

.checkout-order-item-name {
  color: var(--text);
  font-weight: 600;
  flex: 1;
}

.checkout-order-item-price {
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
}

.checkout-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0 0;
  margin-top: 4px;
  border-top: 1px solid rgba(31,95,58,.12);
  font-weight: 800;
  font-size: 20px;
  color: var(--primary);
  font-family: var(--serif);
}

.pay-btn {
  width: 100%;
  justify-content: center;
  padding: 16px 20px !important;
  font-size: 16px;
  margin-top: 16px;
}

.checkout-secure-note {
  font-size: 11.5px;
  color: rgba(31,42,31,.45);
  text-align: center;
  margin-top: 8px;
  letter-spacing: .02em;
}

/* ===================================================================
   ORDER SUCCESS PAGE
=================================================================== */
.success-wrap {
  max-width: 560px;
  margin: 0 auto;
}

.success-card {
  text-align: center;
}

.success-icon {
  margin: 0 auto 20px;
  display: flex;
  justify-content: center;
}

.success-heading {
  font-family: var(--serif);
  font-size: 26px;
  color: var(--primary);
  margin: 0 0 8px;
}

.success-sub {
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 24px;
  line-height: 1.6;
}

.success-items {
  text-align: left;
  margin-bottom: 4px;
}

.success-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: 28px;
}

.success-cta {
  display: inline-flex;
  justify-content: center;
  min-width: 200px;
}

/* Inline field validation */
.form-error {
  display: block;
  font-size: 12px;
  color: #c0392b;
  margin-top: 4px;
  font-weight: 500;
}

.form-input.input-error {
  border-color: #c0392b;
  outline-color: rgba(192,57,43,.25);
}

/* ================================================================
   CITY AUTOCOMPLETE DROPDOWN — checkout.html only
================================================================ */
.city-wrap{position:relative}
.city-dropdown{
  display:none;
  position:absolute;
  top:calc(100% + 4px);
  left:0;right:0;
  z-index:200;
  background:var(--panel);
  border:1px solid rgba(31,95,58,.16);
  border-radius:12px;
  box-shadow:0 12px 32px rgba(31,95,58,.13);
  overflow:hidden;
  max-height:238px;
  overflow-y:auto;
}
.city-option{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:9px 14px;
  cursor:pointer;
  border-bottom:1px solid rgba(31,95,58,.06);
  transition:background .13s ease;
}
.city-option:last-child{border-bottom:none}
.city-option:hover,.city-option.city-opt-active{
  background:rgba(31,95,58,.07);
}
.city-opt-name{
  font-size:13.5px;
  font-weight:600;
  color:var(--text);
}
.city-opt-state{
  font-size:11.5px;
  color:var(--muted);
  letter-spacing:.02em;
}
.state-autofilled{
  background:rgba(31,95,58,.04) !important;
  color:var(--primary) !important;
  border-color:rgba(31,95,58,.20) !important;
}

/* ================================================================
   PRODUCT DIFFERENTIATION TAGS — Store grid cards
================================================================ */
.product-tags{
  display:flex;
  flex-wrap:wrap;
  gap:5px;
  margin:10px 0 2px;
}
.product-tag{
  display:inline-flex;
  align-items:center;
  font-size:10px;
  font-weight:700;
  letter-spacing:.05em;
  padding:3px 8px;
  border-radius:6px;
  text-transform:uppercase;
  white-space:nowrap;
}
.tag-heat{background:rgba(190,70,20,.08);color:rgba(160,55,15,.85);border:1px solid rgba(190,70,20,.18)}
.tag-colour{background:rgba(155,20,40,.07);color:rgba(130,15,35,.80);border:1px solid rgba(155,20,40,.16)}
.tag-use{background:rgba(31,95,58,.07);color:var(--primary);border:1px solid rgba(31,95,58,.14)}

/* ================================================================
   BUNDLE PRICING + PRICE DISPLAY
================================================================ */

.bundle-row{
  display:flex;
  gap:6px;
  flex-wrap:wrap;
  align-items:center;
  margin:10px 0 4px;
}

.bundle-btn{
  position:relative;
  flex:1;
  min-width:72px;
  padding:8px 10px;
  border-radius:999px;
  border:1.5px solid var(--accent);
  background:transparent;
  color:var(--primary);
  font-size:12px;
  font-weight:600;
  letter-spacing:0.3px;
  cursor:pointer;
  text-align:center;
  transition:background .15s,color .15s,border-color .15s,box-shadow .15s;
  box-shadow:0 1px 3px rgba(0,0,0,.08);
  font-family:var(--sans);
}
.bundle-btn.selected{
  background:var(--primary);
  color:#fff;
  border-color:var(--primary);
  box-shadow:0 2px 6px rgba(31,95,58,.18);
}
.bundle-btn:hover:not(.selected){
  background:rgba(31,95,58,.07);
}
.bundle-btn--popular{margin-top:10px}
.bundle-btn--popular::after{
  content:'Most Popular';
  position:absolute;
  top:-10px;
  left:50%;
  transform:translateX(-50%);
  background:var(--accent);
  color:#fff;
  font-size:9px;
  font-weight:700;
  padding:1px 7px;
  border-radius:999px;
  white-space:nowrap;
  pointer-events:none;
}
.bundle-btn--best{margin-top:10px}
.bundle-btn--best::after{
  content:'Best Value';
  position:absolute;
  top:-10px;
  left:50%;
  transform:translateX(-50%);
  background:#b45309;
  color:#fff;
  font-size:9px;
  font-weight:700;
  padding:1px 7px;
  border-radius:999px;
  white-space:nowrap;
  pointer-events:none;
}

.bundle-label{
  font-size:11px;
  color:var(--muted);
  font-weight:600;
  white-space:nowrap;
  margin-right:2px;
}

/* Card price display */
.card-price-display{margin:8px 0 4px}
.price-row{display:flex;align-items:baseline;gap:8px;flex-wrap:wrap}
.price-current{font-size:22px;font-weight:800;color:var(--primary);line-height:1}
.price-mrp{font-size:13px;color:var(--muted);text-decoration:line-through;font-weight:400}
.price-badge{
  font-size:11px;
  font-weight:700;
  background:rgba(31,95,58,.1);
  color:var(--primary);
  padding:2px 8px;
  border-radius:999px;
  line-height:1.6;
}
.price-save{font-size:11px;color:var(--muted);margin-top:3px;min-height:16px}

/* Product detail page — scoped rules to avoid parent cascade */
.product-price-display{margin:14px 0 10px}
.product-price-display .price-row{display:flex;align-items:baseline;gap:10px;flex-wrap:wrap}
.product-price-display .price-current{font-size:30px;font-weight:800;color:var(--primary);line-height:1}
.product-price-display .price-mrp{font-size:15px;color:var(--muted);text-decoration:line-through;font-weight:400}
.product-price-display .price-badge{
  font-size:12px;
  font-weight:700;
  background:rgba(31,95,58,.1);
  color:var(--primary);
  padding:3px 10px;
  border-radius:999px;
  line-height:1.6;
}
.product-price-display .price-save{font-size:12px;color:var(--muted);margin-top:4px;min-height:18px}

/* Trust / social proof */
.card-rating{font-size:12px;color:var(--muted);margin:4px 0 2px;font-weight:500}
.card-trust{font-size:11px;color:var(--muted);margin-bottom:2px}
.card-freshness{
  display:inline-flex;
  align-items:center;
  gap:4px;
  font-size:11px;
  color:var(--primary);
  font-weight:600;
  margin-bottom:8px;
}
.card-freshness::before{
  content:'';
  display:inline-block;
  width:6px;height:6px;
  background:var(--primary);
  border-radius:50%;
}

@media(max-width:480px){
  .bundle-row{gap:8px}
  .bundle-btn{font-size:11px;padding:7px 10px;min-width:80px}
  .price-current{font-size:20px}
  .product-price-display .price-current{font-size:26px}
}

/* ================================================================
   STORE SEARCH — no-results message
================================================================ */
#search-no-results{
  display:none;
  grid-column:1/-1;
  text-align:center;
  padding:32px 16px;
  color:var(--muted);
  font-size:14px;
  font-family:var(--sans);
}

/* ================================================================
   RELATED VARIETIES
================================================================ */
.related-varieties{
  margin-top:32px;
}
.related-grid{
  display:flex;
  gap:12px;
}
.related-tile{
  flex:1;
  display:flex;
  flex-direction:column;
  gap:3px;
  padding:14px 16px;
  border:1px solid rgba(31,42,31,.12);
  border-radius:10px;
  text-decoration:none;
  color:var(--text);
  transition:border-color .15s,background .15s;
}
.related-tile:hover{
  border-color:rgba(31,95,58,.35);
  background:rgba(31,95,58,.03);
}
.related-name{
  font-size:14px;
  font-weight:600;
  font-family:var(--sans);
  color:var(--text);
}
.related-desc{
  font-size:12px;
  color:var(--muted);
  line-height:1.4;
}
.related-price{
  font-size:12px;
  font-weight:600;
  color:var(--primary);
  margin-top:6px;
}
@media(max-width:640px){
  .related-grid{flex-direction:column;}
}
