/* ======================== */
/* SHOP PAGE STYLES ONLY */
/* ======================== */
.woocommerce-page #secondary, 
.woocommerce #secondary {
    display: none !important;
}

.woocommerce-page #primary, 
.woocommerce #primary {
    width: 100% !important;
    float: none !important;
}

.woocommerce-page .site-content .col-full,
.woocommerce .site-content .col-full {
    max-width: none !important;
    padding-left:  0.5rem !important;
    padding-right: 0.5rem !important;
    margin: 0 auto !important;
    width: 98% !important;
}

.woocommerce-page ul.products.columns-4,
.woocommerce ul.products.columns-4 {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 1rem !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
    width: 100% !important;
}

.woocommerce-page ul.products.columns-4 li.product,
.woocommerce ul.products.columns-4 li.product {
    float: none !important;
    margin: 0 !important;
    width: 100% !important;
    padding: 0 !important;
    position: relative !important;
    box-sizing: border-box !important;
}

.woocommerce-page ul.products.columns-4 li.product .woocommerce-loop-product__link,
.woocommerce ul.products.columns-4 li.product .woocommerce-loop-product__link {
    display: block !important;
    width: 100% !important;
    height: auto !important;
}

.woocommerce-page ul.products.columns-4 li.product img,
.woocommerce-page ul.products.columns-4 li.product video,
.woocommerce ul.products.columns-4 li.product img,
.woocommerce ul.products.columns-4 li.product video {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    object-fit: cover !important;
    aspect-ratio: 2/3 !important;
}

.woocommerce-page .products:before,
.woocommerce-page .products:after,
.woocommerce .products:before,
.woocommerce .products:after {
    display: none !important;
}

/* ======================== */
/* SAFE PRODUCT PAGE FIXES */
/* ======================== */

/* Main layout structure */
.single-product .site-main {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 3rem;
    margin-top: 2rem;
}

/* Gallery container */
.single-product div.product .images {
    display: flex;
    flex-direction: row-reverse;
    gap: 1.5rem;
}

/* Main image container */
.single-product .woocommerce-product-gallery {
    width: calc(100% - 130px);
    order: 2;
}

/* Vertical thumbnails */
.single-product .flex-control-thumbs {
    display: flex !important;
    flex-direction: column;
    width: 110px;
    margin: 0;
    padding: 0;
    order: 1;
}

.single-product .flex-control-thumbs li {
    width: 100% !important;
    margin: 0 0 15px 0 !important;
    padding: 0 !important;
}

/* Product summary layout */
.single-product div.product .summary {
    order: 2;
    width: 100%;
    padding-left: 2rem;
}

/* Layout order */
.single-product .product_title {
    margin-top: 0;
}

.single-product .price {
    font-size: 1.5rem;
    margin: 1rem 0;
}

.single-product .woocommerce-product-details__short-description {
    margin: 1.5rem 0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .single-product .site-main {
        grid-template-columns: 1fr;
    }
    
    .single-product div.product .images {
        flex-direction: column-reverse;
    }
    
    .single-product .woocommerce-product-gallery {
        width: 100%;
    }
    
    .single-product .flex-control-thumbs {
        flex-direction: row;
        width: 100%;
        overflow-x: auto;
        padding-bottom: 15px;
    }
    
    .single-product .flex-control-thumbs li {
        width: 80px !important;
        margin: 0 10px 0 0 !important;
    }
    
    .single-product div.product .summary {
        padding-left: 0;
        margin-top: 2rem;
    }
}

/* ======================== */
/* Remove Built with Woocommerce From Footer */
/* ======================== */

.site-info a {
display: none;
}

/* ======================== */
/* MOBILE-SPECIFIC STYLES */
/* ======================== */

@media (max-width: 768px) {
    /* Shop page - 3 products per row */
    .woocommerce ul.products.columns-4,
    .woocommerce-page ul.products.columns-4 {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }
    
    /* Smaller product titles on mobile */
    .woocommerce-loop-product__title {
        font-size: 0.9rem !important;
        line-height: 1.3;
        margin: 0.5rem 0 0.25rem !important;
    }
    
    /* Smaller price font */
    .price {
        font-size: 1rem !important;
    }
    
    /* Product page - better mobile spacing */
    .single-product .product_title {
        font-size: 1.5rem !important;
    }
    
    .single-product .price {
        font-size: 1.25rem !important;
        margin: 0.75rem 0 !important;
    }
    
    .single-product .woocommerce-product-details__short-description {
        font-size: 0.95rem;
        line-height: 1.5;
        margin: 1rem 0 !important;
    }
    
    /* Gallery thumbnails - better mobile sizing */
    .single-product .flex-control-thumbs li {
        width: 70px !important;
        margin: 0 8px 0 0 !important;
    }
}

/* Extra small devices (phones < 480px) */
@media (max-width: 480px) {
    /* 2 products per row on very small screens */
    .woocommerce ul.products.columns-4,
    .woocommerce-page ul.products.columns-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
    
    /* Even smaller text */
    body {
        font-size: 14px;
    }
    
    /* Product page elements */
    .single-product .product_title {
        font-size: 1.3rem !important;
    }
    
    .single-product .price {
        font-size: 1.1rem !important;
    }
}

/* ── Desktop only: 4-row thumbnail grid matching main image height ── */
@media (min-width: 769px) {

  /* Make main image + thumbs the same height */
  .single-product div.product .images {
    display: flex;
    gap: 1rem;
    align-items: stretch;   /* both children (thumbs + gallery) fill same height */
  }

  /* Thumb column: a 4-row grid that fills 100% of parent height */
  .single-product .flex-control-thumbs {
    order: 1;
    display: grid;
    grid-template-rows: repeat(4, 1fr);  /* exactly 4 equally-sized “slots” */
    row-gap: 10px;                       /* match your desired gap */
    width: 120px;                        /* tweak width as you like */
    height: 100%;                        /* fill the full height of .images */
    overflow-y: auto;                    /* scroll if more than 4 thumbs */
    overflow-x: hidden;
    padding: 0;
    margin: 0;
  }

  /* Each li simply holds an img — no flex growth or shrinkage */
  .single-product .flex-control-thumbs li {
    margin: 0 !important;
    padding: 0 !important;
    list-style: none;
  }

  /* Img fills its grid cell perfectly at 2:3 ratio */
  .single-product .flex-control-thumbs img {
    display: block;
    width: auto;         /* let height drive the size */
    height: 100%;        /* fill its grid row */
    object-fit: cover;   
    aspect-ratio: 2/3;   /* lock to your image ratio */
    border: 1px solid #ddd;
  }

  /* Active thumbnail highlight */
  .single-product .flex-control-thumbs li.flex-active-slide img {
    border: 2px solid #000;
  }

  /* Main gallery just flexes out to fill the rest */
  .single-product .woocommerce-product-gallery {
    order: 2;
    flex: 1 1 auto;
  }
}

/* ====== DESKTOP: YOUR ORIGINAL STYLES ====== */
/* Cart text/icon styling */
#masthead .site-header-cart .cart-contents,
#masthead .site-header-cart .cart-contents .amount,
#masthead .site-header-cart .cart-contents .count {
  color: #ffffff !important;
  text-shadow: 0 3px 5px rgba(0,0,0,0.9) !important;
}

#masthead .site-header-cart .cart-contents svg {
  fill: #ffffff !important;
}

#masthead .col-full {
  background: none !important;
}

#site-navigation {
  background-color: rgba(0, 0, 0, 0.0) !important;
  padding: 12px 0;
}

#masthead .main-navigation a,
#masthead .site-header-cart .amount {
  color: #fff !important;
}

#masthead .site-header-cart .cart-contents .amount {
  display: none !important;
}

#masthead .site-header-cart .cart-contents .count {
  opacity: 1 !important;
  color: #ffffff !important;
  text-shadow: 0 3px 5px rgba(0,0,0,0.9) !important;
  font-family: inherit !important;
  font-size: 1rem !important;
  font-weight: 600 !important;
  line-height: 1.2 !important;
}

/* ====== MOBILE/TABLET OVERRIDES ====== */
@media (max-width: 1024px) {
  /* Nuclear reset for header background */
  #masthead.site-header,
  #masthead .col-full,
  #site-navigation,
  .storefront-handheld-navigation {
    background: #fff !important;
  }

  /* Force black text/icons */
  #masthead .main-navigation a,
  .storefront-handheld-navigation a,
  button.menu-toggle,
  .site-header-cart .cart-contents,
  .site-header-cart .count {
    color: #000 !important;
    text-shadow: none !important;
  }

  /* SVG icons - aggressive override */
  #masthead .site-header-cart svg,
  #masthead .site-header-cart svg path {
    fill: #000 !important;
    color: #000 !important;
  }

  /* Hide desktop nav */
  .main-navigation:not(.toggled) ul.menu {
    display: none !important;
  }

  /* Mobile menu border */
  .storefront-handheld-navigation {
    border-top: 1px solid #ddd !important;
  }

  /* Logo sizing */
  .site-branding img {
    max-width: 150px !important;
  }

  /* Remove desktop nav bar background */
  #site-navigation {
    background-color: transparent !important;
  }
}

@media (max-width: 767px) {
  .site-branding img {
    max-width: 120px !important;
  }
}

.site-info {
  /* make the footer info container flex and center its contents */
  display: flex !important;
  justify-content: center !important;
  text-align: center !important;


/* HDR Gallery Fixes */
.jxl-gallery {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    margin: 2rem 0;
}

.jxl-gallery a {
    display: block;
    overflow: hidden;
    border-radius: 8px;
    transition: transform 0.3s ease;
}

.jxl-gallery img {
    width: 100%;
    height: auto;
    aspect-ratio: 3/4;
    object-fit: cover;
    color-profile: rec2020;
    image-rendering: crisp-edges;
}

/* HDR Color Management */
@media (dynamic-range: high) {
    .jxl-gallery img {
        content-visibility: auto;
        contain: layout paint;
    }
    
    .pswp__img {
        color-profile: rec2020 !important;
        image-rendering: crisp-edges !important;
    }
}

/* PhotoSwipe HDR Badge */
.pswp__hdr-badge {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0,0,0,0.7);
    color: #fff;
    padding: 8px 12px;
    border-radius: 4px;
    font-weight: bold;
}

/* Fallback Message */
.no-jxl .jxl-gallery::before {
    content: "⚠️ Your browser doesn't support JPEG-XL HDR. Colors may appear muted.";
    display: block;
    padding: 1rem;
    background: #ffeb3b33;
    border: 2px solid #ffc107;
    margin-bottom: 2rem;
    text-align: center;
}