/* =============================================
   SINGLE PRODUCT PAGE
   woocommerce/single-product.php
============================================= */

/* Back bar */
.sp-back-bar {
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  padding: 10px 1.25rem;
}

.sp-back-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #374151;
  text-decoration: none;
  transition: color .15s;
}

.sp-back-link:hover {
  color: #2f6f3e;
}

/* Product layout */
.sp-product-area {
  padding: 1.5rem 1.25rem;
}

.sp-product-wrap {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  max-width: 900px;
}

/* Images */
.sp-media {
  flex: 0 0 340px;
  max-width: 340px;
}

.sp-media .woocommerce-product-gallery {
  float: none !important;
  width: 100% !important;
  margin-bottom: 0;
}

.sp-media .woocommerce-product-gallery__image img {
  border-radius: 12px;
  width: 100%;
  height: auto;
  object-fit: cover;
}

/* Summary */
.sp-summary {
  flex: 1;
  min-width: 0;
}

.sp-location {
  font-size: 0.78rem;
  color: #6b7280;
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0 0 8px;
}

.sp-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: #111827;
  margin: 0 0 8px;
  line-height: 1.2;
}

.sp-price {
  font-size: 1.3rem;
  font-weight: 700;
  color: #14532d;
  margin-bottom: 12px;
}

.sp-short-desc {
  font-size: 0.9rem;
  color: #374151;
  line-height: 1.6;
  margin-bottom: 1rem;
}

.sp-cart-area {
  margin-bottom: 1.25rem;
}

.sp-cart-area .single_add_to_cart_button {
  width: 100%;
  padding: 14px;
  font-size: 1rem;
  font-weight: 700;
  background: #2f6f3e;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background .15s;
}

.sp-cart-area .single_add_to_cart_button:hover {
  background: #235530;
}

/* Description accordion */
.sp-description {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  margin-bottom: 1rem;
  overflow: hidden;
}

.sp-description summary {
  padding: 12px 16px;
  font-weight: 700;
  font-size: 0.9rem;
  color: #111827;
  cursor: pointer;
  list-style: none;
  background: #f9fafb;
}

.sp-description summary::-webkit-details-marker { display: none; }
.sp-description summary::after { content: ' ▾'; font-size: 0.75rem; }
.sp-description[open] summary::after { content: ' ▴'; }

.sp-description-body {
  padding: 14px 16px;
  font-size: 0.9rem;
  color: #374151;
  line-height: 1.65;
}

/* Mobile sticky add-to-cart */
@media (max-width: 960px) {
  .sp-product-wrap {
    flex-direction: column;
    gap: 1.25rem;
  }

  .sp-media {
    flex: 0 0 auto;
    max-width: 100%;
    width: 100%;
  }

  /* Sticky add-to-cart on mobile */
  .sp-cart-area {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 500;
    background: #fff;
    padding: 12px 1.25rem;
    border-top: 1px solid #e5e7eb;
    box-shadow: 0 -4px 16px rgba(0,0,0,.08);
    margin-bottom: 0;
  }
}

/* Quick-view trigger button on loop cards */
.farmtab-quick-view-trigger {
  width: 100%;
  padding: 9px 12px;
  font-size: 0.88rem;
  font-weight: 700;
  background: #2f6f3e;
  color: #ffffff;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: background .15s;
  font-family: inherit;
}

.farmtab-quick-view-trigger:hover {
  background: #235530;
}


/* =============================================
   CHECKOUT PAGE
   page-checkout.php
============================================= */

/* Minimal checkout header */
.co-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 1.5rem;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  position: sticky;
  top: 0;
  z-index: 200;
}

.co-back {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #374151;
  text-decoration: none;
  transition: color .15s;
}

.co-back:hover { color: #2f6f3e; }

.co-header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.co-logo {
  height: 28px;
  width: auto;
}

.co-header-farm {
  font-size: 0.85rem;
  color: #6b7280;
  font-weight: 500;
}

.co-header-right {
  width: 80px; /* matches .co-back to keep brand centered */
}

/* Page layout */
.co-page-wrap {
  display: flex;
  align-items: flex-start;
  gap: 2rem;
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.25rem 6rem; /* bottom pad for sticky footer */
  background: #f6f7f5;
  min-height: 100vh;
}

/* Form column */
.co-form-col {
  flex: 1;
  min-width: 0;
}

/* Summary column */
.co-summary-col {
  flex: 0 0 320px;
  position: sticky;
  top: 80px;
}

.co-summary-panel {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 1.25rem;
}

.co-summary-title {
  font-size: 1rem;
  font-weight: 700;
  color: #111827;
  margin: 0 0 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #f3f4f6;
}

.co-summary-items {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 1rem;
}

.co-summary-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.co-summary-item-img-wrap {
  position: relative;
  flex-shrink: 0;
}

.co-summary-item-img {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid #e5e7eb;
}

.co-summary-item-qty {
  position: absolute;
  top: -6px;
  right: -6px;
  background: #374151;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  border-radius: 999px;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.co-summary-item-name {
  flex: 1;
  font-size: 0.85rem;
  color: #111827;
  font-weight: 500;
  line-height: 1.3;
}

.co-summary-item-price {
  font-size: 0.85rem;
  font-weight: 700;
  color: #111827;
  white-space: nowrap;
}

.co-summary-totals {
  border-top: 1px solid #e5e7eb;
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.co-summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: #374151;
}

.co-summary-total {
  font-size: 1rem;
  font-weight: 700;
  color: #111827;
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid #e5e7eb;
}

/* ── Checkout Accordion — div + button based, class-toggled ── */
.co-accordion {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  margin-bottom: 12px;
  overflow: hidden;
}

.co-accordion-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 16px 18px;
  background: #fff;
  border: none;
  border-bottom: 1px solid transparent;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  user-select: none;
  transition: background .15s, border-color .15s;
}

.co-accordion--open > .co-accordion-toggle {
  border-bottom-color: #f3f4f6;
  background: #fafafa;
}

.co-step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #2f6f3e;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.co-step-label {
  flex: 1;
  font-size: 0.95rem;
  font-weight: 700;
  color: #111827;
}

.co-chevron {
  color: #9ca3af;
  flex-shrink: 0;
  transition: transform .2s;
}

.co-accordion--open > .co-accordion-toggle .co-chevron {
  transform: rotate(180deg);
}

/* Body hidden by default, shown when open */
.co-accordion-body {
  display: none;
  padding: 1.25rem 1.25rem 1.5rem;
}

.co-accordion--open > .co-accordion-body {
  display: block;
}

/* WC form fields */
.co-accordion-body .woocommerce-billing-fields,
.co-accordion-body .woocommerce-shipping-fields,
.co-accordion-body .woocommerce-additional-fields {
  background: transparent;
  padding: 0;
  border-radius: 0;
  margin-bottom: 0;
}

.co-accordion-body .woocommerce-checkout-payment {
  background: transparent;
  padding: 0;
  border-radius: 0;
  margin-top: 0;
}

/* Hide WC's native order review heading — we have our step label */
h3#order_review_heading { display: none; }

/* Login prompt inside accordion */
.co-login-text {
  font-size: 0.9rem;
  color: #374151;
  margin: 0 0 8px;
}

.co-login-link {
  color: #2f6f3e;
  font-weight: 600;
  text-decoration: underline;
}

.co-login-guest {
  color: #9ca3af;
  font-size: 0.82rem;
}

/* WC form inside accordions */
.co-accordion-body .woocommerce-billing-fields,
.co-accordion-body .woocommerce-shipping-fields,
.co-accordion-body .woocommerce-additional-fields {
  background: transparent;
  padding: 0;
  border-radius: 0;
  margin-bottom: 0;
}

.co-accordion-body #order_review {
  background: transparent;
}

.co-accordion-body .woocommerce-checkout-payment {
  background: transparent;
  padding: 0;
  border-radius: 0;
  margin-top: 0;
}

/* Sticky Place Order footer */
.co-sticky-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 300;
  background: #fff;
  border-top: 1px solid #e5e7eb;
  padding: 12px 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  box-shadow: 0 -4px 16px rgba(0,0,0,.08);
}

.co-sticky-total {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.co-sticky-label {
  font-size: 0.72rem;
  color: #9ca3af;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.co-sticky-total strong {
  font-size: 1.1rem;
  font-weight: 800;
  color: #111827;
}

.co-place-order-btn {
  padding: 13px 28px;
  background: #2f6f3e;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s, opacity .15s;
  white-space: nowrap;
}

.co-place-order-btn:disabled {
  background: #d1d5db;
  color: #9ca3af;
  cursor: not-allowed;
}

.co-place-order-btn:not(:disabled):hover {
  background: #235530;
}

/* Mobile: stack to single column */
@media (max-width: 768px) {
  .co-page-wrap {
    flex-direction: column-reverse; /* summary on top on mobile */
    padding-top: 1rem;
  }

  .co-summary-col {
    flex: 0 0 auto;
    width: 100%;
    position: static;
  }

  .co-header-right { display: none; }
  .co-header-brand { margin-left: auto; }
}

/* ── Order Received / Thank-You Page ── */
.co-thankyou-wrap {
  max-width: 720px;
  margin: 2rem auto;
  padding: 0 1.25rem 4rem;
}

.co-thankyou-wrap .woocommerce-order {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 2rem;
}

.co-thankyou-wrap .woocommerce-order-overview {
  list-style: none;
  padding: 0;
  margin: 1.25rem 0;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
}

.co-thankyou-wrap .woocommerce-order-overview li {
  flex: 1 1 160px;
  padding: 1rem;
  background: #f9fafb;
  font-size: 0.85rem;
  color: #374151;
  border-right: 1px solid #e5e7eb;
}

.co-thankyou-wrap .woocommerce-order-overview li:last-child {
  border-right: none;
}

.co-thankyou-wrap .woocommerce-order-overview li strong {
  display: block;
  font-size: 1rem;
  color: #111827;
  margin-top: 2px;
}

.co-thankyou-wrap .woocommerce-thankyou-order-received {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.co-thankyou-wrap h2 {
  font-size: 1rem;
  font-weight: 700;
  color: #111827;
  margin: 1.5rem 0 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #f3f4f6;
}

.co-thankyou-wrap .woocommerce-order-details__title,
.co-thankyou-wrap .woocommerce-column__title {
  font-size: 1rem;
  font-weight: 700;
  color: #111827;
}

.co-thankyou-wrap .shop_table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
  font-size: 0.88rem;
}

.co-thankyou-wrap .shop_table th,
.co-thankyou-wrap .shop_table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid #f3f4f6;
  color: #374151;
}

.co-thankyou-wrap .shop_table tfoot td,
.co-thankyou-wrap .shop_table tfoot th {
  font-weight: 600;
}

.co-thankyou-wrap .shop_table tfoot tr.order-total td,
.co-thankyou-wrap .shop_table tfoot tr.order-total th {
  font-size: 1rem;
  font-weight: 800;
  color: #111827;
}

.co-thankyou-wrap .woocommerce-customer-details address {
  font-style: normal;
  font-size: 0.88rem;
  color: #374151;
  line-height: 1.7;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 1rem;
  margin-top: 0.5rem;
}

.co-thankyou-wrap .woocommerce-notice--success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  padding: 1rem 1.25rem;
  color: #14532d;
  font-weight: 600;
  margin-bottom: 1.5rem;
}

@media (max-width: 600px) {
  .co-thankyou-wrap .woocommerce-order-overview li {
    flex: 1 1 100%;
    border-right: none;
    border-bottom: 1px solid #e5e7eb;
  }
}