/*
Theme Name: Saif Truck Theme
Theme URI: https://saiftruck.com
Author: Saif Truck
Author URI: https://saiftruck.com
Description: قالب موقع ويب احترافي responsive لشركة السيف للشاحنات والمعدات الثقيلة.
Version: 3.0.0
Text Domain: saiftruck
*/

/* =============================================
   1. CSS VARIABLES & RESET
   ============================================= */
:root {
    --primary: #1d3b76;
    --primary-dark: #152c5a;
    --primary-light: #2a52a0;
    --accent: #fbbf24;
    --accent-dark: #d97706;
    --blue-light: #59a5f5;
    --green: #22c55e;
    --red: #ef4444;
    --bg: #f8f9fb;
    --bg-white: #ffffff;
    --text-dark: #1a1a2e;
    --text-mid: #4b5563;
    --text-light: #9ca3af;
    --border: #e5e7eb;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.10);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.14);
    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 16px;
    --transition: all 0.25s ease;
    --max-w: 1100px;
    --header-h: 70px;
}

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    overflow-x: hidden;
    width: 100%;
    position: relative;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Cairo', 'Segoe UI', sans-serif;
    direction: rtl;
    background: var(--bg);
    color: var(--text-dark);
    line-height: 1.7;
    font-size: 16px;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
}

ul,
ol {
    list-style: none;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
}

input,
select,
textarea {
    font-family: inherit;
}

/* =============================================
   2. TYPOGRAPHY
   ============================================= */
h1 {
    font-size: clamp(1.6rem, 4vw, 2.4rem);
    font-weight: 800;
}

h2 {
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    font-weight: 700;
}

h3 {
    font-size: clamp(1rem, 2.5vw, 1.3rem);
    font-weight: 600;
}

h4 {
    font-size: 1rem;
    font-weight: 600;
}

/* =============================================
   3. LAYOUT UTILITIES
   ============================================= */
.container {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 20px;
}

.section-gap {
    padding: 48px 0;
}

.section-gap-sm {
    padding: 28px 0;
}

.flex {
    display: flex;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.gap-2 {
    gap: 8px;
}

.gap-4 {
    gap: 16px;
}

.gap-6 {
    gap: 24px;
}

/* Grid */
.grid {
    display: grid;
    gap: 20px;
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* =============================================
   4. HEADER
   ============================================= */
.site-header {
    background: var(--primary);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

/* Top Bar */
.header-topbar {
    background: var(--primary-dark);
    padding: 6px 0;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
    display: none;
}

@media (min-width: 768px) {
    .header-topbar {
        display: block;
    }
}

.header-topbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.topbar-contact a {
    color: rgba(255, 255, 255, 0.7);
    margin-left: 20px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
}

.topbar-contact a:hover {
    color: var(--accent);
}

/* Main Header */
.header-main {
    height: var(--header-h);
}

.header-main .container {
    height: 100%;
    display: flex;
    align-items: center;
    gap: 32px;
}

/* Logo */
.site-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.logo-icon {
    width: 44px;
    height: 44px;
    background: var(--accent);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: var(--primary);
}

.logo-text {
    color: white;
    line-height: 1.2;
}

.logo-text strong {
    display: block;
    font-size: 1rem;
    font-weight: 800;
    white-space: nowrap;
}

.logo-text span {
    font-size: 0.72rem;
    color: var(--accent);
    font-weight: 400;
}

/* Desktop Nav */
.desktop-nav {
    display: none;
    align-items: center;
    gap: 4px;
    flex: 1;
}

@media (min-width: 992px) {
    .desktop-nav {
        display: flex;
    }
}

.desktop-nav a {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.92rem;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 7px;
    white-space: nowrap;
}

.desktop-nav a:hover,
.desktop-nav a.active {
    background: rgba(255, 255, 255, 0.12);
    color: white;
}

.desktop-nav a .nav-icon {
    font-size: 0.85rem;
    opacity: 0.8;
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-right: auto;
}

.header-search-btn {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.1rem;
    padding: 8px;
    border-radius: 6px;
    transition: var(--transition);
}

.header-search-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: white;
}

.btn-add-listing {
    background: var(--accent);
    color: var(--primary-dark);
    font-size: 0.85rem;
    font-weight: 700;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    display: none;
    align-items: center;
    gap: 7px;
    white-space: nowrap;
}

.btn-add-listing:hover {
    background: var(--accent-dark);
    color: white;
}

@media (min-width: 768px) {
    .btn-add-listing {
        display: flex;
    }
}

/* Mobile Hamburger */
.hamburger-btn {
    color: white;
    font-size: 1.4rem;
    padding: 8px;
    border-radius: 6px;
    transition: var(--transition);
}

.hamburger-btn:hover {
    background: rgba(255, 255, 255, 0.12);
}

@media (min-width: 992px) {
    .hamburger-btn {
        display: none;
    }
}

/* =============================================
   5. MOBILE DRAWER
   ============================================= */
.drawer-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 1800;
    backdrop-filter: blur(2px);
}

.drawer-overlay.open {
    display: block;
}

.mobile-drawer {
    position: fixed;
    top: 0;
    right: -320px;
    width: 300px;
    height: 100%;
    background: var(--primary);
    z-index: 1900;
    transition: all 0.3s ease;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    visibility: hidden;
    pointer-events: none;
}

.mobile-drawer.open {
    right: 0;
    visibility: visible;
    pointer-events: auto;
}

.drawer-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.drawer-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.drawer-logo .logo-icon {
    width: 42px;
    height: 42px;
}

.drawer-close {
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.3rem;
    padding: 6px;
    border-radius: 6px;
    transition: var(--transition);
}

.drawer-close:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.drawer-nav {
    padding: 12px 0;
    flex: 1;
}

.drawer-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 20px;
    color: rgba(255, 255, 255, 0.85) !important;
    font-size: 0.93rem;
    font-weight: 500;
    text-decoration: none !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    transition: var(--transition);
}

.drawer-item:hover,
.drawer-item.active {
    background: rgba(255, 255, 255, 0.1);
    color: white !important;
}

.drawer-item i {
    width: 22px;
    text-align: center;
    font-size: 0.95rem;
    opacity: 0.75;
}

/* =============================================
   19. JOOMLA-STYLE TRUCK DETAILS
   ============================================= */
.vehicle-price-header {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-top: 20px;
    box-shadow: var(--shadow-sm);
}

.price-status-wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.v-status {
    font-weight: 700;
    font-size: 0.9rem;
}

.v-price-box {
    text-align: left;
}

.v-price-label {
    font-size: 0.75rem;
    color: var(--text-mid);
    margin-bottom: 2px;
}

.v-price-eur {
    font-size: 1.8rem;
    font-weight: 800;
    color: #4382f6;
    /* Blueish price like in screenshot */
    line-height: 1;
}

.v-price-sar {
    font-size: 0.85rem;
    color: var(--text-mid);
    margin-top: 4px;
}

/* Action Buttons Row */
.vehicle-action-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 8px;
    margin-top: 12px;
}

.v-action-btn {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px;
    border-radius: var(--radius-sm);
    color: white;
    font-weight: 700;
    font-size: 0.85rem;
    transition: var(--transition);
    text-align: center;
}

.v-action-btn i {
    font-size: 1rem;
}

.v-btn-whatsapp {
    background: #25d366;
}

.v-btn-call {
    background: #3b82f6;
}

.v-btn-email {
    background: #f59e0b;
}

.v-btn-print {
    background: #64748b;
}

.v-btn-share {
    background: #f1f5f9;
    color: #1e293b;
    border: 1px solid var(--border);
}

.v-action-btn:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

/* Grey Title Banner */
.vehicle-name-banner {
    background: #f1f5f9;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 15px 20px;
    margin-top: 20px;
    text-align: center;
}

.vehicle-name-banner h1 {
    font-size: 1.25rem;
    margin: 0;
    color: #1e293b;
    font-weight: 800;
}

/* Iconic Spec Features */
.vehicle-feature-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-top: 20px;
}

.v-feature-box {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px 10px;
    text-align: center;
    transition: var(--transition);
}

.v-feature-box:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.v-feature-icon {
    width: 48px;
    height: 48px;
    background: #eff6ff;
    color: #3b82f6;
    border-radius: 50%;
    margin: 0 auto 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.v-feature-label {
    font-size: 0.72rem;
    color: var(--text-mid);
    margin-bottom: 4px;
}

.v-feature-value {
    font-weight: 700;
    font-size: 0.88rem;
    color: var(--text-dark);
}

@media (max-width: 480px) {
    .vehicle-feature-grid {
        grid-template-columns: 1fr;
    }
}

.drawer-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.drawer-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--accent);
    color: var(--primary-dark);
    font-weight: 700;
    font-size: 0.9rem;
    padding: 12px;
    border-radius: var(--radius);
    transition: var(--transition);
}

.drawer-cta:hover {
    background: var(--accent-dark);
    color: white;
}

/* =============================================
   6. SITE CONTENT
   ============================================= */
#content.site-content {
    min-height: calc(100vh - var(--header-h));
}

/* =============================================
   7. HERO SECTION
   ============================================= */
.hero-section {
    background: linear-gradient(135deg, var(--primary) 0%, #1a4a9e 60%, #0d2d6b 100%);
    padding: 60px 0 50px;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -60px;
    left: -100px;
    width: 500px;
    height: 500px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 50%;
}

.hero-section::after {
    content: '';
    position: absolute;
    bottom: -80px;
    right: -60px;
    width: 350px;
    height: 350px;
    background: rgba(251, 191, 36, 0.07);
    border-radius: 50%;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(251, 191, 36, 0.15);
    border: 1px solid rgba(251, 191, 36, 0.3);
    color: var(--accent);
    font-size: 0.82rem;
    font-weight: 600;
    padding: 6px 16px;
    border-radius: 50px;
    margin-bottom: 18px;
}

.hero-title {
    color: white;
    font-size: clamp(1.6rem, 5vw, 2.8rem);
    font-weight: 800;
    margin-bottom: 14px;
    line-height: 1.3;
}

.hero-title span {
    color: var(--accent);
}

.hero-subtitle {
    color: rgba(255, 255, 255, 0.72);
    font-size: clamp(0.9rem, 2vw, 1.05rem);
    margin-bottom: 32px;
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
}

/* Hero Search */
.hero-search {
    max-width: 600px;
    margin: 0 auto 28px;
    background: white;
    border-radius: var(--radius-lg);
    padding: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

.hero-search input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 0.95rem;
    padding: 8px 14px;
    color: var(--text-dark);
    background: none;
    direction: rtl;
}

.hero-search input::placeholder {
    color: var(--text-light);
}

.hero-search-btn {
    background: var(--primary);
    color: white;
    font-size: 0.9rem;
    font-weight: 700;
    padding: 11px 24px;
    border-radius: 10px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.hero-search-btn:hover {
    background: var(--primary-dark);
}

/* Hero Stats */
.hero-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 32px;
    flex-wrap: wrap;
}

.hero-stat {
    text-align: center;
    color: white;
}

.hero-stat strong {
    display: block;
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--accent);
    line-height: 1;
    margin-bottom: 4px;
}

.hero-stat span {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.65);
}

.hero-divider {
    width: 1px;
    height: 36px;
    background: rgba(255, 255, 255, 0.2);
}

/* =============================================
   8. CATEGORIES BAR
   ============================================= */
.categories-bar {
    background: white;
    border-bottom: 1px solid var(--border);
    padding: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.categories-bar::-webkit-scrollbar {
    display: none;
}

.categories-bar .container {
    display: flex;
    gap: 4px;
    padding: 12px 20px;
    min-width: max-content;
}

.cat-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 18px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-mid);
    background: var(--bg);
    border: 1px solid var(--border);
    transition: var(--transition);
    white-space: nowrap;
}

.cat-chip i {
    font-size: 0.85rem;
}

.cat-chip:hover,
.cat-chip.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* =============================================
   9. SECTION HEADERS
   ============================================= */
.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    gap: 12px;
}

.section-head h2 {
    color: var(--text-dark);
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-head h2::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 22px;
    background: var(--primary);
    border-radius: 2px;
}

.section-head a {
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: var(--transition);
    white-space: nowrap;
    flex-shrink: 0;
}

.section-head a:hover {
    gap: 8px;
}

/* =============================================
   10. PRODUCT CARDS
   ============================================= */
.products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

@media (min-width: 640px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 992px) {
    .products-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Card */
.product-card {
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.card-image {
    position: relative;
    height: 180px;
    overflow: hidden;
    background: var(--bg);
}

@media (min-width: 992px) {
    .card-image {
        height: 200px;
    }
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.product-card:hover .card-image img {
    transform: scale(1.05);
}

.card-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: var(--text-light);
    background: linear-gradient(135deg, #f0f4f8, #e8edf3);
}

.card-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--green);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 20px;
}

.card-badge.sold {
    background: var(--red);
}

.card-body {
    padding: 14px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 10px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.card-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.75rem;
    color: var(--text-light);
    margin-bottom: 10px;
}

.card-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.card-price {
    font-size: 1rem;
    font-weight: 800;
    color: var(--green);
    direction: ltr;
    text-align: right;
}

.card-price small {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-light);
}

/* =============================================
   11. ARCHIVE PAGE LAYOUT
   ============================================= */
.archive-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 28px 0;
    min-width: 0;
    /* الحل السحري لمنع الـ Grid Blowout */
    width: 100%;
}

.archive-layout>* {
    min-width: 0;
}

@media (min-width: 992px) {
    .archive-layout {
        grid-template-columns: 280px 1fr;
        align-items: start;
    }
}

/* Filter Sidebar */
.filter-sidebar {
    background: white;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    overflow: hidden;
    position: sticky;
    top: calc(var(--header-h) + 16px);
}

.filter-sidebar-head {
    padding: 16px 20px;
    background: var(--primary);
    color: white;
    font-weight: 700;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.filter-sidebar-head .clear-all {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 20px;
    cursor: pointer;
    transition: var(--transition);
}

.filter-sidebar-head .clear-all:hover {
    background: rgba(255, 255, 255, 0.25);
}

.filter-group {
    border-bottom: 1px solid var(--border);
    padding: 16px 20px;
}

.filter-group:last-child {
    border-bottom: none;
}

.filter-group label {
    display: block;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-mid);
    margin-bottom: 9px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.filter-select,
.filter-input {
    width: 100%;
    padding: 9px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    color: var(--text-dark);
    background: var(--bg);
    direction: rtl;
    transition: var(--transition);
    appearance: none;
    -webkit-appearance: none;
}

.filter-select:focus,
.filter-input:focus {
    border-color: var(--primary);
    outline: none;
    background: white;
}

.filter-row {
    display: flex;
    gap: 8px;
}

.filter-row .filter-input {
    flex: 1;
}

.filter-submit {
    width: 100%;
    background: var(--primary);
    color: white;
    font-weight: 700;
    font-size: 0.92rem;
    padding: 12px;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
}

.filter-submit:hover {
    background: var(--primary-dark);
}

/* Mobile Filter Button */
.mobile-filter-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--primary);
    color: white;
    font-weight: 700;
    font-size: 0.88rem;
    padding: 10px 18px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
}

.mobile-filter-btn:hover {
    background: var(--primary-dark);
}

@media (min-width: 992px) {
    .mobile-filter-btn {
        display: none;
    }

    .filter-sidebar {
        display: block !important;
    }
}

/* Archive Top Bar */
.archive-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 12px;
    flex-wrap: wrap;
}

.archive-count {
    font-size: 0.9rem;
    color: var(--text-mid);
}

.archive-count strong {
    color: var(--primary);
    font-weight: 700;
}

.archive-sort {
    display: flex;
    align-items: center;
    gap: 8px;
}

.archive-sort select {
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    color: var(--text-dark);
    background: white;
    direction: rtl;
    cursor: pointer;
}

/* Archive Grid */
.archive-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

@media (min-width: 640px) {
    .archive-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1200px) {
    .archive-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    grid-column: 1 / -1;
}

.empty-state i {
    font-size: 3.5rem;
    color: var(--text-light);
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h3 {
    color: var(--text-mid);
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.pagination a,
.pagination span {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    border: 1px solid var(--border);
    background: white;
    color: var(--text-mid);
    transition: var(--transition);
}

.pagination a:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.pagination span.current {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* =============================================
   12. SINGLE VEHICLE PAGE
   ============================================= */
.single-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 28px 0;
    min-width: 0;
    /* الحل السحري لمنع الـ Grid Blowout */
    width: 100%;
}

.single-layout>* {
    min-width: 0;
}

@media (min-width: 992px) {
    .single-layout {
        grid-template-columns: 1fr 380px;
        align-items: start;
    }
}

/* Gallery */
.vehicle-gallery {
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: white;
    border: 1px solid var(--border);
}

.gallery-main {
    position: relative;
    height: 320px;
    overflow: hidden;
    cursor: pointer;
}

@media (min-width: 768px) {
    .gallery-main {
        height: 420px;
    }
}

@media (min-width: 992px) {
    .gallery-main {
        height: 480px;
    }
}

.gallery-main img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-main-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f0f4f8, #e8edf3);
    font-size: 5rem;
    color: var(--text-light);
}

.gallery-thumbs {
    display: flex;
    gap: 8px;
    padding: 10px;
    overflow-x: auto;
    scrollbar-width: none;
    width: 100%;
}

.gallery-thumbs::-webkit-scrollbar {
    display: none;
}

.gallery-thumb {
    width: 76px;
    height: 56px;
    flex-shrink: 0;
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: var(--transition);
}

.gallery-thumb:hover,
.gallery-thumb.active {
    border-color: var(--primary);
}

.gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-count-badge {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    font-size: 0.8rem;
    padding: 4px 12px;
    border-radius: 20px;
    backdrop-filter: blur(4px);
}

/* Vehicle Info Panel */
.vehicle-info-panel {
    background: white;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    overflow: hidden;
}

.vehicle-title-bar {
    padding: 20px 20px 16px;
    border-bottom: 1px solid var(--border);
}

.vehicle-title-bar h1 {
    font-size: 1.25rem;
    color: var(--text-dark);
    margin-bottom: 10px;
    line-height: 1.4;
}

.vehicle-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.vehicle-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    background: var(--bg);
    color: var(--text-mid);
    border: 1px solid var(--border);
}

.vehicle-price-area {
    display: flex;
    align-items: baseline;
    gap: 12px;
    flex-wrap: wrap;
}

.price-main {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--green);
}

.price-sub {
    font-size: 1rem;
    color: var(--text-light);
    font-weight: 500;
}

/* Contact Buttons */
.contact-actions {
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    border-bottom: 1px solid var(--border);
}

.btn-whatsapp {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    background: #25d366;
    color: white;
    font-weight: 700;
    font-size: 0.95rem;
    padding: 13px;
    border-radius: var(--radius);
    transition: var(--transition);
}

.btn-whatsapp:hover {
    background: #128c7e;
}

.btn-call {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    background: var(--primary);
    color: white;
    font-weight: 700;
    font-size: 0.95rem;
    padding: 13px;
    border-radius: var(--radius);
    transition: var(--transition);
}

.btn-call:hover {
    background: var(--primary-dark);
}

.btn-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.btn-secondary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    background: var(--bg);
    color: var(--text-mid);
    font-weight: 600;
    font-size: 0.85rem;
    padding: 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    transition: var(--transition);
}

.btn-secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: white;
}

/* Specs Table */
.specs-panel {
    padding: 16px 20px;
}

.specs-panel h3 {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text-mid);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.specs-table {
    width: 100%;
    border-collapse: collapse;
}

.specs-table tr:not(:last-child) td {
    border-bottom: 1px solid var(--border);
}

.specs-table td,
.specs-table th {
    padding: 10px 4px;
    font-size: 0.88rem;
    word-break: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
}

.specs-table td:first-child {
    color: var(--text-light);
    width: 42%;
}

.specs-table td:last-child {
    font-weight: 600;
    color: var(--text-dark);
}

/* Description */
.vehicle-description {
    background: white;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: 20px;
    margin-top: 20px;
}

.vehicle-description h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
    color: var(--text-dark);
}

.vehicle-description .description-text {
    font-size: 0.92rem;
    color: var(--text-mid);
    line-height: 1.8;
}

/* Related Section */
.related-section {
    background: white;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: 20px;
    margin-top: 20px;
}

/* =============================================
   13. AD CONTAINERS
   ============================================= */
.ad-container {
    background: white;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 12px;
    text-align: center;
    overflow: hidden;
}

.ad-label {
    font-size: 0.68rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 8px;
}

/* =============================================
   14. FOOTER
   ============================================= */
.site-footer {
    background: var(--primary-dark);
    color: rgba(255, 255, 255, 0.8);
    margin-top: 60px;
}

.footer-main {
    padding: 50px 0 36px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

@media (min-width: 640px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (min-width: 992px) {
    .footer-grid {
        grid-template-columns: 2fr 1fr 1fr 1fr;
    }
}

.footer-brand {
    max-width: 280px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.footer-logo .logo-icon {
    width: 44px;
    height: 44px;
}

.footer-logo strong {
    color: white;
    display: block;
    font-size: 1rem;
    font-weight: 800;
}

.footer-desc {
    font-size: 0.88rem;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 20px;
}

.footer-social {
    display: flex;
    gap: 10px;
}

.social-icon {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.95rem;
    transition: var(--transition);
}

.social-icon:hover {
    background: var(--accent);
    color: var(--primary-dark);
    transform: translateY(-2px);
}

.footer-widget h4 {
    color: white;
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--accent);
    display: inline-block;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.88rem;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-links a:hover {
    color: var(--accent);
    padding-right: 4px;
}

.footer-links a i {
    font-size: 0.75rem;
    opacity: 0.5;
}

.footer-contact-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
}

.contact-icon {
    width: 34px;
    height: 34px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    font-size: 0.85rem;
    flex-shrink: 0;
}

.footer-contact-item p {
    font-size: 0.84rem;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.5;
}

.footer-contact-item a {
    color: rgba(255, 255, 255, 0.8);
    transition: var(--transition);
}

.footer-contact-item a:hover {
    color: var(--accent);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 18px 0;
}

.footer-bottom .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.footer-bottom p {
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.45);
}

/* =============================================
   15. BREADCRUMB
   ============================================= */
.breadcrumb-bar {
    background: white;
    border-bottom: 1px solid var(--border);
    padding: 12px 0;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.83rem;
    color: var(--text-light);
    flex-wrap: wrap;
}

.breadcrumb a {
    color: var(--primary);
    transition: var(--transition);
}

.breadcrumb a:hover {
    color: var(--primary-dark);
}

.breadcrumb .sep {
    color: var(--border);
}

.breadcrumb .current {
    color: var(--text-dark);
    font-weight: 600;
}

/* =============================================
   16. MISC COMPONENTS
   ============================================= */
/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
}

.badge-primary {
    background: rgba(29, 59, 118, 0.1);
    color: var(--primary);
}

.badge-green {
    background: rgba(34, 197, 94, 0.1);
    color: var(--green);
}

.badge-gold {
    background: rgba(251, 191, 36, 0.12);
    color: var(--accent-dark);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 22px;
    border-radius: var(--radius);
    font-weight: 700;
    font-size: 0.9rem;
    transition: var(--transition);
    cursor: pointer;
    border: 2px solid transparent;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-outline {
    background: transparent;
    border-color: var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
}

/* =============================================
   17. RESPONSIVE HELPERS
   ============================================= */
.show-mobile {
    display: block;
}

.hide-mobile {
    display: none;
}

@media (min-width: 992px) {
    .show-mobile {
        display: none;
    }

    .hide-mobile {
        display: block;
    }
}

/* =============================================
   18. AD-SPECIFIC LEGACY CLASSES (backward compat)
   ============================================= */
.app-ad-container {
    margin: 24px 0;
    text-align: center;
    overflow: hidden;
}

/* Drawer legacy */
.drawer-item i {
    width: 22px;
    text-align: center;
    font-size: 0.95rem;
    opacity: 0.75;
}

/* ── Admin Inline Image Controls ─────────────────────────── */
.gallery-thumb {
    position: relative;
}

.admin-img-controls {
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    display: none;
    gap: 3px;
    z-index: 20;
    background: rgba(0, 0, 0, .55);
    border-radius: 20px;
    padding: 3px 5px;
    white-space: nowrap;
}

.gallery-thumb:hover .admin-img-controls {
    display: flex;
}

.admin-img-controls button {
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: .75rem;
    line-height: 1;
    font-weight: bold;
    transition: background .2s, transform .15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.admin-img-controls .actl {
    background: #fff;
    color: #333;
}

.admin-img-controls .actr {
    background: #fff;
    color: #333;
}

.admin-img-controls .actd {
    background: #e74c3c;
    color: #fff;
}

.admin-img-controls button:hover {
    transform: scale(1.15);
}

.admin-img-controls .actl:hover,
.admin-img-controls .actr:hover {
    background: #2ecc71;
    color: #fff;
}

.admin-img-controls .actd:hover {
    background: #c0392b;
}

/* Toast notification */
#adminImgToast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: #2ecc71;
    color: #fff;
    padding: 10px 22px;
    border-radius: 24px;
    font-size: .9rem;
    z-index: 9999;
    opacity: 0;
    transition: opacity .3s;
    pointer-events: none;
}

#adminImgToast.show {
    opacity: 1;
}

#adminImgToast.err {
    background: #e74c3c;
}

/* ── Professional Mobile Isolation & Stability ─────────── */

/* WP Admin Bar Fix for Mobile */
@media screen and (max-width: 600px) {
    #wpadminbar {
        position: fixed !important;
    }

    html {
        margin-top: 46px !important;
    }
}

/* Gallery Stability - Stacking version as requested */
.gallery-thumbs {
    display: flex;
    flex-wrap: wrap;
    /* السماح بنزول الصور لسطر جديد */
    gap: 8px;
    padding: 10px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}

/* Final Global Leak Prevention (Mobile Only) */
@media screen and (max-width: 991px) {

    .container,
    .single-layout,
    .archive-layout {
        max-width: 100% !important;
        overflow-x: hidden !important;
    }

    .single-layout>*,
    .archive-layout>* {
        min-width: 0 !important;
    }
}