/* ==========================================================================
   SIRAJ — RESPONSIVE LAYOUTS FOR TRACK ORDER (track-order-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;
    }
}

/* ==========================================================================
   2. LAPTOPS & DESKTOPS UNDER 1200px (max-width: 1200px)
   ========================================================================== */
@media (max-width: 1200px) {
    .checkout-top-bar-section,
    .track-container {
        padding-left: 4%;
        padding-right: 4%;
    }
}

/* ==========================================================================
   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;
    }

    /* Responsive Track Layout (Tablets & Phones <= 786px) */
    .track-container {
        margin: 18px auto 32px !important;
        padding: 0 18px !important;
    }

    .checkout-top-bar-section {
        padding: 0 18px !important;
        margin: 14px auto 0 !important;
    }

    .track-hero {
        margin-bottom: 20px !important;
    }

    .track-hero-title {
        font-size: 1.55rem !important;
    }

    .track-hero-sub {
        font-size: 0.88rem !important;
    }

    .track-search-card {
        padding: 6px 6px 6px 12px !important;
        border-radius: 16px !important;
    }

    .track-search-input {
        height: 44px !important;
        font-size: 0.9rem !important;
        padding: 0 10px !important;
    }

    .track-search-btn {
        height: 44px !important;
        padding: 0 20px !important;
        font-size: 0.88rem !important;
        border-radius: 10px !important;
    }

    .track-result-card {
        padding: 22px 18px !important;
        border-radius: 18px !important;
    }

    .order-header-row {
        padding-bottom: 14px !important;
        margin-bottom: 18px !important;
    }

    .order-number-display {
        font-size: 1.15rem !important;
    }

    .order-status-badge {
        display: none;
    }

    .track-stepper {
        margin: 18px 0 22px !important;
    }

    .track-stepper::before,
    .stepper-progress-fill {
        top: 15px !important;
        height: 2px !important;
    }

    .step-icon {
        width: 30px !important;
        height: 30px !important;
        font-size: 0.78rem !important;
        margin-bottom: 6px !important;
    }

    .step-label {
        font-size: 0.74rem !important;
    }

    .order-details-grid {
        grid-template-columns: 1fr !important;
        gap: 14px !important;
        margin-top: 20px !important;
    }

    .order-info-block {
        padding: 15px !important;
        border-radius: 12px !important;
    }

    .block-title {
        font-size: 0.84rem !important;
        margin-bottom: 10px !important;
    }

    .info-row {
        font-size: 0.82rem !important;
        padding: 5px 0 !important;
    }

    .track-item-thumb {
        width: 36px !important;
        height: 36px !important;
    }

    .track-item-name {
        font-size: 0.82rem !important;
    }

    .track-support-bar {
        flex-direction: column !important;
        align-items: stretch !important;
        text-align: center !important;
        gap: 10px !important;
        padding: 12px 14px !important;
        border-radius: 12px !important;
    }

    .whatsapp-cta-btn {
        justify-content: center !important;
        width: 100% !important;
        height: 40px !important;
    }
}

/* ==========================================================================
   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;
    }

    /* Track Order Compact Phone Layout */
    .track-container {
        padding: 0 12px !important;
        margin: 14px auto 26px !important;
    }

    .checkout-top-bar-section {
        padding: 0 12px !important;
        margin: 10px auto 0 !important;
    }

    .track-hero {
        margin-bottom: 16px !important;
    }

    .track-hero-title {
        font-size: 1.35rem !important;
    }

    .track-hero-sub {
        font-size: 0.82rem !important;
        line-height: 1.45 !important;
    }

    .track-search-card {
        padding: 8px !important;
        border-radius: 14px !important;
        margin-bottom: 18px !important;
    }

    .track-search-form {
        flex-direction: column !important;
        gap: 8px !important;
    }

    .track-search-input-wrap {
        width: 100% !important;
    }

    .track-search-input {
        height: 42px !important;
        width: 100% !important;
        background: #FAF9F5 !important;
        border: 1px solid rgba(0, 0, 0, 0.08) !important;
        border-radius: 10px !important;
        padding: 0 12px !important;
        font-size: 0.88rem !important;
    }

    .track-search-btn {
        width: 100% !important;
        height: 42px !important;
        font-size: 0.86rem !important;
        border-radius: 10px !important;
    }

    .track-result-card {
        padding: 16px 12px !important;
        border-radius: 14px !important;
    }

    .order-header-row {
        margin-bottom: 14px !important;
    }

    .order-meta-info {
        width: 100% !important;
        justify-content: space-between !important;
    }

    .order-number-display {
        font-size: 1.05rem !important;
    }

    .track-stepper {
        margin: 14px 0 18px !important;
    }

    .track-stepper::before,
    .stepper-progress-fill {
        top: 13px !important;
    }

    .step-icon {
        width: 26px !important;
        height: 26px !important;
        font-size: 0.72rem !important;
    }

    .step-label {
        font-size: 0.68rem !important;
    }

    .order-info-block {
        padding: 12px 10px !important;
        border-radius: 10px !important;
    }

    .info-row {
        font-size: 0.78rem !important;
    }
}

/* ==========================================================================
   5. ULTRA-COMPACT PHONES UNDER 400px (max-width: 400px)
   ========================================================================== */
@media (max-width: 400px) {
    .checkout-top-bar-section,
    .track-container {
        padding: 0 8px !important;
    }

    .track-result-card {
        padding: 14px 10px !important;
    }

    .step-label {
        font-size: 0.64rem !important;
    }
}
