﻿:root {
  --gazonca-green-deep: #1f4d2b;
  --gazonca-green-accent: #8ec641;
  --gazonca-cream: #f7f4ec;
}

/*
body.woocommerce-cart {
  background: linear-gradient(180deg, #f5f1e8 0%, #f7f4ec 28%, #ffffff 100%);
}
*/

.gazonca-cart-page {
  padding: 60px 0;
  min-height: 60vh;
}

.gazonca-shell {
  width: min(1280px, calc(100% - 48px));
  margin: 0 auto;
}

.gazonca-cart-container {
  background: #ffffff;
  border-radius: 24px;
  padding: 48px;
  box-shadow: 0 16px 48px rgba(31, 77, 43, 0.08);
  border: 1px solid rgba(31, 77, 43, 0.08);
}

/* Quantity Controls */
.woocommerce table.cart td.product-quantity {
  min-width: 180px;
}

.woocommerce table.cart td.product-quantity .quantity {
  display: inline-flex;
  align-items: center;
  gap: 0;
  margin: 0;
}

.woocommerce table.cart td.product-quantity .qty-button {
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid rgba(31, 77, 43, 0.2);
  background: #ffffff;
  color: var(--gazonca-green-deep);
  font-size: 20px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.woocommerce table.cart td.product-quantity .qty-button.minus {
  border-radius: 10px 0 0 10px;
}

.woocommerce table.cart td.product-quantity .qty-button.plus {
  border-radius: 0 10px 10px 0;
}

.woocommerce table.cart td.product-quantity .qty-button:hover {
  background: rgba(142, 198, 65, 0.15);
  border-color: var(--gazonca-green-accent);
  color: var(--gazonca-green-accent);
}

.woocommerce table.cart td.product-quantity .qty {
  width: 60px;
  padding: 10px 0;
  text-align: center;
  border: 1px solid rgba(31, 77, 43, 0.2);
  border-left: none;
  border-right: none;
  font-weight: 600;
  font-size: 15px;
  color: var(--gazonca-green-deep);
  background: #ffffff;
  margin: 0;
  transition: all 0.2s ease;
  -moz-appearance: textfield;
}

.woocommerce table.cart td.product-quantity .qty::-webkit-outer-spin-button,
.woocommerce table.cart td.product-quantity .qty::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.woocommerce table.cart td.product-quantity .qty:focus {
  border-color: var(--gazonca-green-accent);
  outline: none;
  box-shadow: 0 0 0 3px rgba(142, 198, 65, 0.15);
}

/* Remove Button */
.woocommerce table.cart td.product-remove {
  text-align: center;
}

.woocommerce table.cart td.product-remove a.remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: rgba(211, 47, 47, 0.1);
  color: #d32f2f;
  text-decoration: none;
  font-weight: bold;
  font-size: 20px;
  border-radius: 10px;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  line-height: 1;
}

.woocommerce table.cart td.product-remove a.remove:hover {
  background: rgba(211, 47, 47, 0.25);
  color: #b71c1c;
  border-color: #d32f2f;
}

/* Responsive */
@media (max-width: 1024px) {
  .gazonca-cart-container {
    padding: 36px;
  }

  .woocommerce table.cart th,
  .woocommerce table.cart td {
    padding: 16px 12px;
  }
}

@media (max-width: 768px) {
  .gazonca-cart-page {
    padding: 40px 0;
  }

  .gazonca-shell {
    width: calc(100% - 24px);
  }

  .gazonca-cart-container {
    padding: 24px 18px;
    border-radius: 16px;
  }

  .woocommerce .cart_totals {
    margin-top: 28px;
  }

  .woocommerce .cart_totals h2 {
    font-size: 20px;
    margin-bottom: 20px;
  }

  .woocommerce .wc-proceed-to-checkout a.checkout-button {
    width: 100%;
    padding: 14px 24px;
    font-size: 15px;
  }

  /* ------------------------------------------------------------------ */
  /* Mobile cart: transform the table into product cards (block style)  */
  /* ------------------------------------------------------------------ */

  /* Hide the column header row */
  .woocommerce table.cart thead {
    display: none;
  }

  .woocommerce table.cart,
  .woocommerce table.cart tbody {
    display: block;
    width: 100%;
    border: 0;
    margin: 0;
  }

  /* Each product line becomes a card */
  .woocommerce table.cart tbody tr.cart_item {
    display: grid;
    grid-template-columns: 84px 1fr auto;
    grid-template-areas:
      "thumb name     remove"
      "thumb price    price"
      "thumb quantity quantity"
      "thumb subtotal subtotal";
    column-gap: 16px;
    row-gap: 10px;
    align-items: center;
    position: relative;
    padding: 18px 16px;
    margin: 0 0 16px;
    background: #ffffff;
    border: 1px solid rgba(31, 77, 43, 0.12);
    border-radius: 16px;
    box-shadow: 0 6px 20px rgba(31, 77, 43, 0.06);
  }

  /* Neutralise the default table cell styling inside cards */
  .woocommerce table.cart tbody tr.cart_item td {
    display: block;
    width: auto;
    padding: 0;
    margin: 0;
    border: 0;
    background: transparent !important; /* override WooCommerce zebra striping */
    text-align: left !important; /* override smallscreen text-align:right */
  }

  /* Remove the default "data-title" pseudo labels on cells that don't need them */
  .woocommerce table.cart td.product-name::before,
  .woocommerce table.cart td.product-thumbnail::before,
  .woocommerce table.cart td.product-quantity::before,
  .woocommerce table.cart td.product-remove::before {
    display: none !important;
  }

  /* Thumbnail on the left, spanning the full card height */
  .woocommerce table.cart td.product-thumbnail {
    grid-area: thumb;
    align-self: start;
  }

  .woocommerce table.cart td.product-thumbnail img {
    width: 84px;
    height: 84px;
    max-width: none;
    object-fit: cover;
    border-radius: 12px;
    display: block;
  }

  /* Product name */
  .woocommerce table.cart td.product-name {
    grid-area: name;
    align-self: center;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.35;
  }

  .woocommerce table.cart td.product-name a {
    color: var(--gazonca-green-deep);
    text-decoration: none;
  }

  /* Unit price */
  .woocommerce table.cart td.product-price {
    grid-area: price;
    font-size: 14px;
    color: #5f6b62;
  }

  .woocommerce table.cart td.product-price::before {
    content: "Prix unitaire\00a0: ";
    display: block !important;
    float: none !important;
    margin-bottom: 2px;
    font-size: 12px;
    font-weight: 600;
    color: #8a948c;
  }

  /* Quantity stepper */
  .woocommerce table.cart td.product-quantity {
    grid-area: quantity;
    min-width: 0;
  }

  /* Line subtotal */
  .woocommerce table.cart td.product-subtotal {
    grid-area: subtotal;
    font-size: 16px;
    font-weight: 700;
    color: var(--gazonca-green-deep);
  }

  .woocommerce table.cart td.product-subtotal::before {
    content: "Sous-total\00a0: ";
    display: block !important;
    float: none !important;
    margin-bottom: 2px;
    font-size: 12px;
    font-weight: 600;
    color: #8a948c;
  }

  /* Remove button sits in its own grid cell, top-right of the card */
  .woocommerce table.cart td.product-remove {
    grid-area: remove;
    align-self: center;
    justify-self: end;
  }

  .woocommerce table.cart td.product-remove a.remove {
    width: 32px;
    height: 32px;
    font-size: 18px;
  }

  /* Coupon / update row spans the full width below the cards */
  .woocommerce table.cart tbody tr:not(.cart_item) {
    display: block;
  }

  .woocommerce table.cart td.actions {
    display: block;
    width: 100%;
    padding: 4px 0 0;
    text-align: left;
  }

  .woocommerce table.cart td.actions::before {
    display: none !important;
  }

  .woocommerce table.cart td.actions .coupon {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
  }

  .woocommerce table.cart td.actions .coupon input#coupon_code {
    flex: 1 1 auto;
    min-width: 0;
  }

  .woocommerce table.cart td.actions button[name="update_cart"] {
    width: 100%;
  }
  /* Cart totals: prevent text from pressing against the container edges */
  .woocommerce .cart_totals table tr td,
  .woocommerce .cart_totals table tr th {
    padding: 10px 4px;
  }

  /* Shipping calculator selects: fix text-align right inherited from WooCommerce smallscreen */
  .woocommerce .cart_totals .woocommerce-shipping-calculator select,
  .woocommerce .cart_totals .woocommerce-shipping-calculator .select2-container {
    text-align: left !important;
    direction: ltr;
  }
  .woocommerce .cart_totals .woocommerce-shipping-calculator select {
    padding-right: 2.5em;
    width: 100%;
    box-sizing: border-box;
  }
}

@media (max-width: 600px) {
  .gazonca-cart-page {
    padding: 28px 0;
  }

  .gazonca-shell {
    width: calc(100% - 16px);
  }

  .gazonca-cart-container {
    padding: 18px 14px;
    border-radius: 12px;
  }

  .woocommerce table.cart tbody tr.cart_item {
    grid-template-columns: 72px 1fr auto;
    column-gap: 14px;
    padding: 16px 14px;
  }

  .woocommerce table.cart td.product-thumbnail img {
    width: 72px;
    height: 72px;
  }

  .woocommerce table.cart td.product-name {
    font-size: 15px;
  }

  .woocommerce .cart_totals {
    margin-top: 20px;
  }

  .woocommerce .cart_totals table tr td,
  .woocommerce .cart_totals table tr th {
    padding: 8px 4px;
  }
}
