/* ============================================================
   SLYDESIGNS — MOBILE STYLESHEET
   Breakpoints: 1100px (nav), 959px (hero), 768px (layout)
   ============================================================ */


/* ============================================================
   GLOBAL BASE
   ============================================================ */

html,
body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
}


* {
    box-sizing: border-box;
}

img {
    max-width: 100%;
    height: auto;
}

.cart-icon {
    display: inline-flex;
}


/* ============================================================
   HEADER
   ============================================================ */

/* Desktop: keep the menu button invisible and 0x0, like the old empty span */
@media (min-width: 1101px) {

    #mobile-navigation {
        width: 0;
        height: 0;
        border: 0;
        padding: 0;
        -webkit-appearance: none;
        appearance: none;
        background: transparent;
        font: inherit;
        visibility: hidden;
    }
}

@media (max-width: 1100px) {

    #header .header-inner ul#navigation {
        display: none;
    }

    #mobile-navigation {
        display: flex;
    }

    #header {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 72px;
        z-index: 9999;
        background: rgba(0, 0, 0, 0.6);
    }

    #header .header-inner {
        position: relative;
        height: 72px;
        padding: 0 8px;
        overflow: visible;
    }

    #header .logo {
        width: 120px;
        display: flex;
        align-items: center;
        flex-shrink: 0;
    }

    .header-actions {
        margin-left: auto;
        display: flex;
        align-items: center;
        justify-content: flex-end;
        gap: 10px;
        z-index: 100000;
    }

    .search-form {
        display: flex;
        align-items: center;
        order: 0;
        margin-right: 2px;
        flex-shrink: 1;
        min-width: 0;
        background: rgba(255, 255, 255, 0.1);
        border: 1px solid rgba(255, 255, 255, 0.2);
        border-radius: 20px;
        padding: 4px 12px;
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }

    .search-form input[type="search"] {
        width: clamp(72px, 14vw, 120px);
        min-width: 72px;
        height: auto;
        font-size: 14px;
        padding: 0;
        border: none;
        border-radius: 0;
        background: transparent;
        color: #fff;
        outline: none;
        transition: none;
    }

    .search-form input[type="search"]::placeholder {
        color: rgba(255, 255, 255, 0.65);
    }

    .search-form button {
        width: auto;
        height: auto;
        background: transparent;
        border: none;
        border-radius: 0;
        cursor: pointer;
        font-size: 16px;
        color: #fff;
        display: flex;
        align-items: center;
        justify-content: center;
        margin-left: 8px;
        padding: 0;
    }

    .header-cart {
        width: 72px;
        display: flex;
        align-items: center;
        justify-content: center;
        order: 1;
        height: 40px;
        flex-shrink: 1;
        overflow: visible;
        position: relative;
    }

    .header-cart paypal-cart-button {
        display: block;
    }

    /* Reset native button styles so the menu button matches the old span */
    #mobile-navigation {
        border: 0;
        padding: 0;
        -webkit-appearance: none;
        appearance: none;
        font: inherit;
    }

    #mobile-navigation:focus-visible {
        outline: 2px solid #fff;
        outline-offset: 2px;
    }

    /* Background image toggled by mobile.js on open/close */
    #mobile-navigation {
        width: 44px;
        height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: url("../images/mobile/mobile-menu.png") no-repeat center;
        background-size: 44px;
        background-color: transparent;
        cursor: pointer;
        order: 2;
        flex-shrink: 0;
        margin-left: 4px;
        margin-right: 6px;
    }

    .cart-icon {
        display: inline-flex;
        width: 72px;
        min-width: 72px;
        height: 40px;
        border: none;
        border-radius: 10px;
        background: #620031;
        color: #fff;
        font-size: 16px;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        margin: 0;
        padding: 0;
        order: 1;
    }

    @media (max-width: 420px) {
        #header .header-inner {
            padding: 0 4px;
        }

        #header .logo {
            width: 96px;
        }

        .header-actions {
            gap: 10px;
        }

        .search-form {
            min-width: 0;
            margin-right: 4px;
        }

        .search-form input[type="search"] {
            width: 60px;
            min-width: 60px;
        }

        .search-form:focus-within input[type="search"] {
            width: 60px;
        }

        .search-form button {
            font-size: 16px;
        }

        .header-cart {
            width: 72px;
            height: 40px;
        }

        .cart-icon {
            width: 72px;
            min-width: 72px;
            height: 40px;
            font-size: 16px;
        }

        #mobile-navigation {
            width: 44px;
            height: 44px;
            background-size: 44px;
        }
    }

    @media (max-width: 360px) {
        .header-actions {
            gap: 8px;
        }

        .search-form {
            padding: 4px 8px;
            margin-right: 2px;
        }

        .search-form input[type="search"] {
            width: 48px;
            min-width: 48px;
            font-size: 13px;
        }

        .search-form:focus-within input[type="search"] {
            width: 48px;
        }
    }
}


/* ============================================================
   MOBILE NAV PANEL
   Toggled via .mobile-open class added by mobile.js.
   ============================================================ */

@media (max-width: 1100px) {

    #header ul#navigation {
        display: none;
        position: absolute;
        top: 72px;
        left: 16px;
        right: 16px;
        margin-left: 0;
        flex-direction: column;
        align-items: stretch;
        background: rgba(0, 0, 0, 0.7);
        border-radius: 10px;
        border: 1px solid rgba(255, 255, 255, 0.08);
        z-index: 9998;
        max-height: min(70vh, 480px);
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        padding-bottom: 8px;
        touch-action: pan-y;
    }

    #header ul#navigation.mobile-open {
        display: flex;
    }

    #header ul#navigation li {
        float: none;
        width: 100%;
        position: relative;
    }

    #header ul#navigation li a {
        display: block;
        padding: 16px 18px;
        font-size: 18px;
        color: #fff;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    }

    #header ul#navigation li a:hover {
        background: #620031;
    }

    #header ul#navigation li:last-child a {
        border-bottom: none;
    }

    #header ul#navigation li.menu ul {
        display: none;
        flex-direction: column;
        padding-left: 0;
        margin: 0;
        background: rgba(0, 0, 0, 0.7);
        list-style: none;
        max-height: min(48vh, 320px);
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        touch-action: pan-y;
    }

    /* Remove the submenu's bottom inset so the fade reaches its edge. */
    #header .header-inner ul#navigation li.menu > ul {
        padding-bottom: 0;
    }

    #header ul#navigation li.menu ul li {
        list-style: none;
    }

    #header ul#navigation li.menu ul li a {
        display: flex;
        align-items: center;
        padding-left: 32px;
        font-size: 16px;
        border-bottom: none;
        color: #fff;
        background: transparent;
        transition: background 0.2s ease;
    }

    #header ul#navigation li.menu ul li a:hover {
        background: #620031;
    }

    /* Expand/collapse button injected by mobile.js */
    .mobile-submenu {
        position: absolute;
        top: 0;
        right: 0;
        width: 52px;
        height: 52px;
        background: transparent url("../images/mobile/mobile-expand.png") no-repeat center;
        border-left: 1px solid rgba(255, 255, 255, 0.08);
        cursor: pointer;
        transition: background-color 0.2s ease;
    }

    .mobile-submenu:hover {
        background-color: rgba(98, 0, 49, 0.91);
    }
        /* Show a bottom-edge scroll cue on menu panels with more content below. */
    #header ul#navigation.has-more-below::after,
    #header ul#navigation li.menu > ul.has-more-below::after {
        content: "Scroll for more  ↓";
        position: sticky;
        bottom: 0;
        z-index: 2;
        display: flex;
        flex: 0 0 36px;
        align-self: stretch;
        align-items: center;
        justify-content: center;
        box-sizing: border-box;
        height: 36px;
        margin-top: -36px;
        color: #fff;
        font-size: 13px;
        line-height: 1;
        white-space: nowrap;
        text-shadow: 0 1px 2px #000;
        background: linear-gradient(
            to bottom,
            rgba(0, 0, 0, 0),
            rgba(0, 0, 0, 0.9) 65%
        );
        /* Keep the cue from blocking taps or swipes on menu items. */
        pointer-events: none;
    }

}


/* ============================================================
   HERO
   ============================================================ */

@media (max-width: 959px) {

    .hero {
        padding-top: 120px;
        text-align: center;
        background-image: url("../images/bg-home-mobile.webp");
    }

    .hero h1 {
        font-size: clamp(2.5rem, 12vw, 4rem);
        white-space: nowrap;
        overflow-wrap: normal;
        word-break: keep-all;
        letter-spacing: 1px;
    }

    .hero .tagline {
        font-size: clamp(.4rem, 3.5vw, 1.2rem);
        margin-bottom: 40px;
    }

    .section-header {
        padding: 0;
        width: 100%;
        box-sizing: border-box;
        margin-bottom: 16px;
    }

    .section-header h2 {
        font-size: clamp(1rem, 7.5vw, 1.4rem);
        padding: 6px 0;
        letter-spacing: 1px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: clip;
        max-width: 100%;
        margin: 0 auto;
    }

    .info .section-inner {
        padding: 0 12px;
    }

    .info h1 {
        font-size: clamp(2rem, 9vw, 3rem);
    }

    .info p {
        max-width: 100%;
    }

    .about {
        padding: 30px 0;
    }

    .about .section-inner {
        padding: 0 16px;
    }

    .about p {
        max-width: 100%;
        text-align: left;
    }
}

@media (max-width: 390px) {

    .hero {
        padding-top: 80px;
    }

    .hero .tagline {
        margin-bottom: 10px;
    }

    .featured-products {
        padding-bottom: 0;
    }

    .section-header {
        margin-bottom: 0;
    }
}


/* ============================================================
   PRODUCT SLIDER
   Native horizontal scroll with snap replaces the JS slider.
   ============================================================ */

@media (max-width: 768px) {

    .product-slider {
        overflow: visible;
    }

    .slider-track {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        gap: 12px;
        padding: 0 12px;
        max-width: 100%;
    }

    .slider-track::-webkit-scrollbar {
        display: none;
    }

    .product-slide {
        flex: 0 0 90%;
        scroll-snap-align: center;
        opacity: 1;
        transform: none;
        filter: none;
    }

    .product-slide a {
        aspect-ratio: 4 / 5;
        border-radius: 14px;
    }

    .product-slide.view-all::before {
        border-radius: 14px;
    }

    .product-slider::after {
        content: "›";
        position: absolute;
        top: 50%;
        right: 12px;
        transform: translateY(-50%);
        width: 36px;
        height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
        color: rgba(255, 255, 255, 0.9);
        font-size: 28px;
        pointer-events: none;
        opacity: 0.9;
        animation: pulse-arrow 1.4s ease-in-out infinite alternate;
    }

    @keyframes pulse-arrow {
        from { opacity: 0.5; transform: translateY(-50%) scale(1); }
        to   { opacity: 1;   transform: translateY(-50%) scale(1.1); }
    }

    .slider-btn {
        display: none;
    }
}

@media (max-width: 390px) {

    .product-slide a {
        aspect-ratio: 1 / 1;
    }
}


/* ============================================================
   MEDIA SECTION
   ============================================================ */

@media (max-width: 768px) {

    .media-inner {
        flex-direction: column;
        gap: 40px;
    }

    .media-video,
    .media-blog {
        width: 100%;
    }

    .media-blog .blog-list {
        grid-template-columns: 1fr;
    }

    .media-video iframe,
    .media-video .yt-facade {
        border-radius: 14px;
    }

    .media-video h1,
    .media-blog h1 {
        font-size: 26px;
    }

    .media-blog .blog-item {
        flex-direction: column;
    }

    .media-video h2,
    .media-blog h2,
    .media-blog .blog-item h3 {
        font-size: 20px;
    }

    /* Match the mobile .section-header h2 label bar. */
    .media-video > h2,
    .media-blog > h2 {
        font-size: clamp(1rem, 7.5vw, 1.4rem);
        padding: 6px 0;
        letter-spacing: 1px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: clip;
        max-width: 100%;
        margin: 0 0 16px;
    }

    .about h2 {
        font-size: 20px;
    }

    .media-blog span {
        font-size: 14px;
    }

    .media-blog a.more {
        font-size: 16px;
    }

    /* Blog teaser: undo the desktop overlay; stack photo then text. */
    .media-blog .blog-item {
        display: flex;
        flex-direction: column;
        min-height: 0;
        padding: 20px;
        border: 1px solid rgba(255, 255, 255, 0.12);
    }

    .media-blog .blog-item > a:first-child {
        position: static;
    }

    .media-blog .blog-item img {
        height: auto;
        aspect-ratio: 16 / 9;
        border-radius: 14px;
    }

    .media-blog .blog-item:hover img {
        transform: none;
    }

    .media-blog .blog-content {
        position: static;
        padding: 0;
        text-align: center;
        display: block;
        background: none;
        pointer-events: auto;
    }

    .media-blog .blog-head,
    .media-blog .blog-foot {
        padding: 0;
        background: none;
    }

    .media-blog .blog-content h3 {
        margin: 14px 0 6px;
        color: #a3a3a3;
        text-shadow: none;
    }

    .media-blog .blog-content span {
        color: #fff;
        margin-bottom: 14px;
        text-shadow: none;
    }

    .media-blog .blog-content .excerpt {
        display: block;
        -webkit-line-clamp: unset;
        line-clamp: none;
        margin: 0;
        color: #ddd;
        text-shadow: none;
    }

    .media-blog .blog-content a.more {
        display: block;
        margin-top: 10px;
    }
}


/* ============================================================
   FOOTER
   ============================================================ */

@media (max-width: 768px) {

    #footer .connect h1 {
        font-size: 20px;
    }

    #footer .connect h2 {
        font-size: 20px;
    }

    #footer .connect a {
        transform: scale(0.9);
    }

    #footer .connect {
        padding-top: 9px;
    }
}


/* ============================================================
   PRODUCTS CATALOG PAGE
   ============================================================ */

@media (max-width: 768px) {

    body.products-page .products-catalog {
        padding-top: 100px;
    }

    body.products-page .products-catalog-inner > h1 {
        font-size: 2rem;
        text-align: center;
    }

    body.products-page .products-row {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    body.products-page .products-row-body {
        text-align: center;
    }

    body.products-page .products-row-body h1 {
        font-size: 1.5rem;
    }
}


/* ============================================================
   BLOG INDEX PAGE
   ============================================================ */

@media (max-width: 768px) {

    body.blog-page .blog-index {
        padding-top: 100px;
    }

    body.blog-page .blog-index-inner > h1 {
        font-size: 2rem;
        text-align: center;
    }

    body.blog-page .blog-post-row {
        text-align: center;
    }

    body.blog-page .blog-post-row h1 {
        font-size: 1.5rem;
    }
}


/* ============================================================
   PRODUCT DETAIL PAGE
   ============================================================ */

@media (max-width: 1100px) {

    body.product-detail-page .variant-buy {
            display: block;
            width: 100%;
            max-width: 100%;
            min-width: 0;
            margin: 0 auto;
            text-align: center;
        }

    body.product-detail-page .variant-buy > div {
        display: block;
        width: 100%;
        max-width: 100%;
        margin: 0 auto;
        text-align: center;
        min-width: 0;
    }

    body.product-detail-page .variant-buy > div paypal-add-to-cart-button {
        display: block;
        width: 50%;
        max-width: 100%;
        margin: 0 auto;
        text-align: center;
    }

    body.product-detail-page .variant-buy > div paypal-add-to-cart-button,
    body.product-detail-page .variant-buy > div paypal-add-to-cart-button * {
        text-align: center;
    }

    body.product-detail-page .variant-buy p {
        display: block;
        width: 100%;
        max-width: 100%;
        margin: 0 0 12px;
        white-space: normal;
        word-break: normal;
        overflow-wrap: anywhere;
    }

    body.product-detail-page .variant-buy p:last-child {
        font-size: 0.9rem;
        line-height: 1.45;
        margin-bottom: 24px;
    }

    body.product-detail-page .product-variant .variant-layout {
        display: grid;
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

@media (max-width: 768px) {

    body.product-detail-page .product-detail {
        padding-top: 100px;
    }

    body.product-detail-page .product-detail-inner > h1 {
        font-size: 2rem;
        text-align: center;
    }

    body.product-detail-page .product-detail-intro {
        text-align: center;
    }

    body.product-detail-page .product-detail-intro h1 {
        font-size: 1.5rem;
    }

    body.product-detail-page .product-variant {
        padding: 18px;
        border-radius: 10px;
        text-align: center;
    }

    body.product-detail-page .product-variant h1 {
        font-size: 1.5rem;
    }

    body.product-detail-page .product-variant .variant-buy {
        padding: 14px;
    }

    body.product-detail-page .product-variants-list {
        gap: 16px;
    }

    body.product-detail-page .carousel-button {
        padding: 8px;
    }

    body.product-detail-page .made-in-usa {
        font-size: 0.85rem;
        padding: 8px 12px;
    }

    body.product-detail-page .products-magazine-callout {
        text-align: center;
        padding: 14px;
    }

    body.product-detail-page .products-search-help-inner h2 {
        font-size: 1.3rem;
    }
    body.product-detail-page .products-search-form input[type="search"] {
        width: 100%;
    }
    body.product-detail-page .products-search-form button {
        width: 100%;
    }

}

/* ============================================================
   MAGAZINE PAGE
   ============================================================ */

.pdf-mobile-link {
    display: none;
}

@media (max-width: 768px) {

    .magazine-preview {
        padding-top: 100px;
    }

    .magazine-preview .section-inner {
        padding: 0 12px;
        text-align: center;
    }

    .magazine-preview h1 {
        font-size: 2rem;
    }

    .pdf-preview iframe {
        display: block;
        width: 100%;
        height: 70vh;
        min-height: 320px;
    }

    .pdf-mobile-link {
        display: block;
        width: fit-content;
        margin: 40px auto;
        padding: 16px 36px;
        background: #620031;
        color: #fff;
        font-size: 1.1rem;
        border-radius: 8px;
        text-align: center;
        text-decoration: none;
        letter-spacing: 0.5px;
    }
}

/* ============================================================
   BLOG PAGE POSTS
   ============================================================ */

@media (max-width: 768px) {

    body.product-detail-page .product-variant h2 {
        font-size: 1.5rem;
    }

    .post-figure {
        float: none;
        width: 100%;
        max-width: 420px;
        margin: 0 auto 16px;
    }

    .post-figure-left {
        float: none;
        margin: 0 auto 16px;
    }

    .post-gallery {
        grid-template-columns: 1fr;
    }

    /* Tall galleries stay 2-up on phones so portrait photos don't stretch the page. */
    .post-gallery.post-gallery-tall {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .post-gallery.post-gallery-tall img {
        aspect-ratio: 3 / 4;
        border-radius: 14px;
    }

    .post-video iframe,
    .post-video .yt-facade {
        border-radius: 14px;
    }

    .post-video.post-video-vertical {
        max-width: 360px;
        margin-left: auto;
        margin-right: auto;
    }

    .post-video.post-video-vertical .yt-facade,
    .post-video.post-video-vertical .yt-facade img,
    body.product-detail-page .post-video.post-video-vertical iframe {
        border-radius: 14px;
    }

    .post-nav {
        flex-direction: column;
        justify-content: center;
    }
}

/* ============================================================
   BLOG LIST PAGE (blog/index.html)
   ============================================================ */

@media (max-width: 768px) {

    .blog-card-list {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .blog-card {
        padding: 18px;
        text-align: center;
    }

    .blog-card-body {
        align-items: center;
    }

    .blog-card h2 {
        font-size: 1.2rem;
    }
}
