/* public/assets/css/mobile-account.css */

@media screen and (max-width: 900px) {

    /* -----------------------------------------------------
       1. Global & Layout
    ----------------------------------------------------- */
    .container.account-container {
        padding: 1rem !important;
        position: relative;
    }

    /* Hide Desktop Title */
    h1.desktop-title,
    .container>h1:first-of-type {
        /* Fallback */
        display: none !important;
    }

    /* Show Mobile Header */
    #mobile-account-header {
        display: flex !important;
        position: sticky;
        top: 60px;
        /* Adjust based on main header height */
        background: #fff;
        z-index: 900;
        padding: 1rem 0;
        border-bottom: 1px solid #f0f0f0;
        margin-bottom: 1rem !important;
    }

    /* Account Layout (Grid -> Block) */
    .account-layout {
        display: block !important;
    }

    /* -----------------------------------------------------
       2. Sidebar (Off-Canvas Drawer)
    ----------------------------------------------------- */
    /* Old Sidebar Hidden */
    .account-sidebar {
        display: none !important;
    }

    #account-sidebar-overlay,
    #account-menu-toggle {
        display: none !important;
    }

    .account-mobile-tabs {
        display: flex !important;
        /* Show the new tabs */
        -ms-overflow-style: none;
        scrollbar-width: none;
    }

    .account-mobile-tabs::-webkit-scrollbar {
        display: none;
    }

    .mobile-tab-item {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 10px 18px;
        background: #fff;
        border: 1px solid var(--color-border);
        border-radius: 999px;
        color: var(--color-text-light);
        font-weight: 600;
        font-size: 0.9rem;
        flex-shrink: 0;
        transition: all 0.2s ease;
        text-decoration: none;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
    }

    .mobile-tab-item.active {
        background: var(--color-primary);
        color: #222;
        border-color: var(--color-primary);
        box-shadow: 0 4px 10px rgba(255, 179, 3, 0.3);
    }

    .mobile-tab-item svg {
        width: 18px;
        height: 18px;
    }

    /* Sidebar Content */
    .account-sidebar .profile-header {
        display: block !important;
        /* Show profile in drawer */
        padding-top: 3rem !important;
        background: #fffbef;
        /* Light background for header in drawer */
    }

    #account-sidebar-close {
        display: block !important;
        color: #333;
    }

    /* Nav Items in Drawer */
    .account-sidebar nav {
        display: block;
        /* Vertical Stack */
        overflow: visible;
        padding: 1rem 0;
        background: #fff;
    }

    .account-nav-item {
        border: none !important;
        border-radius: 0;
        padding: 1rem 2rem !important;
        font-size: 1rem !important;
        background: transparent !important;
        color: #333 !important;
        border-bottom: 1px solid #f9f9f9 !important;
    }

    .account-nav-item.active {
        background: #fffbef !important;
        color: var(--color-primary) !important;
        font-weight: 600 !important;
        border-left: 4px solid var(--color-primary) !important;
    }

    /* Show Logout in Drawer */
    .account-sidebar nav a[href*="logout"] {
        display: flex !important;
        margin-top: auto;
        color: #d32f2f !important;
    }

    /* -----------------------------------------------------
       3. Order Cards (New Design)
    ----------------------------------------------------- */
    .order-card {
        background: #fff;
        border: 1px solid #eee !important;
        border-radius: 12px !important;
        padding: 1.5rem !important;
        margin-bottom: 1rem !important;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    }

    .order-row-1 {
        display: flex;
        justify-content: space-between;
        margin-bottom: 1rem;
    }

    .order-col {
        display: flex;
        flex-direction: column;
        gap: 4px;
    }

    .order-col .label {
        font-size: 0.75rem;
        color: #888;
        text-transform: uppercase;
        font-weight: 600;
        letter-spacing: 0.5px;
    }

    .order-col .value {
        font-size: 0.95rem;
        font-weight: 600;
        color: #333;
    }

    .order-col .total-price {
        font-size: 1.1rem;
        color: #333;
    }

    .order-row-actions {
        display: flex;
        align-items: center;
        gap: 1rem;
        margin-top: 1rem;
    }

    .status-pill {
        padding: 6px 16px !important;
        border-radius: 20px !important;
        font-size: 0.85rem !important;
        font-weight: 600 !important;
        text-transform: capitalize;
    }

    .btn-track {
        background: #10B981;
        color: white;
        padding: 6px 20px;
        border-radius: 6px;
        text-decoration: none;
        font-size: 0.9rem;
        font-weight: 500;
        transition: background 0.2s;
    }

    .status-pill[style*="background: #e3f2fd"]+.btn-track {
        background: #2563EB;
    }

    /* -----------------------------------------------------
       4. Address Cards
    ----------------------------------------------------- */
    div.address-grid {
        display: grid;
        grid-template-columns: 1fr !important;
    }

    /* -----------------------------------------------------
       5. Wishlist Cards (Mock Design)
    ----------------------------------------------------- */
    div.wishlist-grid {
        display: flex !important;
        flex-direction: column;
        gap: 1.5rem;
    }

    .wishlist-card {
        background: #fff;
        border: 1px solid #eee;
        border-radius: 12px;
        padding: 1rem;
        position: relative;
        text-align: center;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
    }

    .btn-remove-wishlist {
        position: absolute;
        top: 10px;
        right: 10px;
        background: rgba(0, 0, 0, 0.05);
        /* Soft background for X */
        border: none;
        border-radius: 50%;
        width: 32px;
        height: 32px;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        color: #ef4444;
    }

    .wishlist-img-placeholder {
        width: 100px;
        height: 100px;
        background: #f9fafb;
        border-radius: 8px;
        margin: 1rem auto;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .wishlist-img-placeholder svg {
        opacity: 0.3;
        width: 40px;
        height: 40px;
    }

    .wishlist-category {
        font-size: 0.75rem;
        color: #888;
        text-transform: uppercase;
        font-weight: 600;
        letter-spacing: 0.5px;
        margin-bottom: 0.25rem;
    }

    .wishlist-title {
        font-size: 1rem;
        font-weight: 600;
        color: #333;
        margin: 0 0 0.5rem 0;
    }

    .wishlist-price {
        font-size: 1.1rem;
        font-weight: 700;
        color: #F59E0B;
        /* Orange */
        margin-bottom: 1rem;
    }

    .wishlist-variants-label {
        font-size: 0.8rem;
        color: #666;
        margin-bottom: 0.5rem;
        text-align: left;
    }

    .wishlist-variants {
        display: flex;
        gap: 0.5rem;
        margin-bottom: 1rem;
        flex-wrap: wrap;
    }

    .variant-pill {
        background: #fff;
        border: 1px solid #ddd;
        border-radius: 20px;
        padding: 6px 14px;
        font-size: 0.8rem;
        color: #555;
        cursor: pointer;
    }

    .variant-pill.active {
        border-color: #F59E0B;
        background: #FFFBEB;
        color: #F59E0B;
        font-weight: 600;
    }

    .btn-add-cart {
        width: 100%;
        background: #F59E0B;
        /* Orange */
        color: white;
        border: none;
        padding: 10px;
        border-radius: 8px;
        font-weight: 600;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
    }


    /* -----------------------------------------------------
       6. Address Form Fixes
    ----------------------------------------------------- */
    .checkout-form-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 1rem !important;
    }

    .form-group {
        width: 100% !important;
        grid-column: auto !important;
    }

    .form-group input {
        width: 100% !important;
        box-sizing: border-box !important;
        height: 45px !important;
        /* Larger touch target */
        padding: 0 12px;
        border: 1px solid #ddd;
        border-radius: 6px;
    }

    /* Ensure Add Address container has padding */
    #add-address-form {
        padding: 1.5rem !important;
    }

    /* -----------------------------------------------------
       7. Security Section Compact Fixes (Mobile)
    ----------------------------------------------------- */
    .security-2fa-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 1.5rem !important;
        align-items: center;
        text-align: center;
    }

    .security-2fa-grid canvas {
        margin: 0 auto;
    }

    .security-2fa-grid input {
        width: 100% !important;
        max-width: 200px;
    }

    .security-2fa-grid .btn {
        width: 100% !important;
        max-width: 200px;
    }

    /* Compact Session Cards */
    .session-card {
        padding: 1rem !important;
    }
}

/* -----------------------------------------------------
   DESKTOP STYLES (min-width: 901px)
   Restoring styles for new elements that were mobile-only
----------------------------------------------------- */
@media screen and (min-width: 901px) {

    /* Order Cards */
    .checkout-form-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1.5rem;
    }

    .orders-list {
        display: flex;
        flex-direction: column;
        gap: 1.5rem;
    }

    .order-card {
        background: #fff;
        border: 1px solid #eee;
        border-radius: 12px;
        padding: 1.5rem;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .order-row-1,
    .order-row-2 {
        display: flex;
        gap: 3rem;
        align-items: center;
    }

    .order-col {
        display: flex;
        flex-direction: column;
        gap: 4px;
    }

    .order-col .label {
        font-size: 0.75rem;
        color: #888;
        text-transform: uppercase;
        font-weight: 600;
        letter-spacing: 0.5px;
    }

    .order-col .value {
        font-size: 1rem;
        font-weight: 600;
        color: #333;
    }

    .order-col .total-price {
        font-size: 1.1rem;
        color: #333;
    }

    .order-row-actions {
        display: flex;
        align-items: center;
        gap: 1rem;
    }

    .status-pill {
        padding: 6px 16px;
        border-radius: 20px;
        font-size: 0.85rem;
        font-weight: 600;
        text-transform: capitalize;
    }

    .btn-track {
        background: #10B981;
        color: white;
        padding: 8px 24px;
        border-radius: 6px;
        text-decoration: none;
        font-size: 0.9rem;
        font-weight: 500;
        transition: background 0.2s;
    }

    .status-pill[style*="background: #e3f2fd"]+.btn-track {
        background: #2563EB;
    }

    /* Wishlist Grid & Cards */
    div.wishlist-grid {
        display: grid !important;
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 2rem;
    }

    .wishlist-card {
        background: #fff;
        border: 1px solid #eee;
        border-radius: 12px;
        padding: 2rem;
        position: relative;
        text-align: center;
        transition: transform 0.2s, box-shadow 0.2s;
    }

    .wishlist-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    }

    .btn-remove-wishlist {
        position: absolute;
        top: 15px;
        right: 15px;
        background: rgba(0, 0, 0, 0.05);
        /* Soft background for X */
        border: none;
        border-radius: 50%;
        width: 36px;
        height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        color: #ef4444;
        transition: background 0.2s;
    }

    .btn-remove-wishlist:hover {
        background: rgba(239, 68, 68, 0.1);
    }

    .wishlist-img-placeholder {
        width: 120px;
        height: 120px;
        background: #f9fafb;
        border-radius: 8px;
        margin: 1rem auto;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .wishlist-img-placeholder svg {
        opacity: 0.3;
        width: 50px;
        height: 50px;
    }

    .wishlist-category {
        font-size: 0.75rem;
        color: #999;
        text-transform: uppercase;
        font-weight: 600;
        letter-spacing: 0.5px;
        margin-bottom: 0.5rem;
    }

    .wishlist-title {
        font-size: 1.1rem;
        font-weight: 600;
        color: #333;
        margin: 0 0 0.5rem 0;
        min-height: 44px;
        /* Align titles */
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .wishlist-price {
        font-size: 1.25rem;
        font-weight: 700;
        color: #F59E0B;
        /* Orange */
        margin-bottom: 1.5rem;
    }

    .wishlist-variants-label {
        font-size: 0.85rem;
        color: #666;
        margin-bottom: 0.5rem;
        text-align: left;
    }

    .wishlist-variants {
        display: flex;
        gap: 0.5rem;
        margin-bottom: 1.5rem;
        flex-wrap: wrap;
        justify-content: center;
    }

    .variant-pill {
        background: #fff;
        border: 1px solid #ddd;
        border-radius: 20px;
        padding: 6px 16px;
        font-size: 0.85rem;
        color: #555;
        cursor: pointer;
        transition: all 0.2s;
    }

    .variant-pill:hover {
        border-color: #F59E0B;
    }

    .variant-pill.active {
        border-color: #F59E0B;
        background: #FFFBEB;
        color: #F59E0B;
        font-weight: 600;
    }

    .btn-add-cart {
        width: 100%;
        background: #F59E0B;
        /* Orange */
        color: white;
        border: none;
        padding: 12px;
        border-radius: 8px;
        font-weight: 600;
        font-size: 1rem;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: background 0.2s;
    }

    .btn-add-cart:hover {
        background: #d97706;
    }

    /* Security Section Desktop - Minimal fixes as structure is flex/grid friendly already */
    .session-card {
        padding: 2rem !important;
    }

    .security-2fa-grid {
        display: grid;
        grid-template-columns: 200px 1fr;
        gap: 2rem;
        align-items: start;
        text-align: left;
    }
}