/**
 * ÉTHÉRÉ — Side cart (slide-in drawer) styling.
 * Uses :root variables from ethere-shop-brand.css
 */

/* ==========================================================================
   Overlay
   ========================================================================== */

.ethere-side-cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 99998;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.3s ease,
    visibility 0.3s ease;
}

.ethere-side-cart-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

/* ==========================================================================
   Drawer panel
   ========================================================================== */

.ethere-side-cart {
  position: fixed;
  top: 0;
  right: 0;
  width: 400px;
  max-width: 90vw;
  height: 100%;
  z-index: 99999;
  background: var(--ethere-white, #fff);
  box-shadow: -8px 0 40px rgba(0, 0, 0, 0.12);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.ethere-side-cart.is-open {
  transform: translateX(0);
}

/* ==========================================================================
   Header
   ========================================================================== */

.ethere-side-cart__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--ethere-border, #e8e8e8);
  flex-shrink: 0;
}

.ethere-side-cart__title {
  font-family: var(--ethere-font-heading);
  font-weight: 400;
  font-size: 1.15rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ethere-text, #1a1a1a);
  margin: 0;
}

.ethere-side-cart__close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s;
}

.ethere-side-cart__close:hover {
  background: var(--ethere-green-soft, rgba(148, 197, 115, 0.12));
}

.ethere-side-cart__close svg {
  width: 22px;
  height: 22px;
  stroke: var(--ethere-text-muted, #5c5c5c);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
}

/* ==========================================================================
   Body (WooCommerce mini-cart)
   ========================================================================== */

.ethere-side-cart__body {
  flex: 1;
  overflow-y: auto;
  padding: 0;
  display: flex;
  flex-direction: column;
}

/* Cart items list */
.ethere-side-cart__body .woocommerce-mini-cart {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1;
  overflow-y: auto;
}

.ethere-side-cart__body .woocommerce-mini-cart .mini_cart_item {
  display: grid;
  grid-template-columns: 56px 1fr;
  column-gap: 0.85rem;
  row-gap: 0.2rem;
  padding: 1rem 2.5rem 1rem 1.5rem;
  border-bottom: 1px solid var(--ethere-border, #e8e8e8);
  position: relative;
  font-family: var(--ethere-font-body);
  font-size: 0.88rem;
  color: var(--ethere-text, #1a1a1a);
}

.ethere-side-cart__body .woocommerce-mini-cart .mini_cart_item:last-child {
  border-bottom: none;
}

/* Flatten the product link so the <img> and product-name text node
   become direct grid children (otherwise the image is trapped inline
   inside the <a> and the rest of the layout falls apart). */
.ethere-side-cart__body .mini_cart_item > a:not(.remove) {
  display: contents;
  color: var(--ethere-text, #1a1a1a);
  text-decoration: none;
  font-family: var(--ethere-font-heading);
  font-size: 0.85rem;
  font-weight: 400;
  line-height: 1.35;
}

.ethere-side-cart__body .mini_cart_item > a:not(.remove):hover {
  color: var(--ethere-green-dark, #7aad5a);
}

/* Product thumbnail — left column, spans all rows of the item */
.ethere-side-cart__body .mini_cart_item img,
.ethere-side-cart__body .mini_cart_item > a:not(.remove) > img {
  grid-column: 1;
  grid-row: 1 / span 10;
  align-self: start;
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--ethere-border, #e8e8e8);
}

/* Variation list (Diamond Carat, US Size, etc. on variable products) */
.ethere-side-cart__body .mini_cart_item .variation {
  grid-column: 2;
  margin: 0.1rem 0 0;
  padding: 0;
  font-family: var(--ethere-font-body);
  font-size: 0.74rem;
  color: var(--ethere-text-muted, #5c5c5c);
  line-height: 1.45;
  display: flex;
  flex-wrap: wrap;
  gap: 0 0.65rem;
  list-style: none;
}

.ethere-side-cart__body .mini_cart_item .variation dt,
.ethere-side-cart__body .mini_cart_item .variation dd {
  margin: 0;
  padding: 0;
  display: inline;
  font-weight: 400;
}

.ethere-side-cart__body .mini_cart_item .variation dt {
  color: var(--ethere-text-muted, #5c5c5c);
}

.ethere-side-cart__body .mini_cart_item .variation dt::after {
  content: ":\00a0";
}

.ethere-side-cart__body .mini_cart_item .variation dd {
  color: var(--ethere-text, #1a1a1a);
  margin-right: 0.35rem;
}

.ethere-side-cart__body .mini_cart_item .variation dd p,
.ethere-side-cart__body .mini_cart_item .variation dd > * {
  margin: 0;
  display: inline;
}

/* Quantity + price */
.ethere-side-cart__body .mini_cart_item .quantity {
  grid-column: 2;
  font-family: var(--ethere-font-body);
  font-size: 0.82rem;
  color: var(--ethere-text-muted, #5c5c5c);
}

/* Remove button */
.ethere-side-cart__body .mini_cart_item .remove,
.ethere-side-cart__body .mini_cart_item .remove_from_cart_button {
  position: absolute;
  top: 0.85rem;
  right: 1rem;
  font-size: 1.2rem;
  color: var(--ethere-text-muted, #5c5c5c) !important;
  text-decoration: none;
  line-height: 1;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition:
    background 0.2s,
    color 0.2s;
}

.ethere-side-cart__body .mini_cart_item .remove:hover,
.ethere-side-cart__body .mini_cart_item .remove_from_cart_button:hover {
  background: rgba(204, 51, 51, 0.08);
  color: #c33 !important;
}

/* ==========================================================================
   Footer (totals + buttons)
   ========================================================================== */

.ethere-side-cart__body .woocommerce-mini-cart__total {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--ethere-border, #e8e8e8);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--ethere-font-body);
  font-size: 0.9rem;
  flex-shrink: 0;
}

.ethere-side-cart__body .woocommerce-mini-cart__total strong {
  font-family: var(--ethere-font-heading);
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.78rem;
}

.ethere-side-cart__body
  .woocommerce-mini-cart__total
  .woocommerce-Price-amount {
  font-family: var(--ethere-font-heading);
  font-size: 1.1rem;
  color: var(--ethere-green-dark, #7aad5a);
}

/* Buttons container */
.ethere-side-cart__body .woocommerce-mini-cart__buttons {
  padding: 0.75rem 1.5rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* View Cart button */
.ethere-side-cart__body .woocommerce-mini-cart__buttons .button:not(.checkout) {
  display: block;
  width: 100%;
  text-align: center;
  box-sizing: border-box;
  background: transparent !important;
  color: var(--ethere-text, #1a1a1a) !important;
  border: 1px solid var(--ethere-text, #1a1a1a) !important;
  border-radius: 0 !important;
  font-family: var(--ethere-font-body) !important;
  font-size: 0.72rem !important;
  letter-spacing: 0.12em !important;
  text-transform: uppercase !important;
  padding: 0.75rem 1rem !important;
  text-decoration: none;
  transition:
    background 0.2s,
    color 0.2s,
    border-color 0.2s;
}

.ethere-side-cart__body
  .woocommerce-mini-cart__buttons
  .button:not(.checkout):hover {
  background: var(--ethere-green, #94c573) !important;
  border-color: var(--ethere-green, #94c573) !important;
  color: var(--ethere-white, #fff) !important;
}

/* Checkout button */
.ethere-side-cart__body .woocommerce-mini-cart__buttons .button.checkout {
  display: block;
  width: 100%;
  text-align: center;
  box-sizing: border-box;
  background: var(--ethere-green, #94c573) !important;
  color: var(--ethere-white, #fff) !important;
  border: 1px solid var(--ethere-green, #94c573) !important;
  border-radius: 0 !important;
  font-family: var(--ethere-font-body) !important;
  font-size: 0.72rem !important;
  letter-spacing: 0.12em !important;
  text-transform: uppercase !important;
  padding: 0.75rem 1rem !important;
  text-decoration: none;
  transition:
    background 0.2s,
    border-color 0.2s;
}

.ethere-side-cart__body .woocommerce-mini-cart__buttons .button.checkout:hover {
  background: var(--ethere-green-dark, #7aad5a) !important;
  border-color: var(--ethere-green-dark, #7aad5a) !important;
}

/* ==========================================================================
   Empty cart
   ========================================================================== */

.ethere-side-cart__body .woocommerce-mini-cart__empty-message {
  text-align: center;
  padding: 3rem 1.5rem;
  font-family: var(--ethere-font-heading);
  font-size: 1rem;
  color: var(--ethere-text-muted, #5c5c5c);
  letter-spacing: 0.04em;
}

/* ==========================================================================
   [ethere_header_icons] shortcode — search + cart + account
   ========================================================================== */

.ethere-header-icons {
  display: inline-flex;
  align-items: center;
  gap: 20px;
  line-height: 1;
  vertical-align: middle;
}

.ethere-hi__icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  text-decoration: none;
  color: inherit;
  border: none;
  background: none;
  outline: none;
}

.ethere-hi__icon svg {
  width: 22px;
  height: 22px;
  color: var(--ethere-green, #94c573);
  transition: color 0.2s;
  display: block;
}

.ethere-hi__icon:hover svg {
  color: var(--ethere-green-dark, #7aad5a);
}

/* Cart badge */
.ethere-cart-badge {
  position: absolute;
  top: -6px;
  right: -8px;
  min-width: 16px;
  height: 16px;
  line-height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--ethere-green, #94c573);
  color: var(--ethere-white, #fff);
  font-family: var(--ethere-font-body);
  font-size: 9px;
  font-weight: 700;
  text-align: center;
  pointer-events: none;
  display: none;
  box-sizing: border-box;
}

.ethere-cart-badge.has-items {
  display: block;
}

/* ==========================================================================
   Search overlay — slides down from header
   ========================================================================== */

.ethere-search-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 99997;
  background: var(--ethere-white, #fff);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  padding: 0;
  transform: translateY(-100%);
  opacity: 0;
  visibility: hidden;
  transition:
    transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.3s ease,
    visibility 0.3s ease;
}

.ethere-search-overlay.is-open {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
}

.ethere-search-overlay__form {
  display: flex;
  align-items: center;
  max-width: 720px;
  margin: 0 auto;
  padding: 1.25rem 1.5rem;
  gap: 12px;
}

.ethere-search-overlay__input {
  flex: 1;
  border: none;
  border-bottom: 2px solid var(--ethere-border, #e8e8e8);
  background: transparent;
  font-family: var(--ethere-font-body);
  font-size: 1rem;
  padding: 0.6rem 0.25rem;
  color: var(--ethere-text, #1a1a1a);
  outline: none;
  transition: border-color 0.2s;
}

.ethere-search-overlay__input:focus {
  border-bottom-color: var(--ethere-green, #94c573);
}

.ethere-search-overlay__input::placeholder {
  color: var(--ethere-text-muted, #5c5c5c);
  font-style: italic;
  opacity: 0.7;
}

.ethere-search-overlay__submit,
.ethere-search-overlay__close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s;
}

.ethere-search-overlay__submit:hover,
.ethere-search-overlay__close:hover {
  background: var(--ethere-green-soft, rgba(148, 197, 115, 0.12));
}

.ethere-search-overlay__submit svg,
.ethere-search-overlay__close svg {
  width: 20px;
  height: 20px;
  color: var(--ethere-text-muted, #5c5c5c);
  display: block;
}

.ethere-search-overlay__submit svg {
  color: var(--ethere-green, #94c573);
}

/* ==========================================================================
   Prevent body scroll when drawer is open
   ========================================================================== */

body.ethere-side-cart-open {
  overflow: hidden;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 480px) {
  .ethere-side-cart {
    width: 100vw;
    max-width: 100vw;
  }
}
