/**
 * ============================================================================
 *  SIDE POP-OUT CART (drawer)  — editable, no build step
 * ============================================================================
 *  Markup: inc/_side-cart.php   Behaviour: js/side-cart.js
 *  Styles the drawer + overlay and the WooCommerce mini-cart inside it.
 * ============================================================================
 */

/* Overlay behind the drawer */
.side-cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  transition: opacity .3s ease;
  z-index: 1040;
}
.side-cart-overlay.is-open { opacity: 1; }

/* The drawer */
.side-cart {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: 400px;
  max-width: 92vw;
  background: #fff;
  box-shadow: -6px 0 28px rgba(0, 0, 0, 0.16);
  transform: translateX(100%);
  transition: transform .3s ease;
  z-index: 1050;
  display: flex;
  flex-direction: column;

  /* Rounded on the two edges that are visible — the right edge sits flush
     against the side of the screen. `overflow: hidden` stops the header and
     footer panels squaring the corners off again. */
  border-radius: 10px 0 0 10px;
  overflow: hidden;
}
.side-cart.is-open { transform: translateX(0); }

/* Sit below the WP admin bar for logged-in users (no effect for visitors). */
body.admin-bar .side-cart { top: 32px; height: calc(100% - 32px); }
@media screen and (max-width: 782px) {
  body.admin-bar .side-cart { top: 46px; height: calc(100% - 46px); }
}

/* Lock the page behind the open drawer */
body.side-cart-open { overflow: hidden; }

/* Header */
.side-cart__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid #ececec;
  flex: 0 0 auto;
}
.side-cart__title { font-weight: 700; font-size: 18px; color: #202124; }
.side-cart__close {
  background: none;
  border: 0;
  padding: 4px 8px;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  color: #555;
  transition: color .15s ease;
}
.side-cart__close:hover { color: #000; }

/* Scrollable body */
.side-cart__body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 8px 22px 22px;
}

/* ---- WooCommerce mini-cart inside the drawer ---------------------------- */
.side-cart .woocommerce-mini-cart.cart_list,
.side-cart ul.product_list_widget {
  list-style: none;
  margin: 0;
  padding: 0;
}
/* Each line item: thumbnail pinned left, everything else stacked in a tidy
   column on the right, × top-right. WooCommerce nests the thumbnail + name in
   one <a>, so the thumbnail is positioned absolutely to break it out. */
.side-cart .woocommerce-mini-cart-item {
  position: relative;
  display: block;
  /* !important: WooCommerce's `ul.product_list_widget li` padding rule (loaded
     in bundle.min.css after this file) out-specifies a plain 2-class selector. */
  padding: 16px 26px 16px 76px !important;   /* left = 60px thumb + gap; right = room for × */
  min-height: 60px;
  margin: 0 !important;
  border-bottom: 1px solid #efefef;
}

/* Thumbnail — pinned to the left */
.side-cart .woocommerce-mini-cart-item > a:not(.remove) img {
  position: absolute;
  left: 0;
  top: 16px;
  width: 60px;
  height: 60px;
  object-fit: contain;
  margin: 0;
  padding: 4px;
  border: 1px solid #eee;
  border-radius: 8px;
  background: #fafafa;
}

/* Product name */
.side-cart .woocommerce-mini-cart-item > a:not(.remove) {
  display: block;
  font-weight: 700;
  font-size: 14px;
  line-height: 1.35;
  color: #202124;
  text-decoration: none;
}
.side-cart .woocommerce-mini-cart-item > a:not(.remove):hover { color: #02a0c5; }

/* Variation / custom-box details — compact, readable list */
.side-cart .woocommerce-mini-cart-item dl.variation,
.side-cart .woocommerce-mini-cart-item dd.variation-Productinfo {
  margin: 6px 0 0;
  padding: 0 0 0 10px;   /* 10px indent so the details sit off the thumbnail edge */
  font-size: 12px;
  line-height: 1.55;
  color: #5f6368;
}
.side-cart .woocommerce-mini-cart-item dl.variation dt,
.side-cart .woocommerce-mini-cart-item dl.variation dd {
  margin: 0;
  padding: 0;
  font-weight: 400;
}
.side-cart .woocommerce-mini-cart-item dl.variation dd p {
  margin: 0;
}
.side-cart .woocommerce-mini-cart-item dl.variation dd p:first-letter { text-transform: uppercase; }
/* Hide the redundant "Product info:" heading on the custom box line */
.side-cart .woocommerce-mini-cart-item dl.variation dt.variation-Productinfo { display: none; }

/* Quantity × price — a subtle pill on its own line */
.side-cart .woocommerce-mini-cart-item .quantity {
  display: inline-block;
  margin-top: 8px;
  padding: 3px 10px;
  background: #f3f3f3;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  color: #202124;
}

/* Remove (×) button — top-right */
.side-cart .woocommerce-mini-cart-item a.remove {
  position: absolute;
  top: 16px;
  right: 0;
  width: 22px;
  height: 22px;
  line-height: 20px;
  text-align: center;
  border-radius: 50%;
  background: #f2f2f2;
  color: #888 !important;
  font-size: 15px;
  text-decoration: none;
}
.side-cart .woocommerce-mini-cart-item a.remove:hover { background: #e0115f; color: #fff !important; }

/* Subtotal */
.side-cart .woocommerce-mini-cart__total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 18px 0;
  padding-top: 14px;
  font-size: 16px;
  border-top: 2px solid #f0f0f0;
}
.side-cart .woocommerce-mini-cart__total strong { font-weight: 700; }
.side-cart .woocommerce-mini-cart__total .amount { font-weight: 700; color: #02a0c5; }

/* Empty message */
.side-cart .woocommerce-mini-cart__empty-message {
  padding: 40px 0;
  text-align: center;
  color: #5f6368;
}

/* View basket / Checkout buttons */
.side-cart .woocommerce-mini-cart__buttons { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.side-cart .woocommerce-mini-cart__buttons .button {
  display: block;
  width: 100%;
  text-align: center;
  padding: 13px 16px;
  border-radius: 6px;
  font-weight: 700;
  text-decoration: none;
  transition: opacity .15s ease, background .15s ease;
}
/* View basket = outline */
.side-cart .woocommerce-mini-cart__buttons .button:not(.checkout) {
  background: #fff;
  color: #02a0c5;
  border: 2px solid #02a0c5;
}
.side-cart .woocommerce-mini-cart__buttons .button:not(.checkout):hover { background: #f2fbfd; }
/* Checkout = solid brand blue */
.side-cart .woocommerce-mini-cart__buttons .button.checkout {
  background: #02a0c5;
  color: #fff;
  border: 2px solid #02a0c5;
}
.side-cart .woocommerce-mini-cart__buttons .button.checkout:hover { opacity: .9; }
