/**
 * Mobile responsive styles.
 * Loaded after base layout styles.
 */

.mobile-filters-dock,
.mobile-filters-overlay,
.mobile-filters-launcher,
.mobile-bottom-nav,
.mobile-menu-overlay {
    display: none;
}

@media (max-width: 768px) {
    body {
        background: #f2f2f2 !important;
        padding-bottom: 86px !important;
    }
    header {
        border-bottom: none !important;
        background: #000000 !important;
    }
    .header-content {
        justify-content: center !important;
        padding-top: 18px !important;
        padding-bottom: 8px !important;
    }
    .header-content nav,
    .header-right {
        display: none !important;
    }
    .header-content .logo {
        justify-content: center !important;
    }
    .logo-image {
        height: 50px !important;
        max-width: min(320px, 88vw) !important;
    }
    .products-header-bar {
        background: #f2f2f2 !important;
        border-bottom: none !important;
        padding-bottom: 14px !important;
    }
    .products-page-title,
    .products-header-icons {
        display: none !important;
    }
    .products-search-box {
        border: none !important;
        background: #dfdfdf !important;
        border-radius: 999px !important;
        min-height: 56px !important;
    }
    .products-search-box input {
        font-size: 17px !important;
        color: #555 !important;
    }
    .products-search-box input::placeholder {
        color: #6a6a6a !important;
    }
    .products-image-search-btn {
        background: transparent !important;
        border: none !important;
    }
    main {
        background: #f2f2f2 !important;
    }
    footer {
        padding-bottom: 96px !important;
    }
    .footer-column p {
        margin-bottom: 14px !important;
    }
    .newsletter {
        display: flex;
        flex-direction: column;
        gap: 10px;
        margin-top: 8px;
    }
    .newsletter input {
        margin-bottom: 0 !important;
    }
    .newsletter button {
        margin-top: 6px !important;
        position: static !important;
    }

    .mobile-bottom-nav {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        height: 70px;
        background: #f6f6f6;
        border-top: 1px solid #d9d9d9;
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        align-items: center;
        z-index: 2300;
    }
    .mobile-bottom-nav-item {
        display: flex;
        align-items: center;
        justify-content: center;
        color: #8b8b8b;
        text-decoration: none;
        background: transparent;
        border: none;
        height: 100%;
    }
    .mobile-bottom-nav-item.is-active {
        color: #2f80b7;
    }

    .mobile-menu-overlay {
        position: fixed;
        inset: 0;
        z-index: 2400;
    }
    .mobile-menu-overlay.is-open {
        display: block;
    }
    .mobile-menu-backdrop {
        position: absolute;
        inset: 0;
        background: rgba(25, 25, 25, 0.3);
    }
    .mobile-menu-sheet {
        position: absolute;
        left: 0;
        right: 0;
        top: 210px;
        bottom: 70px;
        background: #efefef;
        border-radius: 20px 20px 0 0;
        overflow: auto;
    }
    .mobile-menu-sheet-header {
        display: flex;
        justify-content: flex-end;
        padding: 10px 14px;
        border-bottom: 1px solid #e4e4e4;
    }
    .mobile-menu-close {
        border: none;
        background: transparent;
        font-size: 46px;
        color: #8b8b8b;
        line-height: 1;
        cursor: pointer;
    }
    .mobile-menu-links {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 28px;
        padding: 34px 20px 52px;
    }
    .mobile-menu-links a {
        color: #5f6163;
        text-decoration: none;
        font-size: 42px;
        line-height: 1.15;
        font-weight: 500;
    }
    .mobile-menu-opened {
        overflow: hidden;
    }

    .products-layout-grid {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 24px !important;
    }
    .products-sidebar {
        order: 2 !important;
    }
    .products-main {
        order: 1 !important;
    }

    .products-page-index .products-sidebar {
        display: none !important;
    }
    .products-page-index .products-main {
        padding-bottom: 88px !important;
    }
    .products-page-index .products-top-controls {
        display: none !important;
    }

    .mobile-filters-launcher {
        position: fixed;
        left: 50%;
        bottom: 10px;
        transform: translateX(-50%);
        width: 72px;
        height: 24px;
        border: 1px solid #e5e7eb;
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.98);
        box-shadow: 0 6px 14px rgba(0, 0, 0, 0.12);
        align-items: center;
        justify-content: center;
        z-index: 2099;
        padding: 0;
    }
    .mobile-filters-launcher-line {
        width: 34px;
        height: 4px;
        border-radius: 999px;
        background: #9ca3af;
        display: block;
    }
    .mobile-filters-dock {
        position: fixed;
        left: 12px;
        right: 12px;
        bottom: 40px;
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
        padding: 8px;
        background: rgba(255, 255, 255, 0.98);
        border: 1px solid #e5e7eb;
        border-radius: 14px;
        box-shadow: 0 8px 22px rgba(0, 0, 0, 0.14);
        z-index: 2100;
        opacity: 0;
        pointer-events: none;
        transform: translateY(12px);
        transition: opacity 0.2s ease, transform 0.2s ease;
    }
    .mobile-filters-dock.is-expanded {
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0);
    }
    .mobile-filter-icon-btn {
        appearance: none;
        border: 1px solid #e5e7eb;
        background: #f9fafb;
        border-radius: 10px;
        padding: 6px 4px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        color: #1f2937;
        font-size: 11px;
        font-weight: 600;
        line-height: 1.1;
    }
    .mobile-filters-overlay {
        position: fixed;
        inset: 0;
        z-index: 2200;
    }
    .mobile-filters-overlay.is-open {
        display: block;
    }
    .mobile-filters-backdrop {
        position: absolute;
        inset: 0;
        background: rgba(0, 0, 0, 0.38);
    }
    .mobile-filters-panel {
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        max-height: 80vh;
        background: #ffffff;
        border-radius: 16px 16px 0 0;
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }
    .mobile-filters-panel-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 14px 16px;
        border-bottom: 1px solid #e5e7eb;
    }
    .mobile-filters-panel-title {
        margin: 0;
        font-size: 16px;
        font-weight: 700;
        color: #111827;
    }
    .mobile-filters-close {
        appearance: none;
        border: none;
        background: transparent;
        font-size: 28px;
        line-height: 1;
        color: #6b7280;
        padding: 0;
        width: 32px;
        height: 32px;
    }
    .mobile-filters-panel-body {
        overflow-y: auto;
        padding: 12px 12px 98px;
    }
    .mobile-filters-panel-body .products-top-left,
    .mobile-filters-panel-body .products-top-right {
        display: flex !important;
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    .mobile-filters-panel-body .products-top-right .view-icon-btn {
        display: none !important;
    }
    .mobile-filters-opened {
        overflow: hidden;
    }

    .product-show-top {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 24px !important;
        margin-bottom: 40px !important;
    }
    .product-show-gallery-row {
        flex-direction: column !important;
        align-items: center !important;
    }
    .product-show-thumbs-col {
        flex-direction: row !important;
        flex-wrap: wrap !important;
        width: 100% !important;
        max-width: 100% !important;
        justify-content: center !important;
    }
    #mainImageContainer.product-show-main-img {
        height: min(70vw, 380px) !important;
        max-height: 420px !important;
    }
    .product-show-bottom {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 24px !important;
        margin-top: 32px !important;
    }
    #similarProductsContainer.product-show-similar-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
    }
}

@media (max-width: 480px) {
    #similarProductsContainer.product-show-similar-grid {
        grid-template-columns: 1fr !important;
    }
    .logo-image {
        height: 50px !important;
        max-width: min(300px, 88vw) !important;
    }
    .mobile-menu-links a {
        font-size: 34px;
    }
}

@media (max-width: 900px) {
    .responsive-category-checkboxes {
        grid-template-columns: 1fr !important;
    }
}
