/* =============================================================
   ZAHRA ATELIER — Mini-Cart Styles
   Companion to: woocommerce/cart/mini-cart.php (Zahra edition)
   
   HOW TO USE:
   1. Copy mini-cart.php to: yourtheme/woocommerce/cart/mini-cart.php
   2. Paste this CSS into: Appearance → Customize → Additional CSS
      OR enqueue from your child theme's functions.php
   ============================================================= */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;1,300;1,400&family=Jost:wght@200;300;400;500&display=swap');

/* ================================================================
   DESIGN TOKENS
   ================================================================ */
.ct-cart-content {
  --za-ivory:       #F7F4EF;
  --za-ivory-deep:  #EDE9E2;
  --za-obsidian:    #1A1714;
  --za-muted:       #7A7268;
  --za-gold:        #B8955A;
  --za-gold-light:  #D4B483;
  --za-silk:        #C9BDB0;
  --za-charcoal:    #2E2B28;
  --za-serif:       'Cormorant Garamond', Georgia, serif;
  --za-sans:        'Jost', 'Helvetica Neue', sans-serif;
}

/* ================================================================
   PANEL SHELL
   ================================================================ */
.ct-cart-content {
  background: var(--za-ivory);
  font-family: var(--za-sans);
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
}

/* ================================================================
   HEADER STRIP  .za-mini-cart-header
   ================================================================ */
.ct-cart-content .za-mini-cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--za-charcoal);
  padding: 13px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.ct-cart-content .za-mini-cart-label {
  font-family: var(--za-sans);
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--za-gold);
}

.ct-cart-content .za-mini-cart-count {
  font-family: var(--za-sans);
  font-size: 9px;
  font-weight: 300;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.3);
}

/* ================================================================
   ITEM LIST  ul.woocommerce-mini-cart
   ================================================================ */
.ct-cart-content .woocommerce-mini-cart {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 380px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--za-silk) transparent;
}

.ct-cart-content .woocommerce-mini-cart::-webkit-scrollbar        { width: 3px; }
.ct-cart-content .woocommerce-mini-cart::-webkit-scrollbar-track  { background: transparent; }
.ct-cart-content .woocommerce-mini-cart::-webkit-scrollbar-thumb  { background: var(--za-silk); }

/* ================================================================
   EACH ITEM  li.za-cart-item
   Our PHP outputs a 3-column grid using our own za-cart-col divs
   — completely bypasses Blocksy's .product_list_widget li grid
   ================================================================ */
.ct-cart-content .za-cart-item {
  display: grid;
  grid-template-columns: 20px 80px 1fr;
  grid-template-rows: auto;
  column-gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--za-ivory-deep);
  align-items: start;
  background: var(--za-ivory);
  transition: background 0.2s ease;
  /* reset any Blocksy .product_list_widget li rules */
  margin-bottom: 0 !important;
}

.ct-cart-content .za-cart-item:last-child {
  border-bottom: none;
}

.ct-cart-content .za-cart-item:hover {
  background: rgba(237, 233, 226, 0.6);
}

/* ── Column 1: remove ── */
.ct-cart-content .za-cart-col--remove {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  align-items: flex-start;
  padding-top: 3px;
}

/* ── Column 2: image ── */
.ct-cart-content .za-cart-col--image {
  grid-column: 2;
  grid-row: 1;
}

/* ── Column 3: data ── */
.ct-cart-content .za-cart-col--data {
  grid-column: 3;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* ================================================================
   REMOVE BUTTON  .za-remove-btn
   ================================================================ */
.ct-cart-content .za-remove-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  background: transparent;
  border: 1px solid var(--za-ivory-deep);
  text-decoration: none;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s, border-color 0.2s;
}

.ct-cart-content .za-remove-btn:hover {
  background: var(--za-obsidian);
  border-color: var(--za-obsidian);
}

.ct-cart-content .za-remove-btn svg {
  display: block;
  width: 8px;
  height: 8px;
  fill: var(--za-silk);
  stroke: none;
  transition: fill 0.2s;
}

.ct-cart-content .za-remove-btn:hover svg {
  fill: var(--za-ivory);
}

/* ================================================================
   PRODUCT IMAGE  .za-cart-image-link
   ================================================================ */
.ct-cart-content .za-cart-image-link {
  display: block;
  text-decoration: none;
  width: 80px;
}

.ct-cart-content .za-cart-image-link img {
  display: block;
  width: 80px;
  height: 100px;
  object-fit: cover;
  object-position: center top;
  border: 1px solid var(--za-ivory-deep);
  transition: opacity 0.3s;
}

.ct-cart-content .za-cart-image-link:hover img {
  opacity: 0.82;
}

/* Blocksy .ct-media-container ratio override */
.ct-cart-content .za-cart-image-link .ct-media-container {
  width: 80px !important;
  height: 100px !important;
  padding-bottom: 0 !important;
  position: relative !important;
  overflow: hidden !important;
}

.ct-cart-content .za-cart-image-link .ct-media-container img {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center top !important;
}

/* ================================================================
   PRODUCT NAME  .za-cart-name
   ================================================================ */
.ct-cart-content .za-cart-name {
  display: block;
  font-family: var(--za-serif);
  font-size: 15px;
  font-weight: 400;
  color: var(--za-obsidian);
  letter-spacing: 0.01em;
  line-height: 1.35;
  text-decoration: none;
  margin-bottom: 7px;
}

.ct-cart-content .za-cart-name:hover {
  color: var(--za-gold);
}

/* ================================================================
   VARIATION META  .za-cart-meta
   wc_get_formatted_cart_item_data() outputs a <dl> inside here
   ================================================================ */
.ct-cart-content .za-cart-meta {
  margin-bottom: 7px;
}

.ct-cart-content .za-cart-meta dl.variation {
  display: flex;
  flex-wrap: wrap;
  gap: 0 4px;
  margin: 0;
  padding: 0;
}

.ct-cart-content .za-cart-meta dl.variation dt {
  display: inline !important;
  float: none !important;
  clear: none !important;
  font-family: var(--za-sans);
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--za-muted);
  margin: 0;
  padding: 0;
}

.ct-cart-content .za-cart-meta dl.variation dd {
  display: inline !important;
  font-family: var(--za-sans);
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--za-gold);
  margin: 0 0 0 2px;
  padding: 0;
}

.ct-cart-content .za-cart-meta dl.variation dd p {
  display: inline;
  margin: 0;
}

/* ================================================================
   QUANTITY × PRICE  .za-cart-qty
   ================================================================ */
.ct-cart-content .za-cart-qty {
  display: block;
  font-family: var(--za-serif);
  font-size: 15px;
  font-weight: 400;
  color: var(--za-charcoal);
  letter-spacing: 0.02em;
}

.ct-cart-content .za-cart-qty .woocommerce-Price-currencySymbol {
  font-family: var(--za-sans);
  font-size: 11px;
  font-weight: 300;
  color: var(--za-muted);
  vertical-align: baseline;
  margin-right: 1px;
}

/* ================================================================
   SUBTOTAL  .za-mini-cart-subtotal
   Our PHP wraps it — also style the WC hook output inside it
   ================================================================ */
.ct-cart-content .za-mini-cart-subtotal {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 15px 20px;
  background: var(--za-ivory-deep);
  border-top: 1px solid var(--za-silk);
  border-bottom: 1px solid var(--za-silk);
}

.ct-cart-content .za-subtotal-label {
  font-family: var(--za-sans);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--za-muted);
}

/* WC hook woocommerce_widget_shopping_cart_total outputs a <strong> + price */
.ct-cart-content .za-mini-cart-subtotal .woocommerce-mini-cart__total,
.ct-cart-content .za-mini-cart-subtotal p.total {
  display: contents; /* flatten so our flex layout controls it */
}

.ct-cart-content .za-mini-cart-subtotal strong {
  display: none; /* hide WC's own "Subtotal:" label — we have .za-subtotal-label */
}

.ct-cart-content .za-mini-cart-subtotal .woocommerce-Price-amount,
.ct-cart-content .za-subtotal-value .woocommerce-Price-amount {
  font-family: var(--za-serif);
  font-size: 22px;
  font-weight: 400;
  color: var(--za-gold);
  letter-spacing: 0.01em;
}

.ct-cart-content .za-mini-cart-subtotal .woocommerce-Price-currencySymbol,
.ct-cart-content .za-subtotal-value .woocommerce-Price-currencySymbol {
  font-family: var(--za-sans);
  font-size: 13px;
  font-weight: 300;
  color: var(--za-gold-light);
  vertical-align: baseline;
  margin-right: 2px;
}

/* ================================================================
   BUTTONS  .za-mini-cart-buttons
   WC hook woocommerce_widget_shopping_cart_buttons outputs:
   <a class="button wc-forward">View cart</a>
   <a class="button checkout wc-forward">Checkout</a>
   ================================================================ */
.ct-cart-content .za-mini-cart-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px 20px 22px;
  background: var(--za-ivory);
}

/* Shared base — aggressively reset Blocksy theme button vars */
.ct-cart-content .za-mini-cart-buttons .button,
.ct-cart-content .za-mini-cart-buttons a.button {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  width: 100% !important;
  height: 48px !important;
  min-height: 48px !important;
  font-family: var(--za-sans) !important;
  font-size: 9px !important;
  font-weight: 500 !important;
  letter-spacing: 0.28em !important;
  text-transform: uppercase !important;
  text-decoration: none !important;
  cursor: pointer !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  box-sizing: border-box !important;
  transition: background 0.3s, color 0.3s, border-color 0.3s !important;
  /* Zero out all Blocksy CSS variable overrides */
  --theme-button-border-radius: 0 !important;
  --theme-button-shadow: none !important;
  --theme-button-min-height: 48px !important;
  --theme-button-padding: 0 !important;
}

/* View Cart — ghost outline */
.ct-cart-content .za-mini-cart-buttons .wc-forward:not(.checkout) {
  background: transparent !important;
  border: 1px solid var(--za-obsidian) !important;
  color: var(--za-obsidian) !important;
  --theme-button-background-initial-color: transparent !important;
  --theme-button-text-initial-color: var(--za-obsidian) !important;
}

.ct-cart-content .za-mini-cart-buttons .wc-forward:not(.checkout):hover {
  background: var(--za-obsidian) !important;
  color: var(--za-ivory) !important;
}

/* Checkout — solid */
.ct-cart-content .za-mini-cart-buttons .checkout {
  background: var(--za-obsidian) !important;
  border: 1px solid var(--za-obsidian) !important;
  color: var(--za-ivory) !important;
  --theme-button-background-initial-color: var(--za-obsidian) !important;
  --theme-button-text-initial-color: var(--za-ivory) !important;
}

.ct-cart-content .za-mini-cart-buttons .checkout:hover {
  background: var(--za-gold) !important;
  border-color: var(--za-gold) !important;
  color: var(--za-ivory) !important;
}

/* Arrow icon inside checkout button */
.ct-cart-content .za-mini-cart-buttons .checkout::after {
  content: '';
  display: inline-block;
  width: 12px;
  height: 12px;
  background-color: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12h14M12 5l7 7-7 7' stroke='currentColor' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' fill='none'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12h14M12 5l7 7-7 7' stroke='currentColor' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' fill='none'/%3E%3C/svg%3E") center / contain no-repeat;
  flex-shrink: 0;
}

/* ================================================================
   EMPTY CART
   ================================================================ */
.ct-cart-content .cart-empty,
.ct-cart-content .woocommerce-mini-cart__empty-message {
  padding: 40px 20px;
  text-align: center;
  font-family: var(--za-serif);
  font-size: 18px;
  font-weight: 300;
  font-style: italic;
  color: var(--za-muted);
  letter-spacing: 0.02em;
}
