/**
 * Traditional World - Mobile-First Auth & Customer Profile Stylesheet
 * Engineered for 320px, 375px, 414px, 768px, 1024px, 1440px+
 * Adheres strictly to WCAG AA, Touch Ergonomics (>=48px), and iOS Zoom Prevention (>=16px)
 */

/* ==========================================================================
   1. GLOBAL RESET & MOBILE CONTAINER GUARDS
   ========================================================================== */
.auth-page-wrapper,
.profile-page-wrapper {
    width: 100%;
    overflow-x: hidden;
    background-color: var(--color-bg, #FAFAFA);
    min-height: calc(100dvh - 160px);
    padding: 16px 12px 48px;
}

@media (min-width: 768px) {
    .auth-page-wrapper,
    .profile-page-wrapper {
        padding: 36px 24px 64px;
    }
}

@media (min-width: 1024px) {
    .auth-page-wrapper,
    .profile-page-wrapper {
        padding: 48px 32px 80px;
    }
}

/* ==========================================================================
   2. MOBILE-FIRST AUTHENTICATION SHELL (Login & Registration)
   ========================================================================== */
.auth-card-shell {
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
    background: #FFFFFF;
    border: 1px solid rgba(212, 175, 55, 0.4);
    border-radius: var(--radius-md, 8px);
    box-shadow: 0 10px 30px rgba(128, 0, 32, 0.06), 0 2px 10px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

@media (min-width: 1024px) {
    .auth-card-shell.split-layout {
        max-width: 980px;
        display: grid;
        grid-template-columns: 1fr 1.25fr;
        min-height: 620px;
    }
}

/* Auth Brand Side (Mobile: Hidden so login placeholder appears first, Desktop: Rich Crimson Pillar) */
.auth-brand-pillar {
    display: none;
    background: linear-gradient(150deg, #180307 0%, #2A050E 60%, #120205 100%);
    color: #FFFFFF;
    padding: 24px 20px;
    text-align: center;
    position: relative;
    border-bottom: 2px solid var(--color-gold, #D4AF37);
}

@media (min-width: 1024px) {
    .auth-brand-pillar {
        display: flex;
        padding: 48px 40px;
        text-align: left;
        flex-direction: column;
        justify-content: space-between;
        border-bottom: none;
        border-right: 1px solid rgba(212, 175, 55, 0.35);
    }
}

.auth-brand-pillar .brand-logo-frame {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(212, 175, 55, 0.5);
    border-radius: 999px;
    margin-bottom: 14px;
    backdrop-filter: blur(8px);
}

.auth-brand-pillar .brand-logo-frame img {
    height: 38px;
    width: auto;
    object-fit: contain;
}

.auth-brand-pillar h2 {
    color: #FFFFFF;
    font-family: var(--font-heading, 'Playfair Display', serif);
    font-size: 1.5rem;
    margin-bottom: 6px;
    letter-spacing: -0.01em;
}

@media (min-width: 768px) {
    .auth-brand-pillar h2 {
        font-size: 1.9rem;
    }
}

.auth-brand-pillar p {
    color: #DCD5CD;
    font-size: 0.88rem;
    line-height: 1.5;
    margin: 0;
}

/* Feature bullets shown on desktop */
.auth-features-list {
    display: none;
    margin-top: 32px;
}

@media (min-width: 1024px) {
    .auth-features-list {
        display: flex;
        flex-direction: column;
        gap: 16px;
    }
}

.auth-feature-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 0.88rem;
    color: #E7E2DA;
}

.auth-feature-item .icon {
    color: var(--color-gold, #D4AF37);
    font-size: 1.1rem;
    line-height: 1;
}

/* Form Container Side */
.auth-form-body {
    padding: 24px 18px 32px;
    background: #FFFFFF;
}

@media (min-width: 414px) {
    .auth-form-body {
        padding: 28px 24px 36px;
    }
}

@media (min-width: 768px) {
    .auth-form-body {
        padding: 36px 36px 44px;
    }
}

/* Tab Switcher (Touch targets >= 48px) */
.auth-nav-tabs {
    display: flex;
    width: 100%;
    background: #F4EFEB;
    border-radius: 8px;
    padding: 4px;
    margin-bottom: 24px;
    gap: 4px;
}

.auth-tab-btn {
    flex: 1;
    min-height: 48px;
    border: none;
    background: transparent;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-text-muted, #6B6363);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    -webkit-tap-highlight-color: transparent;
}

.auth-tab-btn:hover {
    color: var(--color-maroon, #800020);
}

.auth-tab-btn.active {
    background: #FFFFFF;
    color: var(--color-maroon, #800020);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    font-weight: 700;
}

/* ==========================================================================
   3. FORM & TOUCH ERGONOMICS (>=48px touch, >=16px font on iOS)
   ========================================================================== */
.form-field-group {
    margin-bottom: 20px;
    position: relative;
    text-align: left;
}

.form-field-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--color-maroon, #800020);
    margin-bottom: 6px;
}

.form-field-label .helper-link {
    font-size: 0.82rem;
    color: var(--color-maroon, #800020);
    text-decoration: underline;
    font-weight: 500;
    min-height: 24px;
    display: inline-flex;
    align-items: center;
}

/* Base Form Input: Strictly 16px to prevent iOS Safari auto-zoom */
.touch-input {
    width: 100%;
    min-height: 48px;
    padding: 12px 16px;
    font-size: 16px !important; /* Critical for iOS Safari zoom prevention */
    font-family: inherit;
    line-height: 1.4;
    color: var(--color-text-main, #211D1D);
    background: #FAF8F5;
    border: 1.5px solid var(--color-border, #E8E2D8);
    border-radius: var(--radius-sm, 4px);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    -webkit-appearance: none;
    appearance: none;
}

.touch-input:focus {
    outline: none;
    background: #FFFFFF;
    border-color: var(--color-gold, #D4AF37);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.22);
}

/* Password wrapper with 48x48px touch toggle */
.password-field-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.password-field-wrapper .touch-input {
    padding-right: 50px;
}

.touch-password-toggle {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 48px;
    height: 48px;
    min-height: 48px;
    min-width: 48px;
    border: none;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #7A726D;
    border-radius: 0 4px 4px 0;
    transition: color 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.touch-password-toggle:hover,
.touch-password-toggle:focus {
    color: var(--color-maroon, #800020);
    outline: none;
}

/* Field Validation Errors */
.form-field-group.has-error .touch-input {
    border-color: #D32F2F;
    background: #FFFDFD;
    box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.12);
}

.field-error-message {
    display: none;
    font-size: 0.8rem;
    color: #D32F2F;
    margin-top: 5px;
    font-weight: 500;
    align-items: center;
    gap: 4px;
}

.form-field-group.has-error .field-error-message {
    display: flex;
}

/* Password Strength Indicator */
.password-meter-wrap {
    margin-top: 6px;
    display: none;
}

.password-meter-bar {
    height: 4px;
    width: 100%;
    background: #E8E2D8;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 4px;
}

.password-meter-fill {
    height: 100%;
    width: 0%;
    transition: width 0.3s ease, background-color 0.3s ease;
}

.password-meter-label {
    font-size: 0.75rem;
    color: var(--color-text-muted, #6B6363);
    display: flex;
    justify-content: space-between;
}

/* Primary Touch Button */
.touch-btn-primary {
    width: 100%;
    min-height: 48px;
    padding: 13px 20px;
    background: var(--color-maroon, #800020);
    color: #FFFFFF;
    font-size: 1rem;
    font-weight: 600;
    border: 1px solid rgba(212, 175, 55, 0.6);
    border-radius: var(--radius-sm, 4px);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 14px rgba(128, 0, 32, 0.18);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    -webkit-tap-highlight-color: transparent;
}

.touch-btn-primary:hover,
.touch-btn-primary:focus {
    background: var(--color-maroon-dark, #580016);
    box-shadow: 0 6px 18px rgba(128, 0, 32, 0.28);
    transform: translateY(-1px);
}

.touch-btn-primary:active {
    transform: translateY(1px);
    box-shadow: 0 2px 8px rgba(128, 0, 32, 0.14);
}

.touch-btn-primary:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}

/* Touch Outlined Button */
.touch-btn-outline {
    width: 100%;
    min-height: 48px;
    padding: 12px 18px;
    background: transparent;
    color: var(--color-maroon, #800020);
    font-size: 0.95rem;
    font-weight: 600;
    border: 1.5px solid var(--color-gold, #D4AF37);
    border-radius: var(--radius-sm, 4px);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.touch-btn-outline:hover {
    background: var(--color-gold-pale, #FBF7E8);
    border-color: var(--color-gold-dark, #AA820A);
}

/* Stacked Social / OTP Actions (Vertical on mobile) */
.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 22px 0;
    color: var(--color-text-muted, #6B6363);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--color-border, #E8E2D8);
}

.auth-divider span {
    padding: 0 12px;
}

.social-actions-vertical {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.btn-social-touch {
    width: 100%;
    min-height: 48px;
    padding: 12px 16px;
    background: #FFFFFF;
    border: 1px solid var(--color-border, #E8E2D8);
    border-radius: var(--radius-sm, 4px);
    color: var(--color-text-main, #211D1D);
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-social-touch:hover {
    background: #FAF8F5;
    border-color: var(--color-gold, #D4AF37);
}

/* Alert Toast Banners */
.auth-status-alert {
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 0.88rem;
    margin-bottom: 20px;
    display: none;
    align-items: flex-start;
    gap: 10px;
    line-height: 1.4;
}

.auth-status-alert.error {
    display: flex;
    background: #FFEBEE;
    color: #B71C1C;
    border: 1px solid #FFCDD2;
}

.auth-status-alert.success {
    display: flex;
    background: #E8F5E9;
    color: #1B5E20;
    border: 1px solid #C8E6C9;
}

.auth-status-alert.info {
    display: flex;
    background: #FFF8E1;
    color: #7B5200;
    border: 1px solid #FFE082;
}

/* ==========================================================================
   4. PROFILE PAGE MOBILE-FIRST ARCHITECTURE
   ========================================================================== */
.profile-shell-container {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
}

/* Mobile Profile Header */
.profile-hero-card {
    background: linear-gradient(135deg, #1C0308 0%, #3B0613 100%);
    border-bottom: 2px solid var(--color-gold, #D4AF37);
    color: #FFFFFF;
    padding: 24px 16px;
    border-radius: 8px 8px 0 0;
    margin-bottom: 16px;
}

@media (min-width: 768px) {
    .profile-hero-card {
        padding: 32px 28px;
        border-radius: 8px;
        margin-bottom: 28px;
    }
}

.profile-hero-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
}

@media (min-width: 768px) {
    .profile-hero-inner {
        flex-direction: row;
        text-align: left;
        gap: 24px;
    }
}

.profile-avatar-emblem {
    width: 72px;
    height: 72px;
    min-width: 72px;
    min-height: 72px;
    border-radius: 50%;
    background: var(--color-gold-pale, #FBF7E8);
    border: 2px solid var(--color-gold, #D4AF37);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--color-maroon, #800020);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}

.profile-info-block h2 {
    font-family: var(--font-heading, 'Playfair Display', serif);
    font-size: 1.4rem;
    color: #FFFFFF;
    margin-bottom: 4px;
}

@media (min-width: 768px) {
    .profile-info-block h2 {
        font-size: 1.7rem;
    }
}

.profile-info-block .patron-meta {
    font-size: 0.85rem;
    color: #DFD7CF;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

@media (min-width: 768px) {
    .profile-info-block .patron-meta {
        justify-content: flex-start;
    }
}

/* Horizontal Scrolling Touch Pill Tabs for Mobile */
.profile-tabs-scroll-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin-bottom: 24px;
    padding-bottom: 4px;
}

.profile-tabs-scroll-wrapper::-webkit-scrollbar {
    display: none;
}

.profile-tabs-nav {
    display: flex;
    gap: 8px;
    min-width: max-content;
    padding: 2px;
}

@media (min-width: 1024px) {
    .profile-layout-grid {
        display: grid;
        grid-template-columns: 280px 1fr;
        gap: 36px;
        align-items: start;
    }

    .profile-tabs-scroll-wrapper {
        overflow: visible;
        margin-bottom: 0;
    }

    .profile-tabs-nav {
        flex-direction: column;
        min-width: 100%;
        background: #FFFFFF;
        border: 1px solid var(--color-border, #E8E2D8);
        border-radius: var(--radius-md, 8px);
        padding: 12px;
        box-shadow: var(--shadow-soft, 0 4px 20px rgba(0,0,0,0.04));
    }
}

.profile-tab-pill {
    min-height: 48px;
    padding: 12px 18px;
    border-radius: 8px;
    border: 1px solid var(--color-border, #E8E2D8);
    background: #FFFFFF;
    color: var(--color-text-main, #211D1D);
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    -webkit-tap-highlight-color: transparent;
}

.profile-tab-pill:hover {
    border-color: var(--color-gold, #D4AF37);
    color: var(--color-maroon, #800020);
    background: #FAF8F5;
}

.profile-tab-pill.active {
    background: var(--color-maroon, #800020);
    color: #FFFFFF;
    border-color: var(--color-gold, #D4AF37);
    box-shadow: 0 4px 12px rgba(128, 0, 32, 0.18);
}

.profile-tab-pill .pill-badge {
    background: var(--color-gold-pale, #FBF7E8);
    color: var(--color-maroon, #800020);
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
}

.profile-tab-pill.active .pill-badge {
    background: #FFFFFF;
    color: var(--color-maroon, #800020);
}

/* ==========================================================================
   5. ORDER HISTORY: MOBILE CARD SYSTEM (< 768px) & TABLE HYBRID
   ========================================================================== */
.order-cards-list {
    display: flex;
    flex-direction: column;
    gap: 18px;
    width: 100%;
}

.order-history-card {
    background: #FFFFFF;
    border: 1px solid var(--color-border, #E8E2D8);
    border-radius: var(--radius-md, 8px);
    padding: 18px 16px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

@media (min-width: 768px) {
    .order-history-card {
        padding: 24px;
    }
}

.order-history-card:hover {
    border-color: var(--color-gold, #D4AF37);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
}

/* Order Header Row */
.order-card-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    border-bottom: 1px solid #EFEAE3;
    padding-bottom: 14px;
    margin-bottom: 16px;
}

.order-num-group .order-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--color-text-muted, #6B6363);
    font-weight: 600;
    letter-spacing: 0.05em;
}

.order-num-group .order-id-title {
    font-size: 1.05rem;
    color: var(--color-maroon, #800020);
    font-weight: 700;
    margin: 2px 0 0 0;
}

.order-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.order-status-badge.pending {
    background: #FFF9E6;
    color: #8D6708;
    border: 1px solid #FFE699;
}

.order-status-badge.confirmed {
    background: #E8F5E9;
    color: #1B5E20;
    border: 1px solid #C8E6C9;
}

.order-status-badge.transit {
    background: #E3F2FD;
    color: #0D47A1;
    border: 1px solid #BBDEFB;
}

.order-status-badge.delivered {
    background: #FAF5E8;
    color: #6C5200;
    border: 1px solid #D4AF37;
}

.order-status-badge.rejected {
    background: #FCE8E6;
    color: #C5221F;
    border: 1px solid #F5C6CB;
}

/* Order Items: Aspect Ratio Preserved Saree Thumbnails */
.order-items-stack {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 18px;
}

.order-saree-item-row {
    display: flex;
    align-items: center;
    gap: 14px;
}

.order-saree-thumb-wrap {
    width: 64px;
    height: 80px;
    min-width: 64px;
    min-height: 80px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--color-border, #E8E2D8);
    background: #F9F7F4;
    aspect-ratio: 4 / 5;
    flex-shrink: 0;
}

.order-saree-thumb-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.order-item-meta {
    flex: 1;
    min-width: 0;
}

.order-item-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-text-main, #211D1D);
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.order-item-subtext {
    font-size: 0.8rem;
    color: var(--color-text-muted, #6B6363);
    line-height: 1.4;
}

.order-item-price {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--color-maroon, #800020);
    margin-top: 4px;
}

/* Order Summary & Actions Footer */
.order-card-footer {
    display: flex;
    flex-direction: column;
    gap: 12px;
    border-top: 1px dashed var(--color-border, #E8E2D8);
    padding-top: 14px;
}

@media (min-width: 768px) {
    .order-card-footer {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

.order-total-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

@media (min-width: 768px) {
    .order-total-info {
        flex-direction: column;
        align-items: flex-start;
    }
}

.order-total-info .meta-caption {
    font-size: 0.78rem;
    color: var(--color-text-muted, #6B6363);
}

.order-total-info .total-price-large {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--color-maroon, #800020);
}

.order-card-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

@media (min-width: 480px) {
    .order-card-actions {
        flex-direction: row;
        width: auto;
    }
}

.order-action-btn {
    min-height: 48px;
    padding: 10px 18px;
    font-size: 0.88rem;
    font-weight: 600;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    cursor: pointer;
    flex: 1;
    -webkit-tap-highlight-color: transparent;
}

/* Empty State Card */
.empty-state-card {
    text-align: center;
    padding: 48px 24px;
    background: #FFFFFF;
    border: 1px dashed var(--color-border, #E8E2D8);
    border-radius: 8px;
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 12px;
    display: inline-block;
}

.empty-state-title {
    font-size: 1.25rem;
    color: var(--color-maroon, #800020);
    margin-bottom: 6px;
}

.empty-state-desc {
    color: var(--color-text-muted, #6B6363);
    font-size: 0.9rem;
    max-width: 420px;
    margin: 0 auto 20px;
}

/* ==========================================================================
   6. SAVED ADDRESSES & PROFILE EDITORS
   ========================================================================== */
.address-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

@media (min-width: 768px) {
    .address-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.address-item-card {
    background: #FFFFFF;
    border: 1px solid var(--color-border, #E8E2D8);
    border-radius: var(--radius-md, 8px);
    padding: 20px;
    position: relative;
}

.address-item-card.is-default {
    border-color: var(--color-gold, #D4AF37);
    background: #FDFCF9;
}

.address-badge-pill {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--color-gold-pale, #FBF7E8);
    color: var(--color-gold-dark, #AA820A);
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.address-recipient-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--color-maroon, #800020);
    margin-bottom: 6px;
}

.address-body-text {
    font-size: 0.88rem;
    color: var(--color-text-muted, #6B6363);
    line-height: 1.5;
    margin-bottom: 14px;
}

.address-actions-row {
    display: flex;
    gap: 10px;
    padding-top: 12px;
    border-top: 1px solid #EFEAE3;
}

/* Profile Form Card */
.profile-form-card {
    background: #FFFFFF;
    border: 1px solid var(--color-border, #E8E2D8);
    border-radius: var(--radius-md, 8px);
    padding: 24px 18px;
}

@media (min-width: 768px) {
    .profile-form-card {
        padding: 32px;
    }
}

.profile-form-card h3 {
    font-size: 1.3rem;
    color: var(--color-maroon, #800020);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #EFEAE3;
}

/* ==========================================================================
   7. DEDICATED ACCOUNT.HTML MOBILE-FIRST RESPONSIVE ARCHITECTURE
   ========================================================================== */

/* Main Layout Grid */
.account-layout-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    align-items: start;
    width: 100%;
}

@media (min-width: 992px) {
    .account-layout-grid {
        grid-template-columns: 280px 1fr;
        gap: 36px;
    }
}

/* Sidebar Box Container */
.account-sidebar-box {
    background: #FFFFFF;
    border: 1px solid var(--color-border, #E8E2D8);
    border-radius: var(--radius-sm, 6px);
    padding: 18px;
    box-shadow: var(--shadow-soft, 0 4px 20px rgba(0,0,0,0.04));
    width: 100%;
}

@media (min-width: 992px) {
    .account-sidebar-box {
        padding: 22px;
        position: sticky;
        top: 96px;
    }
}

/* Patron Profile Card inside Sidebar */
.account-patron-profile-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-bottom: 16px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--color-border, #E8E2D8);
    text-align: left;
}

@media (min-width: 992px) {
    .account-patron-profile-card {
        flex-direction: column;
        text-align: center;
        padding-bottom: 20px;
        margin-bottom: 18px;
    }
}

.account-patron-avatar {
    width: 54px;
    height: 54px;
    min-width: 54px;
    min-height: 54px;
    border-radius: 50%;
    background: var(--color-gold-pale, #FBF7E8);
    border: 2px solid var(--color-gold, #D4AF37);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--color-maroon, #800020);
    box-shadow: 0 4px 12px rgba(128, 0, 32, 0.12);
}

@media (min-width: 992px) {
    .account-patron-avatar {
        width: 68px;
        height: 68px;
        min-width: 68px;
        min-height: 68px;
        font-size: 1.8rem;
        margin-bottom: 10px;
    }
}

.account-patron-meta {
    flex: 1;
    min-width: 0;
}

.account-patron-meta h4 {
    font-size: 1.1rem;
    margin: 0 0 2px 0;
    color: var(--color-maroon, #800020);
    font-family: var(--font-heading, 'Playfair Display', serif);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.account-patron-meta .patron-role-badge {
    font-size: 0.78rem;
    color: var(--color-text-muted, #7A726A);
}

.account-patron-meta .patron-email-text {
    font-size: 0.8rem;
    color: var(--color-maroon, #800020);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Tab Navigation Buttons */
.account-tabs-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
}

@media (max-width: 440px) {
    .account-tabs-nav {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 992px) {
    .account-tabs-nav {
        display: flex;
        flex-direction: column;
        gap: 6px;
    }
}

.account-nav-tab {
    min-height: 48px;
    padding: 10px 14px;
    border-radius: var(--radius-sm, 6px);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    border: 1px solid var(--color-border, #E8E2D8);
    background: #FFFFFF;
    color: var(--color-text-main, #211D1D);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    -webkit-tap-highlight-color: transparent;
    text-align: left;
    width: 100%;
}

.account-nav-tab:hover {
    border-color: var(--color-gold, #D4AF37);
    color: var(--color-maroon, #800020);
    background: #FAF8F5;
}

.account-nav-tab.active {
    background: var(--color-maroon, #800020) !important;
    color: #FFFFFF !important;
    border-color: var(--color-gold, #D4AF37) !important;
    box-shadow: 0 4px 14px rgba(128, 0, 32, 0.2) !important;
}

.account-nav-tab.active .badge-tag {
    background: #FFFFFF !important;
    color: var(--color-maroon, #800020) !important;
}

/* Prominent Sidebar Logout Button */
.account-sidebar-logout-btn {
    margin-top: 14px;
    border: 1px solid rgba(198, 40, 40, 0.4);
    background: #FFF5F5;
    color: #C62828;
    text-align: left;
    padding: 12px 14px;
    border-radius: var(--radius-sm, 6px);
    width: 100%;
    min-height: 48px;
    cursor: pointer;
    font-size: 0.88rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 600;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.account-sidebar-logout-btn:hover {
    background: #FFEBEB;
    border-color: #C62828;
}

/* ==========================================================================
   8. 5-STAGE SHIPMENT TIMELINE (HORIZONTAL DESKTOP & VERTICAL MOBILE)
   ========================================================================== */
.timeline-steps {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    position: relative;
    margin: 36px 0 32px 0;
}

.timeline-steps::before {
    content: '';
    position: absolute;
    top: 22px;
    left: 40px;
    right: 40px;
    height: 2px;
    border-top: 2px dashed rgba(212, 175, 55, 0.45);
    z-index: 1;
}

.timeline-step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    z-index: 2;
}

.timeline-node-circle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    margin-bottom: 10px;
    font-size: 1rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    background: #FFFFFF;
    transition: all 0.2s ease;
}

.timeline-node-circle.tracking-active-node {
    animation: goldPulse 2s infinite ease-in-out;
}

@keyframes goldPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.6);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(212, 175, 55, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(212, 175, 55, 0);
    }
}

.timeline-step-info {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.timeline-step-title {
    font-size: 0.85rem;
    margin-bottom: 2px;
    color: var(--color-maroon, #800020);
    font-weight: 700;
}

.timeline-step-desc {
    font-size: 0.74rem;
    color: var(--color-text-muted, #7A726A);
}

/* Mobile Stepper Transformation (Screens <= 680px) */
@media (max-width: 680px) {
    .timeline-steps {
        display: flex !important;
        flex-direction: column !important;
        gap: 22px !important;
        position: relative !important;
        padding-left: 28px !important;
        margin: 24px 0 !important;
    }

    .timeline-steps::before {
        content: '' !important;
        position: absolute !important;
        left: 17px !important;
        top: 14px !important;
        bottom: 14px !important;
        width: 2px !important;
        height: auto !important;
        border-top: none !important;
        border-left: 2px dashed var(--color-gold, #D4AF37) !important;
        z-index: 1 !important;
    }

    .timeline-step-item {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        text-align: left !important;
        gap: 16px !important;
        position: relative !important;
        z-index: 2 !important;
    }

    .timeline-node-circle {
        width: 38px !important;
        height: 38px !important;
        min-width: 38px !important;
        min-height: 38px !important;
        margin-bottom: 0 !important;
        font-size: 0.95rem !important;
        box-shadow: 0 2px 8px rgba(0,0,0,0.15) !important;
    }

    .timeline-step-info {
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 2px !important;
    }

    .timeline-step-title {
        font-size: 0.92rem !important;
        font-weight: 700 !important;
        color: var(--color-maroon, #800020) !important;
        margin: 0 !important;
    }

    .timeline-step-desc {
        font-size: 0.78rem !important;
        color: var(--color-text-muted, #7A726A) !important;
    }
}

/* ==========================================================================
   9. MOBILE FORM & BUTTON ERGONOMICS (iOS ZOOM DEFENSE & TOUCH TARGETS)
   ========================================================================== */
@media (max-width: 768px) {
    /* Prevent iOS auto-zooming by enforcing 16px font-size minimum */
    .account-layout-grid input[type="text"],
    .account-layout-grid input[type="email"],
    .account-layout-grid input[type="tel"],
    .account-layout-grid input[type="number"],
    .account-layout-grid select,
    .account-layout-grid textarea,
    #tracking-input,
    #new-addr-name,
    #new-addr-phone,
    #new-addr-type,
    #new-addr-street,
    #new-addr-city,
    #new-addr-state,
    #new-addr-pincode,
    #prof-name,
    #prof-email,
    #prof-phone {
        font-size: 16px !important;
        min-height: 46px;
    }

    /* Full-width responsive search & action buttons */
    #tracking-search-form {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    #tracking-search-form > div {
        min-width: 100% !important;
    }

    #tracking-search-form button {
        width: 100% !important;
        justify-content: center !important;
        min-height: 48px !important;
    }

    .tracking-dest-card {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 14px !important;
    }

    .tracking-invoice-btn-wrap button {
        width: 100% !important;
        justify-content: center !important;
        min-height: 46px !important;
    }

    #tracking-detail-card {
        padding: 20px 16px !important;
    }
}

/* ==========================================================================
   10. ORDER HISTORY ZERO-BLOWOUT RESPONSIVE SUITE & MOBILE HEADER
   ========================================================================== */

/* Zero-Blowout Mobile Defense for Account Page Grid & Main Container */
.account-layout-grid {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
}

.account-main-content,
.account-layout-grid > main,
.account-content-section,
.orders-list-container,
#orders-list-container {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
}

/* Section Header Bar */
.account-section-header {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 22px;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
}

@media (min-width: 640px) {
    .account-section-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 16px;
    }
}

.account-section-titles-wrap {
    flex: 1;
    min-width: 0;
}

.account-section-title {
    font-size: clamp(1.15rem, 4vw, 1.45rem);
    margin-bottom: 4px;
    font-family: var(--font-heading, 'Playfair Display', serif);
    color: var(--color-maroon, #800020);
    line-height: 1.3;
    overflow-wrap: break-word;
    word-break: break-word;
}

.account-section-subtitle {
    font-size: clamp(0.78rem, 2.5vw, 0.86rem);
    color: var(--color-text-muted, #6B6363);
    margin: 0;
    line-height: 1.45;
    overflow-wrap: break-word;
    word-break: break-word;
}

.account-section-action {
    padding: 9px 18px;
    font-size: 0.84rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 42px;
    white-space: nowrap;
    border-radius: var(--radius-sm, 4px);
    flex-shrink: 0;
}

@media (max-width: 639px) {
    .account-section-action {
        width: 100%;
    }
}

/* Order Card Mobile Structure */
.order-card {
    background: #FFFFFF;
    border: 1.5px solid var(--color-border, #E8E2D8);
    border-radius: var(--radius-sm, 6px);
    padding: 16px 14px;
    box-shadow: var(--shadow-soft, 0 4px 20px rgba(0,0,0,0.04));
    transition: all 0.25s ease;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    overflow: hidden;
}

@media (min-width: 600px) {
    .order-card {
        padding: 22px 24px;
    }
}

.order-card:hover {
    border-color: var(--color-gold, #D4AF37);
    box-shadow: 0 6px 24px rgba(128, 0, 32, 0.08);
}

.order-card-header-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    border-bottom: 1px solid var(--color-border, #E8E2D8);
    padding-bottom: 14px;
    margin-bottom: 16px;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.order-card-header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
    min-width: 0;
    flex-wrap: wrap;
}

.order-ref-block {
    flex: 1;
    min-width: 140px;
}

.order-card-meta-label {
    font-size: 0.74rem;
    text-transform: uppercase;
    color: var(--color-text-muted, #6B6363);
    letter-spacing: 0.05em;
    font-weight: 600;
    display: block;
    margin-bottom: 2px;
}

.order-card-ref-num {
    font-size: clamp(1.05rem, 3.2vw, 1.2rem);
    margin-bottom: 0;
    color: var(--color-maroon, #800020);
    font-family: var(--font-heading, 'Playfair Display', serif);
    font-weight: 700;
    overflow-wrap: break-word;
    word-break: break-all;
    line-height: 1.25;
}

.order-card-date-meta {
    font-size: 0.78rem;
    color: var(--color-text-muted, #6B6363);
    margin-top: 2px;
}

.order-card-badge-wrap {
    flex-shrink: 0;
    max-width: 100%;
}

.order-card-header-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-width: 0;
    padding-top: 8px;
    border-top: 1px dashed rgba(212, 175, 55, 0.25);
}

.order-amount-block {
    min-width: 0;
}

.order-card-amount {
    font-size: clamp(1.05rem, 3vw, 1.2rem);
    font-weight: 700;
    color: var(--color-maroon, #800020);
    line-height: 1.2;
}

.order-card-items-meta {
    font-size: 0.78rem;
    color: var(--color-gold-dark, #AA820A);
    font-weight: 600;
    background: var(--color-gold-pale, #FBF7E8);
    padding: 3px 8px;
    border-radius: 999px;
    white-space: nowrap;
}

.order-card-footer-flex {
    display: flex;
    flex-direction: column;
    gap: 12px;
    border-top: 1px dashed var(--color-border, #E8E2D8);
    padding-top: 14px;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

@media (min-width: 680px) {
    .order-card-footer-flex {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

.order-carrier-info {
    font-size: 0.8rem;
    color: var(--color-text-muted, #6B6363);
    line-height: 1.45;
    overflow-wrap: anywhere;
    word-break: break-word;
    min-width: 0;
    max-width: 100%;
}

.order-card-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    min-width: 0;
}

@media (min-width: 480px) {
    .order-card-actions {
        flex-direction: row;
        width: auto;
    }
}

.order-card-actions button,
.order-card-actions .btn {
    min-height: 44px;
    padding: 9px 16px;
    font-size: 0.84rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    text-align: center;
    box-sizing: border-box;
}

@media (min-width: 480px) {
    .order-card-actions button,
    .order-card-actions .btn {
        width: auto;
    }
}

@media (max-width: 680px) {
    #add-address-form-wrap,
    .profile-credentials-box {
        padding: 16px 14px !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    .address-form-actions {
        flex-direction: column !important;
        width: 100% !important;
    }

    .address-form-actions button {
        width: 100% !important;
        min-height: 44px !important;
    }
}



