/* ==========================================================================
   SIRAJ — RESPONSIVE LAYOUTS FOR CATALOG (catalog-responsive.css)
   Unified Top Bar & Responsive Breakpoints:
   1. Ultra-Wide & Large Screens (min-width: 1440px)
   2. Laptops & Desktops under 1200px (max-width: 1200px)
   3. Tablets & Viewports under 786px (max-width: 786px)
   4. Mobile Phones under 500px (max-width: 500px)
   ========================================================================== */

/* ==========================================================================
   1. ULTRA-WIDE & LARGE SCREENS (min-width: 1440px)
   ========================================================================== */
@media (min-width: 1440px) {
    /* Header */
    .site-header {
        padding: 18px 5%;
    }

    .site-header.is-scrolled {
        padding: 10px 5%;
    }

    .header-container {
        max-width: 1600px;
    }

    .header-nav {
        gap: 84px;
    }

    /* 4 Columns Grid */
    .catalog-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 16px;
        max-width: 1400px;
    }

    .card-meta {
        padding: 14px 18px;
    }

    .product-culture-tag {
        font-size: 0.78rem;
    }

    .product-title {
        font-size: 0.96rem;
    }

    .product-price {
        font-size: 0.96rem;
    }

    .card-actions {
        top: 14px;
        left: 14px;
    }

    .add-wishlist-icon-btn {
        width: 40px;
        height: 40px;
    }
}

/* ==========================================================================
   2. LAPTOPS & DESKTOPS UNDER 1200px (max-width: 1200px)
   ========================================================================== */
@media (max-width: 1200px) {
    .catalog-header {
        padding-left: 4%;
        padding-right: 4%;
    }

    /* 3 Columns Grid */
    .catalog-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 16px;
    }

    .card-meta {
        padding: 11px 14px;
        gap: 8px;
    }

    .card-info {
        min-width: 0;
        width: 100%;
    }

    .product-title {
        font-size: 0.88rem;
    }

    .product-price {
        font-size: 0.86rem;
    }

    .card-actions {
        top: 10px;
        left: 10px;
    }

    .add-wishlist-icon-btn {
        width: 34px;
        height: 34px;
    }
}

/* ==========================================================================
   3. TABLETS & VIEWPORTS UNDER 786px (max-width: 786px)
   ========================================================================== */
@media (max-width: 786px) {
    /* Header: Logo + Expand Button Only */
    .site-header {
        padding: 10px 70px 10px 20px;
    }

    .site-header.is-scrolled {
        padding: 8px 20px;
    }

    .site-header.is-scrolled .header-logo-svg {
        height: 50px;
    }

    .header-nav,
    .header-actions {
        display: none !important;
    }

    .header-mobile-expand-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        border-radius: 50%;
        background: transparent;
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        border: 1px solid rgba(255, 255, 255, 0.24);
        color: #FFFFFF;
        cursor: pointer;
        transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .site-header.is-scrolled .header-mobile-expand-btn {
        background: transparent;
        border-color: rgba(17, 19, 24, 0.1);
        color: #111318;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    .header-mobile-expand-btn.is-open {
        background: #D74E09 !important;
        border-color: #D74E09 !important;
        color: #FFFFFF !important;
    }

    .expand-icon-bars {
        position: relative;
        width: 18px;
        height: 12px;
        display: inline-flex;
        flex-direction: column;
        justify-content: space-between;
    }

    .expand-icon-bars .bar {
        display: block;
        width: 100%;
        height: 2px;
        border-radius: 2px;
        background: currentColor;
        transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), width 0.3s ease;
        transform-origin: center;
    }

    .expand-icon-bars .bar-bottom {
        width: 72%;
        align-self: flex-start;
    }

    .header-mobile-expand-btn.is-open .bar-top {
        transform: translateY(5px) rotate(45deg);
    }

    .header-mobile-expand-btn.is-open .bar-bottom {
        width: 100%;
        transform: translateY(-5px) rotate(-45deg);
    }

    /* Floating Mobile Hub Overlay & Panel */
    .mobile-header-hub-overlay {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 10005;
        pointer-events: none;
        opacity: 0;
        transition: opacity 0.32s cubic-bezier(0.16, 1, 0.3, 1);
        direction: rtl;
    }

    .mobile-header-hub-overlay.is-open {
        pointer-events: auto;
        opacity: 1;
    }

    .mobile-header-hub-backdrop {
        position: fixed;
        inset: 0;
        z-index: 10006;
        background: rgba(17, 19, 24, 0.18);
    }

    .mobile-header-hub-panel {
        position: fixed;
        top: 85px;
        left: 8px;
        right: 8px;
        z-index: 10007;
        max-height: calc(88vh - 72px);
        background: #FAF9F5;
        border: 1px solid rgba(0, 0, 0, 0.08);
        border-top: 3px solid #D74E09;
        border-radius: 24px;
        box-shadow: 0 0 0 1px rgba(215, 78, 9, 0.16), 0 22px 50px rgba(0, 0, 0, 0.18);
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        transform: translateY(-16px) scale(0.97);
        opacity: 0;
        transition: transform 0.38s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.32s cubic-bezier(0.16, 1, 0.3, 1);
        overflow: visible;
        box-sizing: border-box;
    }

    .mobile-header-hub-panel::before {
        content: '';
        position: absolute;
        top: -8px;
        left: 24px;
        width: 12px;
        height: 12px;
        background: #FAF9F5;
        border-top: 2px solid #D74E09;
        border-left: 2px solid #D74E09;
        transform: rotate(45deg);
        z-index: 10008;
    }

    .mobile-header-hub-overlay.is-open .mobile-header-hub-panel {
        transform: translateY(0) scale(1);
        opacity: 1;
    }

    /* 1. Navigation Buttons Row */
    .mobile-hub-nav {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
        padding: 16px 16px 12px;
        border-bottom: 1px solid rgba(0, 0, 0, 0.06);
        flex-shrink: 0;
    }

    .mobile-hub-nav-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        height: 36px;
        padding: 0 10px;
        border-radius: 20px;
        font-size: 0.84rem;
        font-weight: 600;
        color: #2D2F36;
        background: #FFFFFF;
        border: 1px solid rgba(17, 19, 24, 0.08);
        text-decoration: none;
        transition: all 0.25s ease;
        white-space: nowrap;
    }

    .mobile-hub-nav-btn:hover,
    .mobile-hub-nav-btn.is-active {
        background: #111318;
        color: #FFFFFF;
        border-color: #111318;
    }

    /* 2. Bespoke Custom Drop-Down + Section Viewport */
    .mobile-hub-dropdown-section {
        display: flex;
        flex-direction: column;
        flex: 1;
        min-height: 0;
        padding: 12px 16px 0;
        gap: 10px;
    }

    .mobile-hub-dropdown {
        position: relative;
        width: 100%;
        flex-shrink: 0;
        z-index: 20;
    }

    .mobile-hub-dropdown-trigger {
        width: 100%;
        height: 44px;
        padding: 0 14px;
        border-radius: 14px;
        background: #FFFFFF;
        border: 1px solid rgba(17, 19, 24, 0.1);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
        display: flex;
        align-items: center;
        justify-content: space-between;
        cursor: pointer;
        font-family: inherit;
        transition: border-color 0.25s ease, box-shadow 0.25s ease;
    }

    .mobile-hub-dropdown.is-open .mobile-hub-dropdown-trigger {
        border-color: #D74E09;
        box-shadow: 0 0 0 3px rgba(215, 78, 9, 0.12);
    }

    .mobile-hub-dd-selected {
        display: inline-flex;
        align-items: center;
        gap: 32px;
        flex: 1;
        justify-content: center;
    }

    .mobile-hub-dd-label {
        font-size: 0.9rem;
        font-weight: 700;
        color: #111318;
    }

    .mobile-hub-dd-badge,
    .dd-opt-badge {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 22px;
        height: 22px;
        padding: 0 7px;
        border-radius: 20px;
        font-size: 0.74rem;
        font-weight: 700;
        background: rgba(215, 78, 9, 0.1);
        color: #D74E09 !important;
        display: none;
    }

    .mobile-hub-dd-chevron {
        color: #605953;
        transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .mobile-hub-dropdown.is-open .mobile-hub-dd-chevron {
        transform: rotate(180deg);
        color: #D74E09;
    }

    .mobile-hub-dropdown-menu {
        position: absolute;
        top: calc(100% + 6px);
        left: 0;
        right: 0;
        background: #FFFFFF;
        border: 1px solid rgba(17, 19, 24, 0.09);
        border-radius: 16px;
        padding: 6px;
        box-shadow: 0 14px 34px rgba(0, 0, 0, 0.12);
        display: flex;
        flex-direction: column;
        gap: 4px;
        opacity: 0;
        visibility: hidden;
        transform: translateY(-8px) scale(0.98);
        pointer-events: none;
        transition: all 0.24s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .mobile-hub-dropdown.is-open .mobile-hub-dropdown-menu {
        opacity: 1;
        visibility: visible;
        transform: translateY(0) scale(1);
        pointer-events: auto;
    }

    .mobile-hub-dd-option {
        width: 100%;
        padding: 10px 12px;
        border-radius: 11px;
        border: none;
        background: transparent;
        display: flex;
        align-items: center;
        justify-content: space-between;
        font-family: inherit;
        font-size: 0.86rem;
        font-weight: 600;
        color: #2D2F36;
        cursor: pointer;
        transition: background 0.2s ease, color 0.2s ease;
    }

    .mobile-hub-dd-option:hover {
        background: rgba(17, 19, 24, 0.04);
    }

    .mobile-hub-dd-option.is-selected {
        background: rgba(215, 78, 9, 0.08);
        color: #D74E09;
    }

    /* Dynamic Viewport Hosting Cart / Wishlist / Account */
    .mobile-hub-viewport {
        flex: 1;
        min-height: 0;
        max-height: 44vh;
        overflow-y: auto;
        scrollbar-width: none;
        padding-bottom: 10px;
    }

    .mobile-hub-viewport::-webkit-scrollbar {
        display: none;
    }

    .mobile-hub-view {
        display: none;
        flex-direction: column;
        gap: 12px;
    }

    .mobile-hub-view.is-active {
        display: flex;
    }

    .mobile-hub-view .cart-items-body,
    .mobile-hub-view .wishlist-items-body,
    .mobile-hub-view .account-items-body {
        padding: 4px 0 8px;
        overflow: visible;
        max-height: none;
    }

    .mobile-hub-view .cart-shipping-info,
    .mobile-hub-view .account-status-info {
        background: #FFFFFF;
        padding: 10px 12px;
        border-radius: 12px;
        border: 1px solid rgba(0, 0, 0, 0.06);
    }

    /* 3. Bottom Checkout CTA Footer */
    .mobile-hub-footer {
        padding: 12px 16px 16px;
        border-top: 1px solid rgba(0, 0, 0, 0.06);
        background: #FAF9F5;
        border-radius: 0 0 24px 24px;
        display: flex;
        flex-direction: column;
        gap: 10px;
        flex-shrink: 0;
    }

    .mobile-hub-summary-slot .cart-summary-row {
        margin-bottom: 0;
    }

    .mobile-hub-checkout-btn {
        width: 100%;
        height: 46px;
        border-radius: 24px;
        background: #D74E09;
        color: #FFFFFF;
        text-decoration: none;
        font-size: 0.92rem;
        font-weight: 700;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        box-shadow: 0 4px 16px rgba(215, 78, 9, 0.24);
        transition: background 0.25s ease, transform 0.2s ease;
    }

    .mobile-hub-checkout-btn:hover {
        background: #B63E04;
    }

    /* Top Bar Alignment */
    .catalog-header {
        padding-left: 20px;
        padding-right: 20px;
    }

    /* 2 Columns Grid */
    .catalog-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
        padding: 0 20px;
        margin: 20px auto 36px;
    }

    .card-meta {
        padding: 12px 14px;
        flex-direction: column;
        align-items: stretch;
        justify-content: space-between;
        gap: 10px;
    }

    .card-info {
        width: 100%;
        grid-template-columns: 1fr;
        grid-template-areas:
            "title"
            "price";
        row-gap: 4px;
    }

    .product-culture-tag {
        display: none;
    }

    .product-title {
        font-size: 0.88rem;
        white-space: normal;
        text-align: right;
    }

    .product-price {
        font-size: 0.86rem;
    }

    .card-actions {
        position: static;
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
        padding-top: 8px;
        border-top: 1px solid rgba(17, 19, 24, 0.06);
    }

    .add-wishlist-icon-btn {
        width: 100%;
        height: 34px;
        border-radius: 30px;
        padding: 0 14px;
        gap: 6px;
        font-size: 0.78rem;
        font-weight: 600;
        font-family: inherit;
        background: rgba(17, 19, 24, 0.04);
        border-color: rgba(17, 19, 24, 0.09);
        box-shadow: none;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        box-sizing: border-box;
    }

    .add-wishlist-icon-btn:hover {
        background: rgba(215, 78, 9, 0.1);
        color: #D74E09;
        border-color: rgba(215, 78, 9, 0.25);
        transform: none;
    }

    .add-wishlist-icon-btn.is-active {
        background: rgba(215, 78, 9, 0.08);
        color: #D74E09;
        border-color: rgba(215, 78, 9, 0.28);
        box-shadow: none;
    }

    .add-wishlist-icon-btn svg {
        display: none;
    }

    .wishlist-btn-text {
        display: inline;
    }
}

/* ==========================================================================
   4. MOBILE PHONES UNDER 500px (max-width: 500px)
   ========================================================================== */
@media (max-width: 500px) {
    /* Header & Floating Hub on Compact Phones */
    .site-header {
        padding: 8px 14px;
    }

    .site-header.is-scrolled {
        padding: 6px 14px;
    }

    .header-logo-svg {
        height: 74px;
    }

    .site-header.is-scrolled .header-logo-svg {
        height: 56px;
    }

    .header-mobile-expand-btn {
        width: 40px;
        height: 40px;
    }

    .mobile-header-hub-panel {
        top: 85px;
        left: 8px;
        right: 8px;
        border-radius: 20px;
    }

    .mobile-header-hub-panel::before {
        left: 18px;
    }

    .mobile-hub-nav {
        padding: 12px 12px 10px;
        gap: 6px;
    }

    .mobile-hub-nav-btn {
        height: 34px;
        font-size: 0.78rem;
    }

    .mobile-hub-dropdown-section {
        padding: 10px 12px 0;
    }

    .mobile-hub-footer {
        padding: 10px 12px 14px;
        border-radius: 0 0 20px 20px;
    }

    .mobile-hub-checkout-btn {
        height: 42px;
        font-size: 0.86rem;
    }

    .catalog-header {
        padding-left: 14px;
        padding-right: 14px;
    }

    /* 2 Columns Compact Grid */
    .catalog-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
        padding: 0 14px;
        margin: 16px auto 28px;
    }

    .product-architectural-card {
        border-radius: 12px;
    }

    .card-meta {
        padding: 10px;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .card-info {
        grid-template-columns: 1fr;
        grid-template-areas:
            "title"
            "price";
        row-gap: 3px;
    }

    .product-title {
        font-size: 0.6rem;
        margin: 0;
    }

    .product-price {
        font-size: 0.6rem;
    }

    .card-actions {
        position: static;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
        padding-top: 6px;
    }

    .add-wishlist-icon-btn {
        width: 100%;
        height: 31px;
        padding: 0 10px;
        font-size: 0.6rem;
    }
}

/* ==========================================================================
   5. COMPACT PHONES (max-width: 400px)
   ========================================================================== */
@media (max-width: 400px) {
    .catalog-grid {
        grid-template-columns: repeat(1, minmax(0, 1fr));
        gap: 10px;
    }

    .product-architectural-card {
        border-radius: 12px;
        flex-direction: row;
    }

    .card-image-window {
        width: 30%;
    }
}
