/**
 * FYOOL cart page — template/fyool-cart.html (guideline). Stock WC data, FYOOL markup.
 */

/* ─── Page shell ─── */
.fy-woo-page--cart.fy-woo-main {
  background: #fff;
}

.fy-woo-page--cart .fy-woo-page-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 40px 80px;
}

.fy-woo-page--cart .fy-woocommerce-wrap {
  max-width: 100%;
  margin: 0;
}

.fy-woo-page--cart .woocommerce-notices-wrapper {
  margin-bottom: 20px;
}

/* Page header — align with fyool-cart.html (title + breadcrumb) */
.fy-woo-page--cart .fy-woo-page-header {
  display: block;
  text-align: start;
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
  padding: 48px 40px 0;
  margin-bottom: 8px;
}

.fy-woo-page--cart .fy-woo-page-header .fy-slabel {
  display: none;
}

.fy-woo-page--cart .fy-woo-page-title,
.fy-woo-page--cart .fy-stitle {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 800;
  font-size: 40px;
  letter-spacing: -1px;
  line-height: 1.1;
  margin: 0 0 8px;
  color: var(--text);
  text-transform: none;
}

.fy-woo-page--cart .fy-blog-breadcrumb {
  margin: 0 0 40px;
}

.fy-woo-page--cart .fy-blog-breadcrumb-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.fy-woo-page--cart .fy-blog-breadcrumb-item a {
  color: var(--muted);
}

.fy-woo-page--cart .fy-blog-breadcrumb-item a:hover {
  color: var(--blue);
}

/* Separator comes from the global .fy-blog-breadcrumb-item::after
   (components.css); a second ::before here produced a double "› ›". */

.fy-woo-page--cart .fy-blog-breadcrumb-item span[aria-current="page"] {
  color: var(--text);
  font-weight: 600;
}

/* ─── Two-column layout ─── */
.fy-woo-page--cart .fy-cart-page {
  margin: 0;
}

.fy-woo-page--cart .fy-cart-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 32px;
  align-items: start;
}

/* ─── Cart table card ─── */
.fy-woo-page--cart .fy-cart-table-wrap {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}

.fy-woo-page--cart .woocommerce-cart-form {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.fy-woo-page--cart .fy-cart-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
}

.fy-woo-page--cart .fy-cart-table thead th {
  background: var(--surface);
  padding: 14px 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
  text-align: start;
  border-bottom: 1px solid var(--border);
}

.fy-woo-page--cart .fy-cart-table thead th.product-subtotal {
  text-align: end;
}

.fy-woo-page--cart .fy-cart-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}

.fy-woo-page--cart .fy-cart-table tbody tr:last-child {
  border-bottom: none;
}

.fy-woo-page--cart .fy-cart-table tbody tr:hover {
  background: var(--surface);
}

.fy-woo-page--cart .fy-cart-table tbody td {
  padding: 20px;
  vertical-align: middle;
  border: 0;
  background: transparent;
}

.fy-woo-page--cart .fy-cart-table tbody td.product-subtotal {
  text-align: end;
}

/* Product cell */
.fy-woo-page--cart .fy-cart-product {
  display: flex;
  align-items: center;
  gap: 16px;
}

.fy-woo-page--cart .fy-cart-img {
  width: 72px;
  height: 72px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface);
  flex-shrink: 0;
  border: 1px solid var(--border);
}

.fy-woo-page--cart .fy-cart-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.fy-woo-page--cart .fy-cart-product-name {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 17px;
  color: var(--text);
  margin-bottom: 3px;
  line-height: 1.2;
}

.fy-woo-page--cart .fy-cart-product-name a {
  color: inherit;
  text-decoration: none;
}

.fy-woo-page--cart .fy-cart-product-name a:hover {
  color: var(--blue);
}

.fy-woo-page--cart .fy-cart-product-meta {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
  line-height: 1.5;
}

.fy-woo-page--cart .fy-cart-product-meta .fy-cart-meta-line {
  display: block;
}

.fy-woo-page--cart .fy-cart-product-meta dl.variation {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.fy-woo-page--cart .fy-gift-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--green-soft);
  border: 1px solid #bbf7d0;
  color: #15803d;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  margin-bottom: 4px;
}

.fy-woo-page--cart .fy-cart-remove {
  font-size: 11px;
  color: var(--muted);
  text-decoration: underline;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  font-family: 'Barlow', sans-serif;
}

.fy-woo-page--cart .fy-cart-remove:hover {
  color: #ef4444;
}

/* Unit / line price */
.fy-woo-page--cart .fy-unit-price {
  font-size: 14px;
  color: var(--muted);
}

.fy-woo-page--cart .fy-unit-price--free {
  color: #15803d;
  font-weight: 600;
}

.fy-woo-page--cart .fy-line-price {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 800;
  font-size: 20px;
  color: var(--text);
}

/* Struck regular price before the discounted bundle total. */
.fy-woo-page--cart .fy-unit-was,
.fy-woo-page--cart .fy-line-was {
  color: var(--muted);
  text-decoration: line-through;
  font-weight: 600;
  margin-right: 4px;
}

.fy-woo-page--cart .fy-unit-was {
  font-size: 13px;
}

.fy-woo-page--cart .fy-line-was {
  font-size: 15px;
}

.fy-woo-page--cart .fy-line-price.free {
  color: #15803d;
  font-size: 16px;
}

/* Quantity */
.fy-woo-page--cart .fy-qty-wrap {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  width: fit-content;
}

.fy-woo-page--cart .fy-qty-wrap .quantity {
  display: contents;
}

.fy-woo-page--cart .fy-qty-btn {
  width: 32px;
  height: 34px;
  background: #fff;
  color: var(--muted);
  font-size: 16px;
  font-weight: 300;
  cursor: pointer;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.2s, color 0.2s;
}

.fy-woo-page--cart .fy-qty-btn:hover:not(:disabled) {
  background: var(--blue-soft);
  color: var(--blue);
}

.fy-woo-page--cart .fy-qty-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.fy-woo-page--cart .fy-qty-wrap input.qty,
.fy-woo-page--cart .fy-qty-wrap .fy-qty-input {
  width: 42px;
  height: 34px;
  text-align: center;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 16px;
  border: none;
  border-left: 1.5px solid var(--border);
  border-right: 1.5px solid var(--border);
  background: #fff;
  color: var(--text);
  appearance: textfield;
  -moz-appearance: textfield;
  padding: 0;
  min-height: 0;
  box-shadow: none !important;
}

.fy-woo-page--cart .fy-qty-wrap input.qty::-webkit-outer-spin-button,
.fy-woo-page--cart .fy-qty-wrap input.qty::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Coupon bar */
.fy-woo-page--cart .fy-coupon-bar {
  padding: 20px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.fy-woo-page--cart .fy-coupon-input {
  flex: 1;
  min-width: 160px;
  height: 40px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 0 14px;
  font-size: 14px;
  font-family: 'Barlow', sans-serif;
  color: var(--text);
  background: #fff;
}

.fy-woo-page--cart .fy-coupon-input:focus {
  outline: none;
  border-color: var(--blue);
}

.fy-woo-page--cart .fy-coupon-btn {
  height: 40px;
  padding: 0 20px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
}

.fy-woo-page--cart .fy-coupon-btn:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.fy-woo-page--cart .fy-coupon-applied {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #15803d;
  font-weight: 600;
  width: 100%;
}

.fy-woo-page--cart .fy-coupon-remove {
  font-size: 11px;
  color: var(--muted);
  text-decoration: underline;
  margin-left: 4px;
}

/* Cart footer row — Continue Shopping (left) + Clear Cart (right) */
.fy-woo-page--cart .fy-cart-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
}

/* Continue shopping */
.fy-woo-page--cart .fy-continue {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--blue);
  text-decoration: none;
}

.fy-woo-page--cart .fy-continue:hover {
  opacity: 0.75;
}

/* Clear Cart — link-style, mirrors fy-continue but muted / destructive on hover */
.fy-woo-page--cart .fy-clear-cart-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted, #6b7280);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
  transition: color 0.15s;
}

.fy-woo-page--cart .fy-clear-cart-btn:hover {
  color: #b91c1c;
}

/* ─── Order summary sidebar ─── */
.fy-woo-page--cart .fy-cart-aside .cart-collaterals {
  width: 100%;
  margin: 0;
  float: none;
}

/* WooCommerce sets .cart_totals to float:right; width:48% — override it */
.fy-woo-page--cart .fy-cart-aside .cart_totals {
  width: 100% !important;
  float: none !important;
}

.fy-woo-page--cart .fy-summary {
  position: sticky;
  top: 88px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}

.fy-woo-page--cart .fy-summary-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
}

.fy-woo-page--cart .fy-summary-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.3px;
  margin: 0;
}

.fy-woo-page--cart .fy-summary-body {
  padding: 20px 24px;
}

.fy-woo-page--cart .fy-summary-delivery {
  background: var(--green-soft);
  border: 1px solid #bbf7d0;
  border-radius: 10px;
  padding: 11px 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: #15803d;
  font-weight: 500;
  margin-bottom: 16px;
  line-height: 1.45;
}

.fy-woo-page--cart .fy-summary-delivery-icon {
  font-size: 18px;
  flex-shrink: 0;
  line-height: 1;
}

.fy-woo-page--cart .fy-gift-callout {
  background: var(--blue-soft);
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 16px;
}

.fy-woo-page--cart .fy-gift-callout-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--blue);
  margin-bottom: 3px;
}

.fy-woo-page--cart .fy-gift-callout-desc {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}

.fy-woo-page--cart .fy-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  margin-bottom: 12px;
  gap: 12px;
}

.fy-woo-page--cart .fy-summary-row .lbl {
  color: var(--muted);
}

.fy-woo-page--cart .fy-summary-row .val {
  font-weight: 600;
  color: var(--text);
  text-align: end;
}

.fy-woo-page--cart .fy-summary-row .val.free {
  color: #15803d;
  font-weight: 700;
}

.fy-woo-page--cart .fy-summary-row .val.saving {
  color: var(--green);
  font-weight: 700;
}

.fy-woo-page--cart .fy-summary-divider {
  height: 1px;
  background: var(--border);
  margin: 16px 0;
}

.fy-woo-page--cart .fy-summary-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 20px;
}

.fy-woo-page--cart .fy-summary-total .lbl {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.fy-woo-page--cart .fy-summary-total .val {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 800;
  font-size: 28px;
  color: var(--text);
}

.fy-woo-page--cart .wc-proceed-to-checkout {
  margin: 0 0 12px;
  padding: 0;
}

.fy-woo-page--cart .wc-proceed-to-checkout .checkout-button,
.fy-woo-page--cart .fy-checkout-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(90deg, var(--blue), #1477d2) !important;
  color: #fff !important;
  padding: 15px !important;
  border-radius: 10px !important;
  border: none !important;
  font-family: 'Barlow Condensed', sans-serif !important;
  font-weight: 700 !important;
  font-size: 19px !important;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  text-align: center;
  box-shadow: none;
  transition: opacity 0.2s, transform 0.15s;
}

.fy-woo-page--cart .wc-proceed-to-checkout .checkout-button:hover,
.fy-woo-page--cart .fy-checkout-btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
  color: #fff !important;
}

.fy-woo-page--cart .fy-summary-secure {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 0;
}

/* Upsell / cross-sells */
.fy-woo-page--cart .fy-upsell {
  border-top: 1px solid var(--border);
  padding: 16px 24px;
  background: var(--surface);
}

.fy-woo-page--cart .fy-upsell .cross-sells > h2 {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 12px;
}

.fy-woo-page--cart .fy-upsell .products {
  list-style: none;
  margin: 0;
  padding: 0;
}

.fy-woo-page--cart .fy-upsell .products li {
  margin: 0;
}

.fy-woo-page--cart .fy-upsell .product {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  transition: border-color 0.2s;
}

.fy-woo-page--cart .fy-upsell .product:hover {
  border-color: var(--blue);
}

/* Empty cart */
.fy-woo-page--cart .fy-empty-cart {
  text-align: center;
  padding: 80px 20px;
  max-width: 480px;
  margin: 0 auto;
}

.fy-woo-page--cart .fy-empty-icon {
  font-size: 56px;
  margin-bottom: 20px;
  line-height: 1;
}

.fy-woo-page--cart .fy-empty-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 800;
  font-size: 32px;
  margin-bottom: 10px;
}

.fy-woo-page--cart .fy-empty-sub {
  font-size: 15px;
  color: var(--muted);
  margin-bottom: 28px;
  line-height: 1.6;
}

/* Hide legacy goal bar on cart (summary callout replaces it) */
.fy-woo-page--cart .fy-cart-goal-wrap {
  display: none;
}

/* ─── Responsive ─── */
@media (max-width: 1024px) {
  .fy-woo-page--cart .fy-woo-page-inner {
    padding: 0 24px 64px;
  }

  .fy-woo-page--cart .fy-cart-layout {
    grid-template-columns: 1fr;
  }

  .fy-woo-page--cart .fy-summary {
    position: static;
  }
}

@media (max-width: 768px) {
  .fy-woo-page--cart .fy-woo-page-inner {
    padding: 0 20px 60px;
  }

  .fy-woo-page--cart .fy-cart-table thead tr th.product-price,
  .fy-woo-page--cart .fy-cart-table tbody tr td.product-price {
    display: none;
  }

  .fy-woo-page--cart .fy-cart-product {
    gap: 12px;
  }

  .fy-woo-page--cart .fy-cart-img {
    width: 52px;
    height: 52px;
    border-radius: 8px;
  }

  .fy-woo-page--cart .fy-cart-product-name {
    font-size: 15px;
  }

  /* Compact, flat cart items: one rounded card (the table wrap) with plain
     rows separated by dividers — no per-item nested cards. Each item lays out
     as [image + name/meta/remove] on top, then [quantity] / [total] below. */
  .fy-woo-page--cart .fy-cart-table-wrap {
    border-radius: 14px;
  }

  .fy-woo-page--cart .fy-cart-table thead {
    display: none;
  }

  /* :not(.fy-cart-addon-collapsed) so the display:grid !important does not
     override the collapsed add-on rows' display:none (toggle stays working). */
  .fy-woo-page--cart .fy-cart-table tbody tr.cart_item:not(.fy-cart-addon-collapsed) {
    display: grid !important;
    grid-template-columns: auto 1fr;
    grid-template-areas:
      'product product'
      'qty total';
    gap: 12px;
    align-items: center;
    padding: 14px 16px !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    border-bottom: 1px solid var(--border) !important;
  }

  .fy-woo-page--cart .fy-cart-table tbody tr.cart_item:last-child {
    border-bottom: 0 !important;
  }

  /* The add-ons toggle row is inserted by cart-page.js and is not a .cart_item,
     so it escapes the flattening above and keeps woocommerce.css's mobile card
     treatment (1px border + 12px radius + margin). Flatten it to match the
     other rows — the table wrap is the only rounded card on mobile. */
  .fy-woo-page--cart .fy-cart-table tbody tr.fy-cart-row--addons-toggle {
    display: block !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    border-bottom: 1px solid var(--border) !important;
  }

  .fy-woo-page--cart .fy-cart-table tbody tr.fy-cart-row--addons-toggle:last-child {
    border-bottom: 0 !important;
  }

  .fy-woo-page--cart .fy-cart-table tbody td {
    display: block;
    padding: 0 !important;
    border: 0 !important;
  }

  /* Keep the per-unit price column hidden (my td rule above would show it). */
  .fy-woo-page--cart .fy-cart-table tbody td.product-price {
    display: none !important;
  }

  /* Drop WooCommerce's responsive data-title labels for a cleaner look. */
  .fy-woo-page--cart .fy-cart-table tbody td::before {
    display: none !important;
  }

  .fy-woo-page--cart .fy-cart-table tbody td.product-name {
    grid-area: product;
  }

  .fy-woo-page--cart .fy-cart-table tbody td.product-quantity {
    grid-area: qty;
    text-align: left;
  }

  .fy-woo-page--cart .fy-cart-table tbody td.product-subtotal {
    grid-area: total;
    text-align: right;
    font-weight: 800;
    font-size: 16px;
  }

  .fy-woo-page--cart .fy-cart-table tbody td.product-subtotal .fy-line-price {
    width: 100%;
    text-align: right;
  }

  .fy-woo-page--cart .fy-cart-table tbody td.product-quantity .fy-line-price {
    width: 100%;
    text-align: left;
  }
}
