/*
Theme Name: Storefront Child
Theme URI: https://foliagewonder.com/wp-content/themes/storefront-child/
Description: Foliage Wonder custom theme (child of Storefront).
Author: Alex Fraser
Author URI: https://foliagewonder.com
Template: storefront
Version: 1.0.0
*/

/* ---------------- Split Header ---------------- */

.split-header.container{
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;   /* push left/right to edges */
  min-height: 88px;                 /* tweak to your logo height */
  gap: 16px;
  width: 100%;
}

/* Edge groups (left & right) must NOT shrink or the cart will wrap */
.split-edge{
  display: flex;
  align-items: center;
  gap: 22px;
  flex: 0 0 auto;                   /* <— key: prevent shrinking */
}
.split-left  { justify-content: flex-start; }
.split-right { justify-content: flex-end;  }

/* Centered branding stays exactly centered regardless of edge widths */
.split-center{
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  z-index: 2;
}
.split-center .custom-logo{ height: 64px; width: auto; } /* adjust to taste */
.split-center .site-title{
  font-weight: 700;
  text-decoration: none;
  font-size: clamp(18px, 2.2vw, 24px);
  line-height: 1.1;
}

/* Menus */
.split-nav .menu{
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 24px;
}
.split-nav .menu > li{ margin: 0; padding: 0; }
.split-nav a{
  text-decoration: none;
  display: inline-block;
  line-height: 1.2;
}

/* ---------------- Live Cart (Storefront) ---------------- */

.split-cart{
  display: flex;
  align-items: center;
}

/* Neutralize Storefront defaults so the cart sits inline and never wraps */
.split-cart .site-header-cart{ margin: 0; }
.split-cart .site-header-cart .cart-contents{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;              /* keep "$29.95 1 item" on one line */
  padding: 6px 10px;
}
.site-header-cart .cart-contents:after{ display: none; } /* hide tiny caret */

/* Mini-cart dropdown: align to right edge and set sensible width */
.site-header-cart .widget_shopping_cart{
  left: auto;
  right: 0;
  width: 320px;
  max-width: min(90vw, 420px);
}

/* Optional (uncomment to show icon-only cart)
.site-header-cart .cart-contents .amount,
.site-header-cart .cart-contents .count { display: none !important; }
*/

/* ---------------- Small screens ---------------- */

@media (max-width: 768px){
  .split-nav{ display: none; }              /* use Storefront handheld nav */
  .split-center .custom-logo{ height: 44px; }
  .split-header.container{ min-height: 70px; }
}

/* ---------------- Tiny polish ---------------- */

/* Prevent the header container from adding odd extra spacing */
.site-header .col-full{
  padding-top: 0;
  padding-bottom: 0;
}

/* Reduce default Storefront spacing below header if needed */
.site-header{
  margin-bottom: 0;
}

/* Ensure the cart is the positioning context for the dropdown */
.split-cart .site-header-cart{
  margin: 0;
  position: relative;      /* key */
  z-index: 50;             /* sit above header line */
}

/* Mini-cart dropdown: hidden by default, absolutely positioned */
.site-header-cart .widget_shopping_cart{
  position: absolute;
  top: calc(100% + 8px);    /* below the cart link */
  right: 0;
  left: auto;
  width: 320px;
  max-width: min(90vw, 420px);

  display: none;            /* hidden by default */
  opacity: 0;
  pointer-events: none;     /* no stray clicks when hidden */
  transform: translateY(6px);
  transition: opacity .15s ease, transform .15s ease;
}

/* Show on hover/focus (keyboard friendly) */
.site-header-cart:hover .widget_shopping_cart,
.site-header-cart:focus-within .widget_shopping_cart{
  display: block;
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

/* Keep the cart link tidy on one line */
.split-cart .site-header-cart .cart-contents{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  padding: 6px 10px;
}

/* Cart icon (SVG) – robust across Storefront versions */
.split-cart .site-header-cart .cart-contents{
  position: relative;           /* anchor for the icon */
}

/* add a cart glyph before the text */
.split-cart .site-header-cart .cart-contents::after{
  content: "";
  display: inline-block;
  width: 18px;
  height: 18px;
  margin-right: 8px;
  background: currentColor;

  /* mask = vector icon (works in all modern browsers) */
  -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="%23000" d="M7 18a2 2 0 1 0 0 4 2 2 0 0 0 0-4zm10 0a2 2 0 1 0 .001 4.001A2 2 0 0 0 17 18zM3 3h1.8l1.2 2.4L8 11.2a2 2 0 0 0 1.9 1.3h7.9a2 2 0 0 0 1.9-1.4l2-6.1A1 1 0 0 0 21 4H6.5L5.7 2.4A2 2 0 0 0 3.9 1.5H3a1 1 0 1 0 0 2z"/></svg>') no-repeat center / contain;
          mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="%23000" d="M7 18a2 2 0 1 0 0 4 2 2 0 0 0 0-4zm10 0a2 2 0 1 0 .001 4.001A2 2 0 0 0 17 18zM3 3h1.8l1.2 2.4L8 11.2a2 2 0 0 0 1.9 1.3h7.9a2 2 0 0 0 1.9-1.4l2-6.1A1 1 0 0 0 21 4H6.5L5.7 2.4A2 2 0 0 0 3.9 1.5H3a1 1 0 1 0 0 2z"/></svg>') no-repeat center / contain;
}

/* (Optional) if you only want the icon and no text/amounts, uncomment: */
/*
.site-header-cart .cart-contents .amount,
.site-header-cart .cart-contents .count { display: none !important; }

/* Full-width homepage banner */
.home .home-hero{
  width: 100%;
  min-height: clamp(220px, 28vw, 460px);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: block;
  position: relative;
  z-index: 1;
  border-bottom: 1px solid rgba(0,0,0,.06);
}

/* Remove extra spacing below header if needed */
.site-header{ margin-bottom: 0; }