/**
 * Oleaf Theme — Responsive Fixes
 *
 * Comprehensive mobile/tablet responsive overrides.
 *
 * @package Oleaf
 * @version 1.0.0
 */

html,
body {
    overflow-x: clip;
}

#oleaf-page,
.oleaf-site {
    overflow: visible !important;
}

@media (max-width: 991px) {
    .oleaf-header {
        position: -webkit-sticky !important;
        position: sticky !important;
        top: 0;
        z-index: 999;
        background: #fff;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    }
}

@media (max-width: 991px) {

    .oleaf-topbar-left,
    .oleaf-topbar-right {
        display: none;
    }

    .oleaf-topbar-center {
        width: 100%;
        text-align: center;
    }

    .oleaf-topbar {
        padding: 6px 0;
        font-size: 12px;
    }

    .oleaf-header-row-main,
    .oleaf-header-row-woodmart {
        display: flex !important;
        flex-wrap: nowrap !important;
        align-items: center;
        gap: 8px;
        padding: 10px 0;
    }

    .oleaf-search-bar,
    .oleaf-search-bar-xl {
        display: none !important;
    }

    .oleaf-nav-primary {
        display: none !important;
    }

    .oleaf-browse-cats,
    .oleaf-browse-cats-mega {
        display: none !important;
    }

    .oleaf-header-nav,
    .oleaf-header-nav-bar,
    .oleaf-header-nav-woodmart {
        display: none !important;
    }

    .oleaf-mobile-only,
    #oleaf-mobile-menu-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
        background: none !important;
        background-color: transparent !important;
        border: none !important;
        border-radius: 0 !important;
        outline: none !important;
        box-shadow: none !important;
        -webkit-appearance: none;
        appearance: none;
        cursor: pointer;
        padding: 4px;
        color: #333;
        order: -1;
    }

    .oleaf-mobile-only:focus,
    .oleaf-mobile-only:active,
    #oleaf-mobile-menu-toggle:focus,
    #oleaf-mobile-menu-toggle:active {
        outline: none !important;
        box-shadow: none !important;
        border: none !important;
        background: none !important;
    }

    .oleaf-mobile-only svg {
        width: 24px;
        height: 24px;
    }

    .oleaf-header-actions,
    .oleaf-header-ecommerce .oleaf-header-actions {
        display: flex !important;
        align-items: center;
        gap: 0 !important;
        margin-left: auto;
        flex-shrink: 0;
    }

    .oleaf-header-actions .oleaf-header-action,
    .oleaf-header-ecommerce .oleaf-header-actions .oleaf-header-action {
        padding: 2px !important;
    }

    .oleaf-header-actions .oleaf-header-action svg,
    .oleaf-header-ecommerce .oleaf-header-actions .oleaf-header-action svg {
        width: 18px !important;
        height: 18px !important;
    }

    .oleaf-header-actions .oleaf-action-label,
    .oleaf-header-ecommerce .oleaf-header-actions .oleaf-action-label {
        display: none !important;
    }

    .oleaf-logo {
        flex: 1;
        min-width: 0;
        overflow: hidden;
    }

    .oleaf-logo img {
        max-width: 130px;
        height: auto !important;
    }

    .oleaf-container {
        padding-left: 15px;
        padding-right: 15px;
    }

    .oleaf-header-wm-right .oleaf-switcher {
        display: none;
    }

    .oleaf-shop-wrapper {
        grid-template-columns: 1fr !important;
    }

    .oleaf-shop-sidebar {
        position: fixed;
        top: 0;
        left: -320px;
        width: 300px;
        height: 100vh;
        z-index: 9999;
        background: #fff;
        overflow-y: auto;
        transition: left 0.3s ease;
        padding: 20px;
        box-shadow: 2px 0 20px rgba(0, 0, 0, 0.15);
    }

    .oleaf-shop-sidebar.is-open {
        left: 0;
    }

    .oleaf-footer-cta-inner {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }

    .oleaf-footer-widgets {
        grid-template-columns: 1fr 1fr;
        gap: 30px;
    }

    .oleaf-page-banner-title {
        font-size: 28px;
    }

    .elementor-section,
    .e-con,
    .elementor-widget-wrap {
        max-width: 100vw;
        overflow-x: clip;
    }

    .oleaf-organic-hero-inner,
    .oleaf-oh-content {
        padding-left: 15px !important;
        padding-right: 15px !important;
        box-sizing: border-box;
    }

    .oleaf-oh-buttons,
    .oleaf-hero-btns,
    .elementor-widget-container .elementor-button-wrapper {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        justify-content: center;
        max-width: 100%;
    }

    .oleaf-oh-btn,
    .oleaf-btn,
    .elementor-button {
        font-size: 13px;
        padding: 11px 20px;
        white-space: nowrap;
    }
}

@media (max-width: 767px) {

    .oleaf-header-row-main,
    .oleaf-header-row-woodmart {
        padding: 8px 0;
        gap: 6px;
    }

    .oleaf-logo {
        flex: 1;
    }

    .oleaf-logo img {
        max-width: 160px;
    }

    .oleaf-menu-toggle {
        display: flex !important;
        order: -1;
        padding: 6px;
        position: relative;
        z-index: 10;
    }

    .oleaf-header-actions {
        gap: 2px;
    }

    .oleaf-header-action {
        padding: 6px;
    }

    .oleaf-mobile-search-toggle {
        display: flex !important;
    }

    .oleaf-search-bar,
    .oleaf-search-bar-xl {
        display: none;
    }

    .oleaf-search-bar.is-visible {
        display: block;
        width: 100%;
    }

    .oleaf-mobile-sidebar {
        width: 85vw;
        max-width: 320px;
    }

    .oleaf-page-banner {
        padding: 30px 0;
    }

    .oleaf-page-banner-title {
        font-size: 22px;
    }

    .products.columns-3,
    .products.columns-4 {
        grid-template-columns: 1fr 1fr !important;
        gap: 12px;
    }

    .oleaf-product-title a {
        font-size: 13px;
        line-height: 1.3;
    }

    .oleaf-product-card-media {
        border-radius: 8px;
    }

    .oleaf-product-actions {
        gap: 4px;
    }

    .oleaf-product-actions button {
        width: 32px;
        height: 32px;
    }

    .oleaf-product-actions button svg {
        width: 14px;
        height: 14px;
    }

    .oleaf-shop-toolbar {
        flex-wrap: wrap;
        gap: 8px;
    }

    .oleaf-shop-ordering {
        width: 100%;
    }

    .oleaf-shop-ordering select {
        width: 100%;
    }

    .oleaf-view-toggle {
        display: none;
    }

    .oleaf-cart-sidebar {
        width: 90vw;
        max-width: 360px;
    }

    .oleaf-footer-widgets {
        grid-template-columns: 1fr;
        gap: 25px;
    }

    .oleaf-footer-bottom {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }

    .oleaf-subscribe-field {
        flex-direction: column;
        gap: 10px;
    }

    .oleaf-subscribe-input {
        width: 100%;
    }

    .oleaf-subscribe-btn {
        width: 100%;
    }

    h1 {
        font-size: 28px !important;
    }

    h2 {
        font-size: 24px !important;
    }

    h3 {
        font-size: 20px !important;
    }

    h4 {
        font-size: 18px !important;
    }

    .oleaf-quality-badge,
    [class*="quality-badge"],
    [class*="floating-badge"] {
        position: static !important;
        margin: 10px auto;
        transform: none !important;
    }

    .elementor-widget-container {
        overflow: hidden;
    }

    .elementor-section>.elementor-container {
        padding-left: 15px;
        padding-right: 15px;
    }
}

@media (max-width: 480px) {
    .oleaf-logo img {
        max-width: 110px;
    }

    .oleaf-header-action {
        padding: 4px;
    }

    .oleaf-header-action svg {
        width: 18px;
        height: 18px;
    }

    .oleaf-cart-count,
    .oleaf-wishlist-count {
        font-size: 9px;
        width: 16px;
        height: 16px;
        line-height: 16px;
    }

    .oleaf-topbar {
        font-size: 11px;
        padding: 4px 0;
    }

    .oleaf-topbar-text svg {
        display: none;
    }

    .products.columns-3,
    .products.columns-4 {
        grid-template-columns: 1fr !important;
        gap: 16px;
    }

    h1 {
        font-size: 24px !important;
    }

    h2 {
        font-size: 20px !important;
    }

    h3 {
        font-size: 18px !important;
    }

    .oleaf-page-banner-title {
        font-size: 20px;
    }

    .oleaf-breadcrumbs {
        font-size: 12px;
    }

    .oleaf-btn {
        padding: 10px 20px;
        font-size: 13px;
    }

    .oleaf-mobile-sidebar {
        width: 90vw;
    }

    .oleaf-footer-cta-title {
        font-size: 20px;
    }

    .oleaf-footer-cta-text {
        font-size: 13px;
    }

    .oleaf-payment-icons {
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
    }

    .oleaf-search-container {
        width: 95vw;
        padding: 15px;
    }

    .oleaf-search-layout {
        flex-direction: column;
    }

    .oleaf-search-sidebar {
        width: 100%;
    }

    .oleaf-results-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}

.oleaf-nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.oleaf-nav-overlay.is-active {
    opacity: 1;
    visibility: visible;
}

.oleaf-mobile-sidebar {
    position: fixed;
    top: 0;
    right: -100%;
    width: 85vw;
    max-width: 350px;
    height: 100vh;
    background: #fff;
    z-index: 9999;
    overflow-y: auto;
    transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.15);
}

.oleaf-mobile-sidebar.is-open {
    right: 0;
}

.oleaf-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    border-bottom: 1px solid #f0f0f0;
}

.oleaf-sidebar-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: #333;
    font-size: 20px;
}

.oleaf-mobile-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.oleaf-mobile-nav li a {
    display: block;
    padding: 14px 20px;
    border-bottom: 1px solid #f5f5f5;
    color: #333;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: background 0.2s ease, color 0.2s ease;
}

.oleaf-mobile-nav li a:hover,
.oleaf-mobile-nav li.current-menu-item>a {
    background: #f9f8f4;
    color: var(--oleaf-primary, #1A3C34);
}

.oleaf-sidebar-promo {
    margin: 20px;
    padding: 20px;
    background: #f9f8f4;
    border-radius: 12px;
    text-align: center;
}

@media (max-width: 767px) {
    .oleaf-cart-sidebar {
        width: 100vw;
        max-width: 100vw;
    }
}

@media (min-width: 992px) {
    .oleaf-menu-toggle {
        display: none !important;
    }

    .oleaf-mobile-only {
        display: none !important;
    }

    .oleaf-mobile-search-toggle {
        display: none !important;
    }

    .oleaf-nav-primary {
        display: block;
    }

    .oleaf-header-nav,
    .oleaf-header-nav-bar,
    .oleaf-header-nav-woodmart {
        display: block;
    }

    .oleaf-browse-cats,
    .oleaf-browse-cats-mega {
        display: block;
    }

    .oleaf-search-bar,
    .oleaf-search-bar-xl {
        display: block;
    }
}