/* =========================================================
   ICAR BAZAR LUXURY WEB MARKETPLACE - NAVY & CRISP WHITE THEME
   (100% Matched to Flutter Mobile App)
   ========================================================= */

:root {
    --bg-page: #f1f5f9;
    --bg-surface: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #ffffff;
    --bg-input: #f8fafc;
    
    --navy-dark: #071326;
    --navy-header: #0b1c36;
    --navy-surface: #102445;
    --navy-card: #152e59;
    --navy-accent: #1e3a8a;
    --navy-light: #eff6ff;

    --gold-primary: #f59e0b;
    --gold-gradient: linear-gradient(135deg, #f59e0b, #d97706);
    --gold-light: #fffbeb;
    --gold-border: #fde68a;

    --super-vip-gradient: linear-gradient(135deg, #fbbf24, #f59e0b);

    --green-wa: #10b981;
    --green-wa-hover: #059669;
    --green-light: #ecfdf5;

    --text-navy: #071326;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-sub: #475569;
    
    --border-light: #e2e8f0;
    --border-hover: #cbd5e1;
    --shadow-soft: 0 4px 20px -2px rgba(11, 28, 54, 0.08);
    --shadow-hover: 0 16px 36px -4px rgba(11, 28, 54, 0.14);

    --font-en: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    --font-ar: 'Noto Kufi Arabic', 'Plus Jakarta Sans', sans-serif;
}

[dir="rtl"] {
    font-family: var(--font-ar);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    overflow-x: hidden;
    max-width: 100vw;
}

body {
    background-color: var(--bg-page);
    color: var(--text-main);
    font-family: var(--font-en);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    max-width: 100vw;
    width: 100%;
}

a {
    color: inherit;
    text-decoration: none;
}

/* =========================================================
   TOPBAR NAVBAR (DEEP LUXURY NAVY)
   ========================================================= */
header.web-header {
    background: var(--navy-header);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 0 32px;
    box-shadow: 0 4px 24px rgba(7, 19, 38, 0.25);
}

.header-container {
    max-width: 1680px;
    width: 100%;
    margin: 0 auto;
    height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo-img {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    object-fit: cover;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
    border: 1.5px solid rgba(245, 158, 11, 0.6);
}

.brand-title h1 {
    font-size: 22px;
    font-weight: 900;
    color: #ffffff;
    letter-spacing: -0.5px;
    line-height: 1.1;
}

.brand-title span {
    font-size: 10.5px;
    color: var(--gold-primary);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 28px;
}

.nav-link {
    font-size: 14.5px;
    font-weight: 700;
    color: #cbd5e1;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-link:hover, .nav-link.active {
    color: #ffffff;
}

.nav-link.active {
    color: var(--gold-primary);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

@media (max-width: 768px) {
    header.web-header {
        padding: 0 14px;
    }
    .header-container {
        height: 60px;
        gap: 8px;
    }
    .brand-logo {
        gap: 8px;
    }
    .brand-logo-img {
        width: 36px;
        height: 36px;
        border-radius: 10px;
    }
    .brand-title h1 {
        font-size: 16px;
    }
    .brand-title span, .brand-subtitle {
        display: none !important;
    }
    .desktop-nav-links {
        display: none !important;
    }
    .header-actions {
        gap: 6px;
    }
    .header-login-link {
        display: none !important;
    }
    .lang-dropdown {
        padding: 6px 8px;
        font-size: 11.5px;
        border-radius: 8px;
        max-width: 105px;
    }
    .header-sell-btn {
        padding: 7px 11px;
        font-size: 12px;
        border-radius: 9px;
    }
    .header-sell-btn .sell-btn-label {
        display: none;
    }
    .header-user-badge {
        padding: 5px 8px !important;
        font-size: 11.5px !important;
    }
}

/* BUTTONS */
.btn-gold {
    background: var(--gold-gradient);
    color: #071326;
    font-weight: 800;
    font-size: 14px;
    padding: 10px 22px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.3);
    border: none;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}

.btn-gold:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(245, 158, 11, 0.45);
}

.btn-navy {
    background-color: var(--navy-header);
    color: #ffffff;
    font-weight: 700;
    font-size: 13.5px;
    padding: 11px 20px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-navy:hover {
    background-color: var(--navy-dark);
    transform: translateY(-1px);
}

.btn-whatsapp {
    background-color: var(--green-wa);
    color: #ffffff;
    font-weight: 800;
    font-size: 13.5px;
    padding: 11px 20px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.25);
    transition: all 0.15s;
}

.btn-whatsapp:hover {
    background-color: var(--green-wa-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.35);
}

.lang-dropdown {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 12.5px;
    font-weight: 700;
    color: #ffffff;
    cursor: pointer;
    outline: none;
}

.lang-dropdown option {
    background-color: var(--navy-header);
    color: #ffffff;
}

/* =========================================================
   APP-STYLE HERO & BANNER HEADER
   ========================================================= */
.app-hero-header {
    background: linear-gradient(180deg, var(--navy-header) 0%, #0d2345 100%);
    padding: 36px 32px 48px 32px;
    color: #ffffff;
}

.app-hero-container {
    max-width: 1680px;
    width: 100%;
    margin: 0 auto;
}

.hero-app-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.hero-app-title h2 {
    font-size: 28px;
    font-weight: 900;
    letter-spacing: -0.5px;
}

.hero-app-title p {
    font-size: 14px;
    color: #94a3b8;
    margin-top: 2px;
}

/* SEARCH & QUICK FILTERS BAR */
.hero-search-bar {
    background: #ffffff;
    border-radius: 16px;
    padding: 8px 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
    margin-bottom: 24px;
}

.search-input-clean {
    flex: 1;
    border: none;
    outline: none;
    font-size: 15px;
    font-family: inherit;
    padding: 10px 16px;
    color: var(--text-main);
    background: transparent;
}

.search-select-clean {
    border: 1px solid var(--border-light);
    background-color: #f8fafc;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-main);
    outline: none;
}

/* PROMO BANNER (MATCHING APP BANNER) */
.app-promo-banner {
    background: linear-gradient(135deg, #09172e 0%, #15325e 100%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    padding: 24px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    margin-bottom: 8px;
    color: #ffffff;
}

.promo-badge-tag {
    background: rgba(245, 158, 11, 0.2);
    border: 1px solid var(--gold-primary);
    color: var(--gold-primary);
    font-size: 11px;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: 6px;
    display: inline-block;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.promo-title {
    font-size: 22px;
    font-weight: 900;
    letter-spacing: -0.5px;
}

.promo-sub {
    font-size: 13px;
    color: #94a3b8;
    margin-top: 4px;
}

/* =========================================================
   FULL-WIDTH SPACIOUS MAIN WRAPPER
   ========================================================= */
.main-full-wrapper {
    max-width: 1680px;
    width: 100%;
    margin: 0 auto;
    padding: 32px 32px 64px 32px;
    flex: 1;
    box-sizing: border-box;
}

@media (max-width: 768px) {
    .main-full-wrapper {
        padding: 16px 14px 44px 14px;
        width: 100%;
        max-width: 100vw;
    }
}

/* SECTION HEADER */
.feed-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-light);
}

.feed-title {
    font-size: 22px;
    font-weight: 900;
    color: var(--navy-dark);
    display: flex;
    align-items: center;
    gap: 10px;
}

.feed-counter {
    background-color: #e2e8f0;
    color: var(--navy-dark);
    font-size: 12px;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: 99px;
}

/* =========================================================
   APP-MATCHED CAR CARDS (WHITE SURFACE + NAVY ACCENTS)
   ========================================================= */
.app-cars-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 24px;
}

@media (max-width: 768px) {
    .app-cars-grid {
        grid-template-columns: 1fr;
    }
}

.app-car-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-soft);
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    position: relative;
}

.app-car-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: #cbd5e1;
}

.app-car-card.super-vip {
    border: 2px solid #f59e0b;
    box-shadow: 0 8px 28px rgba(245, 158, 11, 0.18);
}

.card-img-box {
    position: relative;
    width: 100%;
    height: 220px;
    background-color: #0f172a;
    overflow: hidden;
}

.card-img-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.app-car-card:hover .card-img-box img {
    transform: scale(1.04);
}

.vip-ribbon {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--gold-gradient);
    color: #071326;
    font-size: 11px;
    font-weight: 900;
    padding: 4px 10px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
    display: flex;
    align-items: center;
    gap: 4px;
    letter-spacing: 0.5px;
}

[dir="rtl"] .vip-ribbon {
    left: auto;
    right: 12px;
}

.city-pill {
    position: absolute;
    bottom: 12px;
    left: 12px;
    background: rgba(7, 19, 38, 0.85);
    backdrop-filter: blur(8px);
    color: #ffffff;
    font-size: 11.5px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 8px;
}

[dir="rtl"] .city-pill {
    left: auto;
    right: 12px;
}

/* THUMBNAILS STRIP BELOW IMAGE */
.card-thumbs-strip {
    display: flex;
    gap: 6px;
    padding: 8px 12px;
    background-color: #f8fafc;
    border-bottom: 1px solid var(--border-light);
    overflow-x: auto;
}

.thumb-mini {
    width: 52px;
    height: 38px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--border-light);
    flex-shrink: 0;
}

.thumb-mini img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* CARD DETAILS BODY */
.app-car-body {
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.card-title-price-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}

.car-name-bold {
    font-size: 18px;
    font-weight: 900;
    color: var(--navy-dark);
    line-height: 1.2;
}

.car-price-bold {
    font-size: 20px;
    font-weight: 900;
    color: var(--gold-primary);
    letter-spacing: -0.5px;
    white-space: nowrap;
}

.car-price-sub {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
    text-align: right;
}

[dir="rtl"] .car-price-sub {
    text-align: left;
}

/* SPECS GRID IN CARD */
.specs-table-mini {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    background-color: #f8fafc;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid var(--border-light);
    margin-bottom: 16px;
}

.spec-item-mini {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-sub);
    font-weight: 600;
}

.spec-item-mini strong {
    color: var(--navy-dark);
    font-weight: 800;
}

/* CARD ACTION BUTTONS */
.card-actions-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid var(--border-light);
}

/* =========================================================
   BRANDS BAR
   ========================================================= */
.brands-slider {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 12px;
    margin-bottom: 32px;
}

.brand-pill-btn {
    background-color: #ffffff;
    border: 1px solid var(--border-light);
    padding: 10px 18px;
    border-radius: 14px;
    font-size: 13.5px;
    font-weight: 800;
    color: var(--navy-dark);
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
    white-space: nowrap;
    transition: all 0.15s;
}

.brand-pill-btn:hover, .brand-pill-btn.active {
    background-color: var(--navy-header);
    color: #ffffff;
    border-color: var(--navy-header);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(11, 28, 54, 0.15);
}

/* =========================================================
   SHOWROOMS DIRECTORY (LUXURY WHITE CARDS)
   ========================================================= */
.showrooms-grid-wide {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 24px;
}

.showroom-card-white {
    background-color: #ffffff;
    border: 1px solid var(--border-light);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
}

.showroom-card-white:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.showroom-card-top {
    height: 120px;
    background: linear-gradient(135deg, var(--navy-header), #1a3c6d);
    position: relative;
    padding: 16px;
    display: flex;
    align-items: flex-end;
}

.showroom-avatar-badge {
    width: 60px;
    height: 60px;
    background: #ffffff;
    border: 3px solid #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    position: absolute;
    bottom: -20px;
    left: 20px;
}

[dir="rtl"] .showroom-avatar-badge {
    left: auto;
    right: 20px;
}

.showroom-card-content {
    padding: 30px 20px 20px 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.showroom-name-title {
    font-size: 17px;
    font-weight: 900;
    color: var(--navy-dark);
}

/* =========================================================
   CAR DETAIL PAGE (SPACIOUS & FULL DATA + RESPONSIVE MOBILE FLOW)
   ========================================================= */
.detail-layout-wide {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    grid-template-areas: 
        "gallery buyer"
        "specs   buyer"
        "specs   .";
    gap: 32px;
    align-items: start;
}

.detail-gallery-section {
    grid-area: gallery;
    width: 100%;
    min-width: 0;
}

.detail-buyer-section {
    grid-area: buyer;
    width: 100%;
    min-width: 0;
}

.detail-specs-section {
    grid-area: specs;
    width: 100%;
    min-width: 0;
}

@media (max-width: 1024px) {
    .detail-layout-wide {
        display: flex;
        flex-direction: column;
        gap: 16px;
    }
    .detail-gallery-section {
        order: 1;
    }
    .detail-buyer-section {
        order: 2;
    }
    .detail-specs-section {
        order: 3;
    }
}

.detail-main-gallery {
    background-color: #ffffff;
    border: 1px solid var(--border-light);
    border-radius: 24px;
    padding: 20px;
    box-shadow: var(--shadow-soft);
    margin-bottom: 0;
}

.gallery-large-frame {
    width: 100%;
    aspect-ratio: 16 / 10;
    max-height: 520px;
    min-height: 220px;
    height: auto;
    background-color: #0b1c36;
    border-radius: 18px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.gallery-large-frame img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.gallery-thumb-item {
    width: 90px;
    height: 64px;
}

@media (max-width: 768px) {
    .detail-main-gallery {
        border-radius: 18px;
        padding: 12px;
    }
    .gallery-large-frame {
        aspect-ratio: 16 / 10;
        max-height: 270px;
        min-height: 190px;
        border-radius: 14px;
    }
    .gallery-thumb-item {
        width: 72px;
        height: 52px;
    }
}

.specs-card-complete {
    background-color: #ffffff;
    border: 1px solid var(--border-light);
    border-radius: 24px;
    padding: 28px;
    box-shadow: var(--shadow-soft);
    margin-bottom: 0;
}

.specs-full-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
}

.spec-cell {
    background-color: #f8fafc;
    border: 1px solid var(--border-light);
    border-radius: 14px;
    padding: 12px 16px;
}

.spec-cell-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.spec-cell-value {
    font-size: 15px;
    font-weight: 800;
    color: var(--navy-dark);
    margin-top: 4px;
}

@media (max-width: 768px) {
    .specs-card-complete {
        border-radius: 18px;
        padding: 18px 14px;
    }
    .specs-full-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .spec-cell {
        padding: 10px 12px;
        border-radius: 12px;
    }
    .spec-cell-label {
        font-size: 10.5px;
    }
    .spec-cell-value {
        font-size: 13px;
    }
}

@media (max-width: 380px) {
    .specs-full-grid {
        grid-template-columns: 1fr;
    }
}

/* SIDEBAR BUYER BOX */
.buyer-sticky-box {
    background-color: #ffffff;
    border: 1.5px solid var(--border-light);
    border-radius: 24px;
    padding: 28px;
    box-shadow: var(--shadow-hover);
    position: sticky;
    top: 96px;
}

@media (max-width: 1024px) {
    .buyer-sticky-box {
        position: static;
        top: auto;
        border-radius: 18px;
        padding: 20px 16px;
        box-shadow: var(--shadow-soft);
    }
}

/* =========================================================
   FOOTER (MATCHED DEEP NAVY)
   ========================================================= */
footer.web-footer {
    background-color: var(--navy-dark);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 56px 32px 32px 32px;
    color: #ffffff;
    margin-top: auto;
}

.footer-container-wide {
    max-width: 1680px;
    width: 100%;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 48px;
    margin-bottom: 40px;
}

@media (max-width: 900px) {
    .footer-container-wide {
        grid-template-columns: 1fr 1fr;
    }
}
@media (max-width: 550px) {
    .footer-container-wide {
        grid-template-columns: 1fr;
    }
}
