/*
 Theme Name:   GeneratePress Child
 Theme URI:    https://generatepress.com
 Description:  Default GeneratePress child theme
 Author:       Tom Usborne
 Author URI:   https://tomusborne.com
 Template:     generatepress
 Version:      0.5 (Consolidated)
*/

.added_to_cart{ display: none!important; }

/* ==========================================================================
   1. GLOBAL & UTILITIES
   ========================================================================== */

:root {
    --gp-slideout-width: 355px;
}

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Fix horizontal scrollbar from full-bleed vw breakouts (.full-width, .margin-full-width,
   .banner-base, .mega-menu-1). 100vw includes the vertical scrollbar width, so calc(-50vw + 50%)
   sections overflow ~15px. overflow-x:clip (NOT hidden) clips it without creating a scroll
   container, so the sticky header (.gb-is-sticky) keeps working. Added 2026-06-30. */
body {
    overflow-x: clip;
}

h1, h2, h3, h4, h5 {
    text-wrap: balance;
}

.has-text-align-center {
    text-align: center;
}

del {
    color: #fd3c0bc2;
    font-size: 20px !important;
    transform: rotate(-3deg);
    display: inline-block;
}

/* ==========================================================================
   2. FORM ELEMENTS
   ========================================================================== */

/* Shared Input Styles */
input[type=email], input[type=number], input[type=password], 
input[type=search], input[type=tel], input[type=text], 
input[type=url], select, textarea {
    border-radius: 5px;
    width: 100%;
    width: -webkit-fill-available;
    width: -moz-available;
    border: 1px solid var(--border-color);
    background-color: white;
    font-size: 16px; /* 16px prevents iOS zoom */
    padding: 10px 15px;
}

input::placeholder, textarea::placeholder {
    font-size: 13px;
    line-height: 1.5;
}

select {
    font-weight: 500;
    padding: 10px 40px 10px 12px;
    color: inherit;
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
}

/* Shared Focus State */
textarea:focus, input:focus, select:focus,
.uneditable-input:focus {
    border-color: var(--contrast-2);
    box-shadow: 5px 5px 20px 0px var(--border-color);
    transition: all 0.3s ease-out;
    outline: none;
}

textarea:focus,
input[type=text]:focus, input[type=email]:focus, input[type=number]:focus,
input[type=password]:focus, input[type=search]:focus, input[type=tel]:focus,
input[type=url]:focus, select:focus,
.uneditable-input:focus {
    border-color: var(--contrast-2);
    box-shadow: 5px 5px 20px 0px var(--border-color);
    transition: all 0.3s ease-out;
    outline: none;
}

/* Custom Checkbox & Radio Styling */
@supports(-webkit-appearance: none) or (-moz-appearance: none) {
    input[type='checkbox'],
    input[type='radio'] {
        --active: #43d143;
        --active-inner: #fff;
        --focus: 2px #43d14352;
        --border: rgba(29,29,29,0.15);
        --border-hover: #43d143;
        --background: #fff;
        --disabled: #F6F8FF;
        --disabled-inner: #E1E6F9;
        -webkit-appearance: none;
        -moz-appearance: none;
        height: 21px !important;
        outline: none;
        display: inline-block;
        vertical-align: top;
        position: relative;
        margin: 0;
        cursor: pointer;
        border: 1px solid var(--bc, var(--border));
        background: var(--b, var(--background));
        transition: background .3s, border-color .3s, box-shadow .2s;
    }
    input[type='checkbox']:after,
    input[type='radio']:after {
        content: '';
        display: block;
        left: 0;
        top: 0;
        position: absolute;
        transition: transform var(--d-t, .3s) var(--d-t-e, ease), opacity var(--d-o, .2s);
    }
    input[type='checkbox']:checked,
    input[type='radio']:checked {
        --b: var(--active);
        --bc: var(--active);
        --d-o: .3s;
        --d-t: .6s;
        --d-t-e: cubic-bezier(.2, .85, .32, 1.2);
    }
    input[type='checkbox']:disabled,
    input[type='radio']:disabled {
        --b: var(--disabled);
        cursor: not-allowed;
        opacity: .9;
    }
    input[type='checkbox']:disabled:checked,
    input[type='radio']:disabled:checked {
        --b: var(--disabled-inner);
        --bc: var(--border);
    }
    input[type='checkbox']:disabled + label,
    input[type='radio']:disabled + label {
        cursor: not-allowed;
    }
    input[type='checkbox']:hover:not(:checked):not(:disabled),
    input[type='radio']:hover:not(:checked):not(:disabled) {
        --bc: var(--border-hover);
    }
    input[type='checkbox']:focus,
    input[type='radio']:focus {
        box-shadow: 0 0 0 var(--focus);
    }
    input[type='checkbox']:not(.switch),
    input[type='radio']:not(.switch) {
        width: 21px !important;
    }
    input[type='checkbox']:not(.switch):after,
    input[type='radio']:not(.switch):after {
        opacity: var(--o, 0);
    }
    input[type='checkbox']:not(.switch):checked,
    input[type='radio']:not(.switch):checked {
        --o: 1;
    }
    input[type='checkbox'] + label,
    input[type='radio'] + label {
        font-size: 14px;
        line-height: 21px;
        display: inline-block;
        vertical-align: top;
        cursor: pointer;
        margin-left: 4px;
    }
    /* Checkbox Specifics */
    input[type='checkbox']:not(.switch) {
        border-radius: 7px;
    }
    input[type='checkbox']:not(.switch):after {
        width: 5px;
        height: 9px;
        border: 2px solid var(--active-inner);
        border-top: 0;
        border-left: 0;
        left: 7px;
        top: 4px;
        transform: rotate(var(--r, 20deg));
    }
    input[type='checkbox']:not(.switch):checked {
        --r: 43deg;
    }
    input[type='checkbox'].switch {
        width: 38px;
        border-radius: 11px;
    }
    input[type='checkbox'].switch:after {
        left: 2px;
        top: 2px;
        border-radius: 50%;
        width: 15px;
        height: 15px;
        background: var(--ab, var(--border));
        transform: translateX(var(--x, 0));
    }
    input[type='checkbox'].switch:checked {
        --ab: var(--active-inner);
        --x: 17px;
    }
    input[type='checkbox'].switch:disabled:not(:checked):after {
        opacity: .6;
    }
    /* Radio Specifics */
    input[type='radio'] {
        border-radius: 50%;
    }
    input[type='radio']:after {
        width: 19px;
        height: 19px;
        border-radius: 50%;
        background: var(--active-inner);
        opacity: 0;
        transform: scale(var(--s, .7));
    }
    input[type='radio']:checked {
        --s: .5;
    }
}

/* ==========================================================================
   3. THEME BUTTONS (Consolidated)
   ========================================================================== */

/* Grouped: Product Cart Button, My Account Button, Side Cart (Xootix) Buttons 
   All share the "Pill" shape and hover effects.
*/
.woocommerce-MyAccount-content a.button {
    border-radius: 30px;
    border: 1px solid #292f44; /* Fallback if var missing */
    display: inline-flex;
    justify-content: center;
    font-weight: 500;
    transition: all 0.1s linear;
background: var(--contrast-2);
}

/* Specific Widths/Padding for above buttons */
.woocommerce-MyAccount-content a.button { background-color: var(--base-3); }

/* Hover States for all buttons */
.woocommerce-MyAccount-content a.button:hover {
    background-color: var(--accent-2) !important;
    border-color: var(--accent-2) !important;
    color: #fff;
}

/* My Account Hover Specific Override */
.woocommerce-MyAccount-content a.button:hover {
    background-color: var(--contrast-2) !important;
    border-color: var(--contrast-2) !important;
    color: var(--base-3);
}

.woocommerce:where(body:not(.woocommerce-block-theme-has-button-styles)) button.button.disabled {
    cursor: not-allowed;
    opacity: .5;
}

/* ==========================================================================
   4. WOOCOMMERCE CORE
   ========================================================================== */

.woocommerce-no-products-found,
.wc-block-components-product-metadata__description {
    display: none;
}

div.wc-block-components-notice-banner .is-info {
    display: inline-flex;
}

/* Product Meta & Loops */
.wc-item-meta { font-size: 14px; }

/* Prices */
del span.woocommerce-Price-amount { font-size: 1.3rem !important; }

/* ==========================================================================
   7. THIRD PARTY UTILITIES
   ========================================================================== */

/* FiboSearch */
.dgwt-wcas-style-pirx .dgwt-wcas-sf-wrapp { background: unset; }

.woocommerce-breadcrumb {
    margin: 1em 0 0.3em;
    font-size: clamp(0.6875rem, 0.62908rem + 0.246vw, 0.875rem);
}

/* ==========================================================================
   8. CUSTOM UI & ANIMATIONS
   ========================================================================== */

/* Consolidated Text Animations:
   Grouped shared properties for Header, Menu, and Standard links.
*/
.text-animation--underline-thin a,
.text-animation--underline a,
.text-animation--header a,
.text-animation--menu > a {
    background-image: linear-gradient(to right, var(--contrast), var(--contrast));
    background-repeat: no-repeat;
    display: inline;
    padding-bottom: 3px;
    transition: all 100ms linear;
    background-position: left calc(1em + 3px);
}

/* Specific Overrides (Padding/Display) */
.text-animation--header a,
.text-animation--menu > a {
    padding: 0px !important;
    display: inline !important;
}

/* Specific Sizes */
.text-animation--underline-thin a,
.text-animation--menu > a { background-size: 0% 1px; }

.text-animation--underline a,
.text-animation--header a { background-size: 0% 1.5px; }

/* Hover States (Grouped by Target Size) */
.text-animation--underline-thin a:hover,
.text-animation--menu a:hover,
.no-touchevents a:hover .text-animation--thin, 
.no-touchevents button:hover .text-animation--thin,
.no-touchevents a:hover .text-animation--menu {
    background-size: 100% 1px;
}

.text-animation--underline a:hover,
.text-animation--header a:hover,
.no-touchevents a:hover .text-animation--underline, 
.no-touchevents button:hover .text-animation--underline,
.no-touchevents a:hover .text-animation--header, 
.no-touchevents button:hover .text-animation--header {
    background-size: 100% 1.5px;
}

/* Animation RTL/LTR Logic */
html[dir=rtl] .text-animation--underline-thin,
html[dir=rtl] .text-animation--underline,
html[dir=rtl] .text-animation--header,
html[dir=rtl] .text-animation--menu {
    background-position: right calc(1em + 2px);
}
html[dir=ltr] .text-animation--underline-thin,
html[dir=ltr] .text-animation--underline,
html[dir=ltr] .text-animation--header,
html[dir=ltr] .text-animation--menu {
    background-position: left calc(1em + 2px);
}

/* Tooltips */
.tooltip { position: relative; z-index: 10; }
.tooltip:before,
.tooltip:after {
    --scale: 0;
    --arrow-size: 10px;
    --tooltip-color: #ffffff;
    --tooltip-text-color: #222222;
    position: absolute;
    top: 0.05rem;
    left: 30%;
    transform: translateX(-40%) translateY(var(--translate-y, 0)) scale(var(--scale));
    transition: 150ms transform;
    transform-origin: top center;
}
.tooltip:before {
    --translate-y: calc(36% - var(--arrow-size));
    content: attr(data-tooltip);
    color: var(--tooltip-text-color);
    font-size: 12px;
    line-height: 1.4;
    padding: 12px;
    font-weight: 400;
    width: 250px;
    background: var(--tooltip-color);
    border: 1px solid rgba(34,34,34,.15);
    border-radius: 12px;
    transition: opacity 300ms cubic-bezier(0.175, 0.745, 0.425, 1.11), transform 300ms cubic-bezier(0.175, 0.745, 0.425, 1.11), visibility 300ms cubic-bezier(0.175, 0.745, 0.425, 1.11);
    box-shadow: 0 4px 20px rgba(34,34,34,.15);
}
.tooltip:hover:before,
.tooltip:hover:after { --scale: 1; }
.tooltip:after {
    --translate-y: calc(-3.2 * var(--arrow-size));
    content: '';
    border: var(--arrow-size) solid transparent;
    border-top-color: #fff;
    transform-origin: top center;
    rotate: 180deg;
}

/* Header Background Fade */
.header-background { position: relative; isolation: isolate; }
.header-background::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image: radial-gradient(rgba(0, 0, 0, 0) 1px, rgb(30 41 59 / 6%) 1px);
    background-size: 4px 4px;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    pointer-events: none;
}
.header-background.gb-is-sticky::before { opacity: 1; }

/* iOS Safari: page content shows in the strip under the status bar / Dynamic Island above the sticky
   header. NOTE: body has overflow rules (overflow-x:clip / overflow:hidden), so anything painted above
   the header's own box gets CLIPPED — a header ::after cannot work. Instead: a position:FIXED cover
   (fixed escapes ancestor overflow clipping) pinned to the very top of the screen, BEHIND the header
   (z-index 998 < header 999), with the SAME frost recipe + a soft white base so scrolling content is
   never clearly visible there. Toggled via :has() only while the header is sticky. Mobile only.
   No header position change. (PYW 2026-07-02; removed + RESTORED 2026-07-12 — it was wrongly blamed
   for a white right-edge strip whose real cause was the design-thumbs strip overflowing the grid.) */
@media (max-width: 768px) {
    html:has(.header-background.gb-is-sticky)::before {
        content: "";
        position: fixed;
        top: -80px;              /* extend above the viewport into the iOS underlap zone */
        left: 0;
        right: 0;
        height: 150px;           /* ...and ~70px down into the viewport, behind the header top */
        z-index: 998;
        pointer-events: none;
        background-color: rgba(255, 255, 255, 0.72);
        background-image: radial-gradient(rgba(0, 0, 0, 0) 1px, rgb(30 41 59 / 6%) 1px);
        background-size: 4px 4px;
        backdrop-filter: blur(5px);
        -webkit-backdrop-filter: blur(5px);
    }
}

@media screen and (max-width: 480px) {
    .wc-block-mini-cart__footer .wc-block-mini-cart__footer-actions {
        flex-direction: row;
    }
}

/* Logo Shrink on Mobile */
@media (max-width: 767px) {
    .logo svg {
        width: 150px; 
        height: auto; 
        display: block; 
        transition: width 0.4s ease-in-out;
    }
    .gb-site-header.gb-is-sticky .logo svg { width: 80px; }
    .gb-site-header.gb-is-sticky .logo { margin: 0; }
}

/* === Product carousels (similar-products + birthday-party-themes) — Option A + edge fade ===
   Full card shadow. Extend the slider's clip 40px via overflow-clip-margin so the edge
   cards' shadows show (with a slight peek of the neighbour). overflow-clip-margin does NOT
   affect Swiper's slide sizing (unlike padding would), so the slider is unchanged. Then a
   white gradient at each edge fades the peeking cards gently to white instead of a raw cut.
   Scoped via :has(.best-selling) so only the product carousels are affected. */
.gb-carousel:has(.best-selling) {
    position: relative;
    overflow: clip;              /* clip both axes so overflow-clip-margin applies */
    overflow-clip-margin: 40px;  /* side shadows + ~25px peek + 40px top/bottom shadow room */
}
.gb-carousel:has(.best-selling) .best-selling {
    overflow: visible !important;
    margin: 0;
    padding: 0;
}
.gb-carousel:has(.best-selling) .gb-carousel-items {
    overflow: visible;
}

/* Gentle white fade on the left/right edges so the peeking cards dissolve to white
   instead of a hard cut. pointer-events:none so it never blocks swiping/clicks. */
.gb-carousel:has(.best-selling)::before,
.gb-carousel:has(.best-selling)::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 55px;
    z-index: 3;
    pointer-events: none;
}
.gb-carousel:has(.best-selling)::before {
    left: -40px;
    background: linear-gradient(to right, #fff 0%, #fff 38%, rgba(255, 255, 255, 0) 100%);
}
.gb-carousel:has(.best-selling)::after {
    right: -40px;
    background: linear-gradient(to left, #fff 0%, #fff 38%, rgba(255, 255, 255, 0) 100%);
}

/* --- Smooth anchor scrolling + correct landing for #reviews (PYW 2026-07-02) ---
   The stars under the product title link to #reviews. Before: instant jump + the sticky
   header (.header-global.gb-is-sticky) covered the "Customer reviews" headline and rating
   bars. Now: smooth scroll, landing with the headline visible below the header. */
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* Legal / company document pages — unified look (pure-Gutenberg rebuild 2026-07-03:
   Refund #10, ToS #19383, Shipping #19381, Privacy #3, Do-Not-Sell #19517). */
.pyw-legal { max-width: 760px; margin-left: auto; margin-right: auto; }
.pyw-legal .pyw-doc-meta {
    color: #64748b; font-size: 14px; font-style: italic;
    border-left: 3px solid var(--accent, #f59e0b); padding-left: 10px; margin-bottom: 28px;
}
.pyw-legal h2.wp-block-heading {
    font-size: 26px; margin-top: 40px; margin-bottom: 14px;
    padding-bottom: 8px; border-bottom: 1px solid #e2e8f0;
}
.pyw-legal h3.wp-block-heading { font-size: 20px; margin-top: 26px; margin-bottom: 10px; }
.pyw-legal p, .pyw-legal li { line-height: 1.7; }
.pyw-legal ul.wp-block-list { margin-bottom: 18px; }

/* Legal docs: restore the GB-era section padding (40px) + document H1 styling (2026-07-03). */
.pyw-legal { padding: 40px; background: #fff; }
.page-id-10 h1.entry-title,
.page-id-3 h1.entry-title,
.page-id-19383 h1.entry-title,
.page-id-19381 h1.entry-title,
.page-id-19517 h1.entry-title {
    max-width: 760px;
    margin: 10px auto 0;
    padding: 0 40px;
    font-size: 34px;
    font-weight: 700;
    line-height: 1.25;
}
@media (max-width: 768px) {
    .pyw-legal { padding: 24px 16px; }
    .page-id-10 h1.entry-title,
    .page-id-3 h1.entry-title,
    .page-id-19383 h1.entry-title,
    .page-id-19381 h1.entry-title,
    .page-id-19517 h1.entry-title { padding: 0 16px; font-size: 28px; }
}

/* ==========================================================================
   iOS product-page horizontal pan fix (2026-07-12)
   GP Premium's sticky add-to-cart bar (.add-to-cart-panel) is position:fixed
   and exists ONLY on product pages. Its inner form.cart is flex-shrink:0, so
   on phones the form (variations + qty + button) pokes past the right viewport
   edge. Desktop never scrolls to fixed-element overflow, but iOS Safari lets
   you PAN to it — even while the bar is hidden (opacity:0 + translateY, still
   rendered). Scoped fix: clip the panel's own overflow + let the form shrink
   on small screens so the bar also FITS when it shows.
   ========================================================================== */
.add-to-cart-panel {
    overflow-x: clip;
}
@media (max-width: 768px) {
    .add-to-cart-panel form.cart {
        flex-shrink: 1;
        min-width: 0;
    }
}

/* Woo's reset-variations alert (screen-reader text) measured 430px wide poking
   ±19px past the viewport (the only real layout overflow: scrollW 449 vs 430).
   Standard SR clipping. */
.reset_variations_alert.screen-reader-text {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    clip-path: inset(50%) !important;
    left: 0 !important;
}

