// css

.hhd-footer-button {
  width: 100%;
  margin-top: 1rem;
}


/* Two-column grid for Billing vs. Shipping/Collection */
.woocommerce-customer-details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

/* Stack on narrow screens */
@media (max-width: 600px) {
  .woocommerce-customer-details-grid {
    grid-template-columns: 1fr;
  }
}


/* hhd-cart.css */

.hhd-custom-cart {
  width: 100%;
  border-collapse: collapse;
  font-family: Arial, sans-serif;
  table-layout: fixed;
}

/* Column widths */
.hhd-custom-cart thead th:first-child { width: 50%; }
.hhd-custom-cart thead th:nth-child(2),
.hhd-custom-cart thead th:nth-child(3) { width: 25%; }

/* Headers: base styles */
.hhd-custom-cart thead th {
  padding: 0;
  margin: 0;
  text-align: center;
  vertical-align: top;
}

/* Product header: white background, left-aligned label */
.hhd-custom-cart thead th:first-child {
  width: 50%;
  background-color: #ffffff;
  color: #00205C;
  border-bottom: 2px solid #002B5C;
  text-align: left;
  padding: 16px;
  font-weight: bold;
  vertical-align: bottom;	
}

/* Click & Collect and Home Delivery header container */
.hhd-custom-cart thead th:nth-child(2),
.hhd-custom-cart thead th:nth-child(3) {
  width: 25%;
  padding: 0;
}

/* Divider between headers 2 & 3 */
.hhd-custom-cart thead th:nth-child(2) {
  border-right: 1px solid #cddae0;
}

/* Dark blue top row header text */
.hhd-custom-cart thead th:nth-child(2) > strong,
.hhd-custom-cart thead th:nth-child(3) > strong {
  display: block;
  background-color: #002B5C;
  color: #ffffff;
  font-size: 19px;
  text-transform: capitalize;
  text-align: center;
  padding: 12px 0;
  border-top-left-radius: 4px;
  border-top-right-radius: 4px;
  border-bottom: 2px solid #002B5C;
}

/* Light blue below header background and content */
.hhd-custom-cart thead th:nth-child(2),
.hhd-custom-cart thead th:nth-child(3) {
  background-color: #F0F6FC;
  border-bottom: 2px solid #002B5C;
}

/* Selected store/postcode text */
.hhd-custom-cart thead th:nth-child(2) .hhd-store-name,
.hhd-custom-cart thead th:nth-child(3) .hhd-postcode {
  display: block;
  font-size: 17px;
  text-transform: capitalize;
  text-align: center;
  color: #00205C;
  margin: 2px 0 2px;
}

/* Under the store name in the cart header */
.hhd-store-address {
  display: block;
  font-size: 12px;
  color: #666;
  margin-bottom: 2px;
  line-height: 1;
  text-align: center;
}

.hhd-custom-cart thead th:nth-child(2) .hhd-collect-summary,
.hhd-custom-cart thead th:nth-child(3) .hhd-delivery-summary {
  display: block;
  font-size: 14px;
  text-transform: initial ;
  text-align: center;
  color: #626262;
  margin: 4px 0 2px;
}

/* Delivery message under the postcode in cart header */
.hhd-delivery-message {
  display: block;
  font-size: 12px;
  color: #666;
  margin-bottom: 2px;
  line-height: 1;
  text-align:center;
}



/* Change links styling */
.hhd-custom-cart thead th:nth-child(2) a.change-store-link,
.hhd-custom-cart thead th:nth-child(3) a.change-postcode-link {
  display: block;
  font-size: 12px;
  text-transform: lowercase;
  text-align: center;
  color: #c00;
  font-weight: 400;
  margin-bottom: 2px;
  text-decoration: none;
}

/* Divider between columns 2 & 3 for body & footer */
.hhd-custom-cart tbody td:nth-child(2),
.hhd-custom-cart tfoot td:nth-child(2) {
  border-right: 1px solid #cddae0;
}

/* Body rows */
.hhd-custom-cart tbody tr td:first-child {
  background-color: #ffffff;
  border-right: 1px solid #cddae0;
  text-align: left;
  vertical-align: bottom;
  padding: 16px;
}
.hhd-custom-cart tbody tr td:nth-child(2),
.hhd-custom-cart tbody tr td:nth-child(3) {
  background-color: #F0F6FC;
  text-align: center;
  vertical-align: top;
  padding: 16px;
}
.hhd-custom-cart tbody tr:nth-child(even) td:nth-child(2),
.hhd-custom-cart tbody tr:nth-child(even) td:nth-child(3) {
  background-color: #e4eef8;
}
.hhd-custom-cart tbody tr:hover td:nth-child(2),
.hhd-custom-cart tbody tr:hover td:nth-child(3) {
  background-color: #dbeaf6;
}

/* Thumbnail height override */
.hhd-custom-cart td img {
  height: 90px !important;
  width: auto !important;
  vertical-align: center;
}


/* Quantity controls inline size restored */
.hhd-custom-cart .hhd-qty-control {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-top: 4px;
}
.hhd-custom-cart .hhd-qty-input {
  width: 50px !important;
  text-align: center;
  border: 1px solid #ccc;
  border-radius: 4px;
  background-color: #fff;
}

/* Footer row: three columns */
.hhd-custom-cart tfoot td:first-child { width: 50%; text-align: right; vertical-align: middle; padding: 6px; }
.hhd-custom-cart tfoot td:nth-child(2),
.hhd-custom-cart tfoot td:nth-child(3) { width: 25%; text-align: center; vertical-align: middle; padding: 2px; }

/* Footer buttons fill their cells with custom colors */
.hhd-custom-cart .hhd-footer-button {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  padding: 12px;
  box-sizing: border-box;
  text-align: center !important;
  font-size: 14px;
  background-color: #7AB800 !important;
  color: #ffffff !important;
  text-decoration: none;
  border: none;
  border-radius: 2px;
  text-transform: capitalize;
  font-weight: 600;
}
.hhd-custom-cart .hhd-footer-button:hover {
  background-color: #699E00 !important;
  color: #ffffff !important;
}

/* Subtotal styling */
.hhd-custom-cart .hhd-footer-subtotal { font-weight: bold; color: #002B5C; margin-left: 4px; font-size:18px; }


/* ===== Desktop: match mobile styling ===== */

/* Qty pill + buttons */
.hhd-custom-cart .hhd-qty-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;                 /* same as mobile */
  margin-top: 6px;
}
.hhd-custom-cart .hhd-qty-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border: 1px solid #cbd5e1;
  background: #fff;
  border-radius: 4px;
  line-height: 1;
  cursor: pointer;
}
.hhd-custom-cart .hhd-qty-input {
  appearance: none;
  background: #fff;
  border: 1px solid #cbd5e1;   /* mobile tone */
  border-radius: 4px;
  padding: 8px 14px;
  min-width: 50px;
  font-weight: 600;
  font-size: .95rem;
  line-height: 1;
  box-shadow: 0 1px 0 rgba(0,0,0,.03);
  text-align: center;
}
.hhd-custom-cart .hhd-qty-input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}
/* remove spinners */
.hhd-custom-cart .hhd-qty-input::-webkit-outer-spin-button,
.hhd-custom-cart .hhd-qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.hhd-custom-cart .hhd-qty-input[type="number"] { -moz-appearance: textfield; }

/* SKU: tiny, grey (matches mobile .hhd-msku) */
.hhd-custom-cart .hhd-sku {
  display: block;
  font-size: 10px;
  color: #6b7280;
  margin-top: 2px;
  letter-spacing: .02em;
}

/* Price: bold, navy, 20px; multiplier lighter */
.hhd-custom-cart .hhd-price-line {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin: 4px 0 2px;
}
.hhd-custom-cart .hhd-unit-price {
  font-weight: 700;
  white-space: nowrap;
  color: #00205c;
  font-size: 20px;         /* same visual weight as mobile card price */
  line-height: 1.1;
}
.hhd-custom-cart .hhd-price-multiplier {
  font-size: 0.9rem;
  color: #6b7280;
}


/*MOBILE-ONLY LAYOUT FOR HHD-CART  */

/* default: show desktop, hide mobile */
.hhd-desktop-cart { display: block; }
.hhd-mobile-cart  { display: none; }

@media (max-width: 768px) {
  /* hide desktop, show mobile */
  .hhd-desktop-cart { display: none !important; }
  .hhd-mobile-cart  { display: block !important; }

  /* Only active panel visible */
  .hhd-mobile-content { display: none !important; }
  .hhd-mobile-content.active { display: block !important; }

  /* Tabs */
  .hhd-mobile-tabs {
    display: flex;
    gap: 4px;
    border-radius: 4px 4px 0 0;
    overflow: hidden;
    margin-bottom: 0;
  }
  .hhd-mobile-tab {
    flex: 1;
    padding: .75rem 0;
    background: #00205c;
    border: 2px solid #00205c;
    border-bottom: none;
    text-align: center;
    font-weight: 700;
    color: #fff;
    margin: 0;
  }
  .hhd-mobile-tab.active {
    background: #fff;
    color: #00205c;
    border: 2px solid #00205c;
    border-bottom: none;
  }

  /* Header under tabs */
  .hhd-mobile-panel-header {
    border: 2px solid #00205c;
    border-top: none;
    background: #fff;
    padding: 1rem;
    border-radius: 0 0 4px 4px;
    margin-top: -2px;
  }
  .hhd-store-name,
  .hhd-postcode {
    font-size: 1.125rem;
    font-weight: 600;
    color: #00205c;
    margin: .25rem 0;
    text-transform: capitalize;
  }
  .hhd-postcode { text-transform: uppercase; }
  .hhd-collect-summary,
  .hhd-delivery-summary {
    font-size: 12px;
    color: #666;
    margin: .5rem 0 0;
  }
  .change-store-link,
  .change-postcode-link {
    display: block;
    font-size: .85rem;
    color: #c00;
    text-decoration: none;
    margin-top: .5rem;
  }

  /* Items container: white background per your spec */
  .hhd-mobile-items {
    background: #fff;

  }

  /* ───────── style item card ───────── */
  .hhd-mcard{
    display:grid;
    grid-template-columns: 90px 1fr;
    grid-template-areas:
      "thumb body"
      "controls controls"
      "avail avail";
    gap: 12px;
    background:#fff;
    border:2px solid #ebf3fb;
    border-radius:4px;
    padding:12px;
    margin:12px 0;
  }
  .hhd-mthumb{ grid-area: thumb; }
  .hhd-mthumb img{ width:90px; height:auto; display:block; border-radius:3px; }

.hhd-mbody{ grid-area: body; min-width:0; }
  .hhd-mtitle{
    display:block;
    font-weight:600;
    color:#002B5C;
    text-decoration:none;
    line-height:1.25;
    word-break: break-word;        /* ensure wrapping */
    overflow-wrap: anywhere;       /* long words don’t overflow */
  }
  .hhd-msku{ font-size:10px; color:#6b7280; margin-top:2px; }

  /* Controls row: Qty (left) | Remove (middle) | Price (right) */
  .hhd-mcontrols{
    grid-area: controls;
    display:grid;
    grid-template-columns: 1fr auto auto;
    align-items:center;
    gap:30px;
    width:100%;
    padding-top:4px;
  }


  /* Qty pill */
 .hhd-mqty{ display:flex; align-items:center; gap:8px; }
  .hhd-mqty label{ font-size:.85rem; color:#374151; }
  .hhd-mobile-qty-input{
    appearance:none;
    background:#fff;
    border:1px solid #cbd5e1;
    border-radius:4px;
    padding:8px 14px;
    min-width:50px;
    font-weight:600;
    font-size:.95rem;
    line-height:1;
    box-shadow:0 1px 0 rgba(0,0,0,.03);
  }
  .hhd-mobile-qty-input:focus{
    outline:none;
    border-color:#2563eb;
    box-shadow:0 0 0 3px rgba(37,99,235,.15);
  }

  /* Remove button */
  .hhd-remove-item-inline{
    display:inline-block;
    padding:8px 10px;
    border:1px solid #ef4444;
    border-radius:8px;
    background:#fff;
    color:#b91c1c;
    font-size:.85rem;
    text-decoration:none;
    line-height:1;
  }

  /* Price (right aligned) */
 .hhd-mprice{
    font-weight:700;
    white-space:nowrap;
    color:#00205c;
    font-size:20px;
    justify-self:end;
  }

  /* Full-width availability band */
  .hhd-mavailability{
    grid-area: avail;
    width:100%;
    margin-top:4px;
    padding:10px 12px;
    background:#ebf3fb;
    border-radius:0px;
    color:#0a1f44;
    font-size:.95rem;
    display:flex;
    align-items:flex-start;
    gap:8px;
  }
 .hhd-mavailability::before{
  content:"";
  width:18px; height:18px; flex:0 0 18px;
  margin-top:2px;
  background-repeat:no-repeat;
  background-size:contain;
}

/* ✓ In stock (green tick) */
.hhd-mavailability:has(.stock-msg.in)::before{
  background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='%232e7d32' d='M9 16.2 4.9 12.1 3.5 13.5 9 19 20.3 7.7 18.9 6.3z'/></svg>");
}

/* ⏰ Waiting/Back-order/Collect from date (amber clock) 
   Your PHP uses class 'low' for messages like 'Order now, collect from ...' */
.hhd-mavailability:has(.stock-msg.low)::before{
  background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><circle cx='12' cy='12' r='9' fill='none' stroke='%23f59e0b' stroke-width='2'/><path d='M12 7v6l4 2' fill='none' stroke='%23f59e0b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>");
}
	
/* ✖ Out/Unavailable (red cross) */
.hhd-mavailability:has(.stock-msg.out)::before{
  background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M6 6l12 12M18 6l-12 12' stroke='%23b91c1c' stroke-width='2' stroke-linecap='round'/></svg>");
}
	
	.hhd-mavailability:has(.stock-msg.out) {
  color: #d00303; /* set text colour when out of stock/unavailable */
}

/* Optional: default icon if no class matched (keeps the clock) */
.hhd-mavailability:not(:has(.stock-msg.in)):not(:has(.stock-msg.low)):not(:has(.stock-msg.out))::before{
  background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><circle cx='12' cy='12' r='9' fill='none' stroke='%23a3a3a3' stroke-width='2'/><path d='M12 7v6l4 2' fill='none' stroke='%23a3a3a3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>");
}	

  /* Subtotal + checkout button */
  .hhd-mobile-subtotal {
    text-align: center;
    font-size: 18px;
    margin: .75rem 0;
    color: #00205c;
  }
  .hhd-mobile-subtotal strong { font-weight: 700; }

  .hhd-footer-button {
    display: block !important;
    width: 100% !important;
    padding: .75rem !important;
    background: #7AB800 !important;
    color: #fff !important;
    font-size: 1rem !important;
    border: none !important;
    border-radius: 2px !important;
    text-transform: uppercase !important;
    margin-bottom: 1.5rem !important;
  }
  .hhd-footer-button:disabled {
    opacity: .5 !important;
    pointer-events: none !important;
  }

  /* generic tooltip text (if used anywhere on mobile) */
  .hhd-tip { margin: 6px 0 8px; font-size: 14px; line-height: 1.4; }
}
