/* AutoFind PRO — Frontend Styles */

/* ── Hero (Landing Page) ── */
.afp-hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0b0c0f;
    position: relative;
    overflow: hidden;
}
.afp-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 60% 80% at 50% 40%, rgba(15,35,64,.8) 0%, transparent 70%),
        radial-gradient(ellipse 40% 50% at 80% 70%, rgba(184,146,42,.15) 0%, transparent 60%);
}
.afp-hero-inner {
    position: relative;
    text-align: center;
    padding: 60px 24px;
    max-width: 640px;
    width: 100%;
}
.afp-hero-title {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: clamp(2.4rem, 5vw, 3.8rem);
    font-weight: 700;
    color: #f7f5f0;
    line-height: 1.1;
    margin-bottom: 16px;
    letter-spacing: -.02em;
}
.afp-hero-sub {
    color: rgba(247,245,240,.45);
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: 40px;
}
.afp-hero-form {
    display: flex;
    gap: 0;
    max-width: 480px;
    margin: 0 auto;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 40px rgba(0,0,0,.4);
}
.afp-hero-form select {
    flex: 1;
    padding: 16px 20px;
    font-family: 'Tajawal', sans-serif;
    font-size: 15px;
    font-weight: 500;
    border: none;
    outline: none;
    background: #fff;
    color: #0b0c0f;
    cursor: pointer;
    min-width: 0;
}
.afp-hero-form button {
    padding: 16px 36px;
    background: #b8922a;
    color: #fff;
    border: none;
    font-family: 'Tajawal', sans-serif;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s;
    white-space: nowrap;
}
.afp-hero-form button:hover { background: #a07e22; }

/* RTL hero */
.afp-rtl .afp-hero-inner { text-align: center; }

@media (max-width: 480px) {
    .afp-hero-form { flex-direction: column; border-radius: 10px; }
    .afp-hero-form select { border-radius: 0; }
    .afp-hero-form button { border-radius: 0; }
}

/* ── Top Bar (Language + Currency) ── */
.afp-topbar {
    background: #0f2340; padding: 0; margin-bottom: 16px; border-radius: 10px; overflow: hidden;
}
/* When hero is present, float topbar over it */
.afp-hero ~ .afp-topbar,
.afp-topbar:has(~ .afp-hero) { display: none; }
.afp-hero .afp-topbar-float {
    position: absolute; top: 0; left: 0; right: 0; z-index: 10;
}
#autofind-hero-app .afp-topbar {
    position: absolute; top: 20px; right: 20px; left: 20px;
    background: rgba(15,35,64,.6); backdrop-filter: blur(10px);
    border-radius: 10px; margin: 0;
}
.afp-topbar-inner {
    max-width: 1060px; margin: 0 auto; display: flex; align-items: center;
    justify-content: flex-end; padding: 8px 20px; gap: 8px;
}
.afp-topbar-group { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.afp-lang-btn, .afp-curr-btn {
    background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.15);
    color: rgba(255,255,255,.7); padding: 4px 12px; border-radius: 5px;
    font-size: 12px; font-weight: 600; cursor: pointer;
    font-family: 'Tajawal', sans-serif; transition: all .15s; white-space: nowrap;
}
.afp-lang-btn:hover, .afp-curr-btn:hover { background: rgba(255,255,255,.18); color: #fff; }
.afp-lang-btn.active, .afp-curr-btn.active {
    background: #b8922a; border-color: #b8922a; color: #fff;
}
.afp-topbar-sep { color: rgba(255,255,255,.2); margin: 0 4px; font-size: 14px; }

/* Search Bar */
.afp-search-bar {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: flex-end;
    background: #fff;
    padding: 20px 24px;
    border-radius: 12px;
    border: 1px solid #e4dfd5;
    margin-bottom: 20px;
    box-shadow: 0 2px 12px rgba(11,12,15,.06);
}
.afp-field { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 120px; }
.afp-field label { font-size: 11px; font-weight: 700; color: #7a7469; text-transform: uppercase; letter-spacing: .08em; }
.afp-field select, .afp-field input {
    background: #f7f5f0; border: 1.5px solid #e4dfd5; color: #0b0c0f;
    font-family: 'Tajawal', sans-serif; font-size: 14px; font-weight: 500;
    padding: 9px 12px; border-radius: 8px; outline: none; transition: border-color .15s;
    cursor: pointer;
}
.afp-field select:focus, .afp-field input:focus { border-color: #b8922a; }
.afp-field-btn { min-width: auto; flex: 0 0 auto; }
.afp-field-btn button {
    background: #b8922a; color: #fff; font-family: 'Tajawal', sans-serif;
    font-weight: 700; font-size: 14px; padding: 10px 28px; border: none;
    border-radius: 8px; cursor: pointer; transition: opacity .15s; white-space: nowrap;
}
.afp-field-btn button:hover { opacity: .88; }

/* Status */
.afp-status { font-size: 14px; color: #7a7469; margin-bottom: 16px; padding: 0 4px; }
.afp-status strong { color: #0b0c0f; }

/* Loading */
.afp-loading {
    display: none; flex-direction: column; align-items: center;
    justify-content: center; padding: 60px; color: #7a7469;
}
.afp-spinner {
    width: 36px; height: 36px; border: 3px solid #e4dfd5;
    border-top-color: #b8922a; border-radius: 50%;
    animation: afp-spin .7s linear infinite; margin-bottom: 12px;
}
@keyframes afp-spin { to { transform: rotate(360deg); } }

/* Grid */
.afp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}

/* Card */
.afp-card {
    background: #fff; border-radius: 12px; border: 1.5px solid #e4dfd5;
    overflow: hidden; transition: box-shadow .2s, transform .2s, border-color .2s;
    cursor: pointer; animation: afp-fadeUp .4s ease both;
}
.afp-card:hover { box-shadow: 0 10px 40px rgba(11,12,15,.12); transform: translateY(-3px); border-color: #b8922a; }
@keyframes afp-fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

.afp-card-img {
    position: relative; height: 210px; overflow: hidden;
    display: flex; align-items: center; justify-content: center; padding: 15px;
    background: linear-gradient(135deg, #0f2340 0%, #1a3a5c 50%, #0b0c0f 100%);
}
.afp-card-img::before {
    content: 'GetYrCar';
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    font-family: 'Cormorant Garamond', Georgia, serif; font-size: 28px; font-weight: 700;
    color: rgba(255,255,255,.06); letter-spacing: 2px; text-transform: uppercase;
    white-space: nowrap; pointer-events: none; z-index: 0;
}
/* If you have a logo image, use this instead:
.afp-card-img::before {
    content: ''; position: absolute; inset: 0;
    background: url('/wp-content/uploads/getyrcar-logo.png') center/60% no-repeat, linear-gradient(135deg, #0f2340, #0b0c0f);
    opacity: 0.08; pointer-events: none;
}
*/
.afp-card-img img {
    width: 85%; height: 85%; object-fit: cover; border-radius: 50%;
    box-shadow: 0 4px 24px rgba(0,0,0,.25); position: relative; z-index: 1;
    border: 3px solid rgba(184,146,42,.3);
}
.afp-no-img {
    width: 85%; height: 85%; display: flex; align-items: center; justify-content: center;
    color: rgba(255,255,255,.3); font-size: 14px; background: rgba(255,255,255,.05);
    border-radius: 50%; border: 3px solid rgba(184,146,42,.2); position: relative; z-index: 1;
}

.afp-badge {
    position: absolute; top: 12px; left: 50%; transform: translateX(-50%);
    background: #0b0c0f; color: #f7f5f0; font-size: 11px; font-weight: 700;
    padding: 3px 10px; border-radius: 4px; text-transform: uppercase; letter-spacing: .05em;
    z-index: 2;
}
.afp-badge-new { background: #0a6640; }
.afp-badge-certified { background: #0f2340; }

.afp-card-body { padding: 16px; }
.afp-card-meta { font-size: 11px; font-weight: 700; color: #7a7469; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 3px; }
.afp-card-title { font-size: 15px; font-weight: 700; line-height: 1.25; margin-bottom: 8px; color: #0b0c0f; }
.afp-card-price { font-size: 18px; font-weight: 600; color: #0f2340; margin-bottom: 2px; }
.afp-card-miles { font-size: 12px; color: #7a7469; margin-bottom: 8px; }

.afp-card-specs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 10px; }
.afp-pill {
    background: #f7f5f0; border: 1px solid #e4dfd5; font-size: 11px;
    color: #7a7469; padding: 2px 8px; border-radius: 20px;
}

.afp-card-dealer {
    font-size: 12px; color: #7a7469; border-top: 1px solid #e4dfd5;
    padding-top: 10px;
}

/* Pagination */
.afp-pagination { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin: 24px 0 40px; }
.afp-page-btn {
    min-width: 38px; height: 38px; background: #fff; border: 1.5px solid #e4dfd5;
    border-radius: 8px; font-family: 'Tajawal', sans-serif; font-size: 14px;
    font-weight: 600; cursor: pointer; transition: all .15s; color: #0b0c0f;
    padding: 0 12px;
}
.afp-page-btn:hover { border-color: #b8922a; color: #b8922a; }
.afp-page-btn.active { background: #b8922a; border-color: #b8922a; color: #fff; }
.afp-page-dots { display: flex; align-items: center; padding: 0 4px; color: #7a7469; }

/* Empty / Error */
.afp-empty { grid-column: 1 / -1; text-align: center; padding: 60px 20px; color: #7a7469; font-size: 15px; }
.afp-error { text-align: center; padding: 20px; color: #c23b22; }

/* VIN */
.afp-vin-wrap { max-width: 600px; margin: 0 auto; background: #fff; border-radius: 12px; border: 1px solid #e4dfd5; padding: 30px; }
.afp-vin-wrap h3 { margin-bottom: 8px; font-size: 20px; }
.afp-vin-wrap > p { color: #7a7469; font-size: 14px; margin-bottom: 20px; }
.afp-vin-input-row { display: flex; gap: 10px; margin-bottom: 20px; }
.afp-vin-input-row input {
    flex: 1; padding: 10px 14px; border: 1.5px solid #e4dfd5; border-radius: 8px;
    font-family: monospace; text-transform: uppercase; font-size: 14px; outline: none;
}
.afp-vin-input-row input:focus { border-color: #b8922a; }
.afp-vin-input-row button {
    padding: 10px 20px; background: #0f2340; color: #fff; border: none;
    border-radius: 8px; font-weight: 700; cursor: pointer; font-size: 14px;
}
.afp-vin-header { background: #0f2340; color: #f7f5f0; border-radius: 10px; padding: 16px; margin-bottom: 14px; }
.afp-vin-label { font-size: 11px; opacity: .5; text-transform: uppercase; margin-bottom: 4px; }
.afp-vin-title { font-size: 20px; font-weight: 700; }
.afp-vin-price { font-size: 22px; color: #b8922a; margin-top: 8px; }
.afp-vin-comm { font-size: 12px; color: #b8922a; opacity: .7; }
.afp-vin-specs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.afp-vin-spec { background: #f7f5f0; border-radius: 6px; padding: 10px; border: 1px solid #e4dfd5; }
.afp-vin-spec-label { font-size: 11px; font-weight: 700; color: #7a7469; text-transform: uppercase; margin-bottom: 2px; }
.afp-vin-spec-val { font-weight: 600; }

/* ── Detail Modal ── */
.afp-modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 10000;
    display: flex; align-items: center; justify-content: center;
    padding: 20px; backdrop-filter: blur(4px);
}
.afp-modal {
    background: #fff; border-radius: 16px; max-width: 900px; width: 100%;
    max-height: 90vh; overflow-y: auto; position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.afp-modal-close {
    position: absolute; top: 12px; right: 14px; z-index: 10;
    background: rgba(0,0,0,.5); color: #fff; border: none; width: 36px; height: 36px;
    border-radius: 50%; font-size: 20px; cursor: pointer; display: flex;
    align-items: center; justify-content: center; transition: background .15s;
}
.afp-modal-close:hover { background: rgba(0,0,0,.8); }
.afp-modal-body { display: flex; flex-direction: column; }

/* Gallery */
.afp-modal-gallery {
    background: linear-gradient(135deg, #0f2340 0%, #1a3a5c 50%, #0b0c0f 100%);
    border-radius: 16px 16px 0 0; overflow: hidden; position: relative;
}
.afp-modal-gallery::before {
    content: 'GetYrCar';
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    font-family: 'Cormorant Garamond', Georgia, serif; font-size: 42px; font-weight: 700;
    color: rgba(255,255,255,.04); letter-spacing: 3px; text-transform: uppercase;
    pointer-events: none; z-index: 0;
}
.afp-gallery-main { display: flex; align-items: center; justify-content: center; min-height: 300px; max-height: 400px; padding: 20px; }
.afp-gallery-main img {
    width: 90%; max-width: 600px; height: 280px; object-fit: cover; border-radius: 200px;
    box-shadow: 0 6px 30px rgba(0,0,0,.3); border: 3px solid rgba(184,146,42,.3);
    position: relative; z-index: 1;
}
.afp-gallery-nav {
    display: flex; align-items: center; justify-content: center; gap: 16px;
    padding: 10px; background: rgba(0,0,0,.3);
}
.afp-gallery-prev, .afp-gallery-next {
    background: rgba(255,255,255,.15); color: #fff; border: none; width: 36px; height: 36px;
    border-radius: 50%; font-size: 16px; cursor: pointer; transition: background .15s;
    display: flex; align-items: center; justify-content: center;
}
.afp-gallery-prev:hover, .afp-gallery-next:hover { background: rgba(255,255,255,.3); }
#afp-gallery-count { color: rgba(255,255,255,.6); font-size: 13px; }

/* Modal Info */
.afp-modal-info { padding: 24px; }
.afp-modal-title { font-size: 22px; font-weight: 700; margin-bottom: 8px; }
.afp-modal-price { font-size: 26px; font-weight: 700; color: #0f2340; margin-bottom: 20px; }
.afp-modal-info h3 { font-size: 14px; font-weight: 700; text-transform: uppercase; color: #7a7469; letter-spacing: .08em; margin-bottom: 12px; margin-top: 20px; }

/* Specs grid */
.afp-modal-specs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.afp-spec-row { display: flex; justify-content: space-between; padding: 8px 12px; background: #f7f5f0; border-radius: 6px; font-size: 13px; }
.afp-spec-label { color: #7a7469; font-weight: 600; }
.afp-spec-value { color: #0b0c0f; font-weight: 600; }

/* Inquiry form */
.afp-inquiry-form { margin-top: 20px; border-top: 1px solid #e4dfd5; padding-top: 20px; }
.afp-inq-input {
    width: 100%; padding: 10px 14px; border: 1.5px solid #e4dfd5; border-radius: 8px;
    font-family: 'Tajawal', sans-serif; font-size: 14px; outline: none;
    margin-bottom: 10px; transition: border-color .15s; box-sizing: border-box;
}
.afp-inq-input:focus { border-color: #b8922a; }
textarea.afp-inq-input { resize: vertical; }
.afp-verify-row { margin-bottom: 10px; }
.afp-verify-code { margin-bottom: 10px; }
.afp-verify-hint { font-size: 13px; color: #7a7469; margin-bottom: 8px; }
.afp-code-row { display: flex; gap: 8px; }
.afp-code-input { flex: 1; font-family: 'DM Mono', monospace; font-size: 18px; letter-spacing: 6px; text-align: center; }
.afp-btn-secondary {
    background: #0f2340; color: #fff; border: none; border-radius: 8px;
    padding: 10px 20px; font-family: 'Tajawal', sans-serif; font-size: 13px;
    font-weight: 700; cursor: pointer; transition: opacity .15s;
}
.afp-btn-secondary:hover { opacity: .85; }
.afp-btn-secondary:disabled { opacity: .5; cursor: not-allowed; }
.afp-btn-primary {
    width: 100%; background: #b8922a; color: #fff; border: none; border-radius: 8px;
    padding: 14px; font-family: 'Tajawal', sans-serif; font-size: 15px;
    font-weight: 700; cursor: pointer; transition: opacity .15s; margin-top: 4px;
}
.afp-btn-primary:hover { opacity: .88; }
.afp-btn-primary:disabled { opacity: .4; cursor: not-allowed; }
.afp-verified-badge {
    background: #d0ede0; color: #0a6640; padding: 8px 14px; border-radius: 8px;
    font-size: 13px; font-weight: 700; margin-bottom: 10px; text-align: center;
}
.afp-msg-ok { background: #d0ede0; color: #0a6640; padding: 8px 12px; border-radius: 6px; font-size: 13px; margin-bottom: 10px; }
.afp-msg-err { background: #faddda; color: #c23b22; padding: 8px 12px; border-radius: 6px; font-size: 13px; margin-bottom: 10px; }

/* Modal RTL */
.afp-rtl .afp-modal-close { right: auto; left: 14px; }
.afp-rtl .afp-modal-info { text-align: right; }
.afp-rtl .afp-spec-row { flex-direction: row-reverse; }

/* Modal responsive */
@media (max-width: 600px) {
    .afp-modal { max-height: 95vh; border-radius: 12px; }
    .afp-modal-specs { grid-template-columns: 1fr; }
    .afp-gallery-main { min-height: 200px; max-height: 260px; padding: 15px; }
    .afp-gallery-main img { width: 90%; height: 180px; border-radius: 120px; }
}

/* ── Login / Dashboard ── */
.afp-login-wrap {
    max-width: 440px; margin: 40px auto; background: #fff; border-radius: 14px;
    border: 1.5px solid #e4dfd5; padding: 36px; text-align: center;
}
.afp-login-wrap h2 { font-size: 22px; font-weight: 700; margin-bottom: 20px; }
.afp-login-switch { font-size: 13px; color: #7a7469; margin-top: 16px; }
.afp-login-switch a { color: #b8922a; font-weight: 600; }
.afp-register-type { display: flex; gap: 20px; justify-content: center; margin-bottom: 16px; font-size: 14px; }
.afp-register-type label { cursor: pointer; display: flex; align-items: center; gap: 6px; }
.afp-dash-role { margin-bottom: 16px; }
.afp-badge-role { padding: 4px 14px; border-radius: 20px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.afp-badge-b2b { background: #0f2340; color: #fff; }
.afp-badge-b2c { background: #b8922a; color: #fff; }
.afp-badge-admin { background: #0a6640; color: #fff; }
.afp-dash-info { font-size: 14px; color: #7a7469; margin: 8px 0; padding: 8px 12px; border-radius: 6px; }
.afp-price-label { font-size: 11px; font-weight: 600; color: #0a6640; text-transform: uppercase; }

/* ── RTL Support ── */
.afp-rtl .afp-topbar-inner { justify-content: flex-start; }
.afp-rtl .afp-badge { left: 50%; right: auto; }
.afp-rtl .afp-card-body { text-align: right; }
.afp-rtl .afp-card-specs { justify-content: flex-start; }
.afp-rtl .afp-status { text-align: right; }
.afp-rtl .afp-field label { text-align: right; }
.afp-rtl .afp-vin-wrap { text-align: right; }
.afp-rtl .afp-vin-header { text-align: right; }
.afp-rtl .afp-vin-spec { text-align: right; }
.afp-rtl .afp-card-dealer { text-align: right; }

/* Responsive */
@media (max-width: 768px) {
    .afp-search-bar { padding: 16px; gap: 8px; }
    .afp-field { min-width: calc(50% - 8px); }
    .afp-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
    .afp-card-img { height: 160px; }
    .afp-topbar-inner { justify-content: center; }
}
