/* ==========================================
   ALA TRADERS
   SHARED ADDITIONS
   Loaded by every page, after the page's own styles:
   vehicle status badges, card actions, loading/empty
   states, form errors and the details photo gallery.
========================================== */


/* ---------- Vehicle cards (stock + auction) ---------- */

.car[data-href] {
    cursor: pointer;
}

.car[data-href]:focus-visible {
    outline: 3px solid #e30613;
    outline-offset: 3px;
}

.car-photo {
    position: relative;
}

.status-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #fff;
    background: #0a7d32;
}

.status-reserved {
    background: #c77700;
}

.status-sold {
    background: #444;
}

.car-sold img {
    filter: grayscale(0.7);
}

.card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.button.button-dark {
    background: #111;
    border: 1px solid #444;
}


/* ---------- Loading, empty and error states ---------- */

.stock-loading,
.stock-empty,
.stock-error,
.stock-message {
    grid-column: 1 / -1;
    width: 100%;
    padding: 60px 20px;
    text-align: center;
    color: #888;
    font-size: 16px;
    line-height: 1.6;
}

.stock-empty p:first-child {
    font-size: 18px;
}

.stock-error {
    color: #e30613;
}

.stock-empty a,
.stock-message a {
    color: #e30613;
}


/* ---------- Forms ---------- */

.form-error {
    margin-top: 14px;
    padding: 12px 14px;
    border: 1px solid rgba(227, 6, 19, 0.45);
    border-radius: 6px;
    background: rgba(227, 6, 19, 0.08);
    color: #e30613;
    font-size: 14px;
    line-height: 1.5;
}

form button[disabled] {
    opacity: 0.6;
    cursor: wait;
}


/* ---------- Details page ---------- */

.detail-image {
    position: sticky;
    top: 20px;
    align-self: start;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.detail-image #detailMainImage {
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    background: #000;
}

.detail-thumbs {
    display: flex;
    gap: 8px;
    padding: 10px;
    overflow-x: auto;
    background: #111;
}

.detail-thumb {
    flex: 0 0 auto;
    width: 76px;
    height: 56px;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 4px;
    overflow: hidden;
    background: #000;
    cursor: pointer;
}

.detail-thumb.active,
.detail-thumb:hover {
    border-color: #e30613;
}

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

.detail-badge.badge-reserved {
    background: #c77700;
}

.detail-badge.badge-sold {
    background: #444;
}

.detail-description {
    margin-bottom: 30px;
    color: #444;
    font-size: 15px;
    line-height: 1.7;
    white-space: pre-line;
}

.btn-primary.btn-inline {
    display: inline-block;
    width: auto;
    padding: 14px 30px;
}

@media (max-width: 768px) {

    .detail-image {
        position: static;
    }

    .detail-info {
        padding: 24px;
    }

    .specs-grid {
        grid-template-columns: 1fr;
    }
}


/* ---------- WhatsApp ---------- */

.whatsapp-float {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 1000;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    border-radius: 999px;
    background: #25d366;
    color: #fff;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    transition: transform 0.2s ease, background 0.2s ease;
}

.whatsapp-float i {
    font-size: 26px;
}

.whatsapp-float:hover {
    background: #1ebe5b;
    transform: translateY(-2px);
}

.btn-whatsapp {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 24px;
    border-radius: 6px;
    background: #25d366;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-decoration: none;
    text-transform: uppercase;
    transition: background 0.3s;
}

.btn-whatsapp i {
    font-size: 20px;
}

.btn-whatsapp:hover {
    background: #1ebe5b;
}

@media (max-width: 600px) {

    .whatsapp-float {
        right: 14px;
        bottom: 14px;
        padding: 14px;
    }

    .whatsapp-float span {
        display: none;
    }
}


/* ---------- Contact page links ---------- */

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

.info a:hover {
    color: #e30613;
}


/* ---------- Payment note (footer) ---------- */

.payment-note {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    max-width: 300px;
    margin: 14px 0 6px;
    color: #a8a8a8;
    font-size: 13px;
    line-height: 1.5;
}

.payment-note > .fa-whatsapp {
    margin-top: 2px;
    color: #25d366;
    font-size: 16px;
}

.payment-note a {
    color: #25d366;
    font-weight: 700;
    text-decoration: none;
}

.payment-note a:hover {
    text-decoration: underline;
}

.payment-info {
    position: relative;
    flex: 0 0 auto;
    margin-top: 1px;
    color: #cfcfcf;
    font-size: 15px;
    cursor: help;
}

.payment-info:hover,
.payment-info:focus {
    color: #fff;
    outline: none;
}

/* Tooltip: shows on hover, and on tap/keyboard focus */
.payment-info::after {
    content: attr(data-tip);
    position: absolute;
    bottom: calc(100% + 10px);
    right: -8px;
    z-index: 20;
    width: 250px;
    padding: 10px 12px;
    border-radius: 8px;
    background: #fff;
    color: #111;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.45;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
    opacity: 0;
    visibility: hidden;
    transform: translateY(4px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
}

.payment-info:hover::after,
.payment-info:focus::after {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}


/* ---------- Homepage: readable small text on phones ---------- */

@media (max-width: 640px) {

    .car-spec,
    .car-details-btn,
    .brand-card span,
    .search-heading,
    .stat span,
    .cta-inner span {
        font-size: 12px !important;
    }

    .car-brand,
    .car-badge,
    .field label {
        font-size: 11px !important;
    }
}


/* ---------- Forms that continue in WhatsApp ---------- */

.btn-send-whatsapp {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 0 !important;
    background: #25d366 !important;
    color: #fff !important;
}

.btn-send-whatsapp:hover {
    background: #1ebe5b !important;
}

.btn-send-whatsapp i {
    font-size: 20px;
}

.form-hint {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    color: #777;
    font-size: 13px;
}

.form-hint i {
    color: #25d366;
    font-size: 16px;
}

#message .form-success-title {
    margin-bottom: 6px;
    color: #fff;
    font-size: 17px;
    font-weight: 700;
}

#message .form-success-text {
    margin-bottom: 14px;
    color: #ddd;
    font-size: 14px;
    line-height: 1.5;
}

#message .form-success-text strong {
    color: #25d366;
}

#message .form-success-btn {
    display: inline-flex;
    width: auto;
}
