/*
 * ============================================================================
 * STYLE-FITXA-NEW.CSS - DISEÑO MEJORADO TARJETAS GAT
 * Colores de marca: naranja, negro, blanc
 * ============================================================================
 */

/* ==========================================================================
   VARIABLES CSS - Marca GAT
   ========================================================================== */
:root {
    /* Colors GAT */
    --gat-orange: #E85E0D;
    --gat-orange-dark: #C44D09;
    --gat-orange-light: #FFF3ED;
    --gat-orange-mid: #FF6B1A;
    --gat-black: #1A1A1A;
    --gat-black-soft: #2D2D2D;
    --gat-white: #FFFFFF;
    --gat-gray-100: #F8F8F8;
    --gat-gray-200: #EFEFEF;
    --gat-gray-300: #DCDCDC;
    --gat-gray-500: #888888;
    --gat-gray-700: #444444;
    --gat-green: #18A36A;

    /* Card */
    --card-radius: 14px;
    --card-shadow: 0 2px 14px rgba(0,0,0,0.08);
    --card-shadow-hover: 0 10px 35px rgba(232,94,13,0.18);
    --card-border: 1px solid #E8E8E8;
}

/* ==========================================================================
   TOPBAR FIX — sense hero section, cal fixar la barra des del principi
   El padding-top del body s'aplica via JS per mesurar l'alçada real
   ========================================================================== */
.orange-topbar {
    position: fixed !important;
    box-shadow: 0 3px 16px rgba(0,0,0,0.18);
}

/* ==========================================================================
   CONTAINER
   ========================================================================== */
@media (min-width: 1200px) {
    .container { max-width: 1340px; }
}
@media (min-width: 1400px) {
    .container { max-width: 1500px; }
}

/* ==========================================================================
   PAGE TITLE
   ========================================================================== */
.page-title {
    color: var(--gat-black);
    font-weight: 800;
    margin-bottom: 28px;
    position: relative;
    padding-bottom: 14px;
    font-size: 1.7rem;
    letter-spacing: -0.3px;
}
.page-title::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0;
    width: 60px; height: 4px;
    background: var(--gat-orange);
    border-radius: 3px;
}

/* ==========================================================================
   VEHICLE CARD
   ========================================================================== */
.vehicle-card-fitxa {
    background: var(--gat-white);
    border-radius: var(--card-radius);
    overflow: hidden;
    box-shadow: var(--card-shadow);
    border: var(--card-border);
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    position: relative;
}
.vehicle-card-fitxa:hover {
    transform: translateY(-5px);
    box-shadow: var(--card-shadow-hover);
    border-color: rgba(232,94,13,0.3);
}

/* ==========================================================================
   VEHICLE HEADER — Capçalera clara i elegant (abans franja negra)
   ========================================================================== */
.vehicle-header {
    background: var(--gat-white);
    padding: 15px 18px 13px;
    position: relative;
    order: 2;                 /* la capçalera va SOTA la foto */
    min-height: 78px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-bottom: 1px solid var(--gat-gray-200);
}

.vehicle-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 3px;
}

/* Codi grup — gran, en negre (l'accent taronja queda per als detalls) */
.vehicle-title {
    font-size: 1.7rem;
    font-weight: 800;
    color: var(--gat-black);
    margin: 0;
    letter-spacing: -0.03em;
    line-height: 1;
}

/* Badge L1H1 / "Caja Abierta" … — contorn suau sobre fons clar */
.vehicle-lh {
    background: var(--gat-white);
    color: var(--gat-gray-700);
    border: 1px solid var(--gat-gray-300);
    font-size: 0.66rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 100px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    flex-shrink: 0;
}
.vehicle-lh:empty { display: none; }

.vehicle-header-bottom {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* Nom model */
.vehicle-subtitle {
    color: var(--gat-gray-500);
    font-size: 0.9rem;
    font-weight: 500;
    margin: 0;
}
.vehicle-subtitle .o-semblant {
    font-style: italic;
    color: var(--gat-gray-500);
    font-weight: 400;
    font-size: 0.82rem;
    white-space: nowrap;
}

/* Badge especial (opcional) */
.vehicle-badge {
    background: var(--gat-orange-light);
    color: var(--gat-orange-dark);
    border: 1px solid rgba(232,94,13,0.25);
    font-size: 0.66rem;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 100px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    flex-shrink: 0;
}

/* ==========================================================================
   VEHICLE IMAGE — fons gris de catàleg (#EDEEF0)
   ------------------------------------------------------------------
   Les fotos de vehicle han de portar fons TRANSPARENT (PNG amb alfa).
   Si alguna encara té fons blanc es veurà un requadre fins que la
   substitueixis per la versió retallada.
   ========================================================================== */
.vehicle-image-container {
    position: relative;
    overflow: hidden;
}

.vehicle-image {
    width: 100%;
    height: 205px;
    object-fit: contain;
    object-position: center;
    display: block;
    order: 1;                 /* la foto va PRIMER, a dalt de tot */
    background: #EDEEF0;
    padding: 14px 12px;
    transition: transform 0.35s ease;
}
.vehicle-card-fitxa:hover .vehicle-image {
    transform: scale(1.03);
}

/* ==========================================================================
   SPECS — Mides caixa interior
   ========================================================================== */
.specs-container {
    padding: 16px 18px 14px;
    background: var(--gat-white);
    order: 3;
}

.specs-title {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 0.66rem;
    font-weight: 700;
    color: var(--gat-orange);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    margin-bottom: 12px;
}
.specs-title::before {
    content: '✦';
    font-size: 0.7rem;
    color: var(--gat-orange);
}

/* 3 mesures en columnes amb línia fina de separació */
.specs-grid {
    display: flex;
    margin-bottom: 12px;
}

.spec-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    text-align: center;
    position: relative;
    padding: 2px 4px;
    background: none;
    border: none;
}
.spec-item + .spec-item::before {
    content: '';
    position: absolute;
    left: 0; top: 4px; bottom: 4px;
    width: 1px;
    background: var(--gat-gray-200);
}
.vehicle-card-fitxa:hover .spec-item {
    background: none;
    border: none;
}

/* Amaguem la icona: més net */
.spec-icon { display: none; }

.spec-value {
    order: 1;
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--gat-black);
    line-height: 1.2;
}

.spec-label {
    order: 2;
    font-size: 0.62rem;
    color: var(--gat-gray-500);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    line-height: 1.2;
    margin-top: 3px;
}

/* Footer specs (volum, càrrega, etiqueta) */
.specs-footer {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
    margin-top: 4px;
    padding-top: 12px;
    border-top: 1px solid var(--gat-gray-200);
}

.specs-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #FAFAFA;
    border: 1px solid var(--gat-gray-200);
    color: var(--gat-gray-700);
    font-size: 0.74rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 100px;
}
.specs-badge i {
    color: var(--gat-orange);
    font-size: 0.7rem;
}

/* ==========================================================================
   PRICE CONTAINER
   ========================================================================== */
.price-container {
    padding: 14px 18px 16px;
    background: var(--gat-white);
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    order: 4;
}

.price-box {
    text-align: center;
    margin-bottom: 12px;
}

/* Preu gran */
.price-value {
    font-size: 2.2rem;
    font-weight: 900;
    color: var(--gat-black);
    line-height: 1;
    letter-spacing: -1.5px;
    display: inline-flex;
    align-items: baseline;
    gap: 2px;
}
.price-decimals {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gat-black);
    letter-spacing: 0;
}
.price-currency {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gat-black);
    letter-spacing: 0;
    margin-left: 1px;
}

/* Preu base */
.price-note {
    font-size: 0.78rem;
    color: var(--gat-gray-500);
    margin-top: 5px;
    font-weight: 500;
}

/* Kms inclosos */
.included-info {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.78rem;
    color: var(--gat-green);
    font-weight: 600;
    margin-top: 6px;
    background: #EDFAF3;
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid #B2EED3;
}
.included-info i { font-size: 0.75rem; }

/* ==========================================================================
   ACTION BUTTONS
   ========================================================================== */
.action-buttons {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 8px;
    align-items: center;
    margin-top: 10px;
}

.btn-info {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: var(--gat-black);
    border: 2px solid var(--gat-gray-300);
    border-radius: 8px;
    padding: 11px 16px;
    font-size: 0.85rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s, background 0.2s;
    white-space: nowrap;
}
.btn-info:hover {
    border-color: var(--gat-orange);
    color: var(--gat-orange);
    background: var(--gat-orange-light);
}

.btn-reserve {
    display: block;
    width: 100%;
    background: var(--gat-orange);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px;
    font-size: 0.95rem;
    font-weight: 800;
    text-align: center;
    cursor: pointer;
    letter-spacing: 0.3px;
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
    box-shadow: 0 4px 12px rgba(232,94,13,0.3);
    text-transform: uppercase;
}
.btn-reserve:hover {
    background: var(--gat-orange-dark);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(232,94,13,0.4);
}
.btn-reserve:active { transform: translateY(0); }

/* ==========================================================================
   OVERLAY OCUPAT — FRANJA DIAGONAL TARONJA (estil gat2000)
   ========================================================================== */
/* Targeta ocupada: el contingut segueix visible, sense enfosquir */
.vehicle-ocupado {
    position: relative;
}

/* Franja diagonal taronja creuant la targeta */
.overlay-ocupado {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 160%;
    padding: 16px 0;
    /* Taronja semitransparent: es veuen les mides a través de la franja */
    background: linear-gradient(135deg, rgba(255,107,26,0.70) 0%, rgba(196,77,9,0.75) 100%);
    transform: translate(-50%, -50%) rotate(-10deg);
    z-index: 50;
    pointer-events: none;
    box-shadow: 0 5px 25px rgba(232,94,13,0.35);
}
.ribbon-text {
    color: #fff;
    text-align: center;
    text-shadow: 0 2px 5px rgba(0,0,0,0.55);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
}
.ribbon-text-main {
    color: #fff;
    font-size: 1.9rem;
    font-weight: 900;
    display: flex;
    align-items: center;
    gap: 14px;
    text-transform: uppercase;
    letter-spacing: 0.15em;
}
.ribbon-text-main i { font-size: 2rem; color: #fff; }
.ribbon-text-sub {
    color: rgba(255,255,255,0.92);
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-align: center;
    padding: 0 20px;
}

/* Botó de reserva deshabilitat quan està esgotat */
.btn-ocupado,
.vehicle-ocupado .btn-reserve:disabled {
    background: var(--gat-gray-500) !important;
    border-color: var(--gat-gray-500) !important;
    box-shadow: none !important;
    cursor: not-allowed !important;
}

/* ==========================================================================
   SIDEBAR INFO
   ========================================================================== */
.info-sidebar {
    position: sticky;
    top: 90px;
}

/* Accordion dates */
.date-picker-accordion {
    background: white;
    border-radius: 12px;
    border: 1px solid var(--gat-gray-200);
    box-shadow: var(--card-shadow);
    overflow: hidden;
    margin-bottom: 12px;
}
.accordion-header {
    padding: 14px 16px;
    cursor: pointer;
    background: var(--gat-black);
    transition: background 0.2s;
}
.accordion-header:hover { background: var(--gat-black-soft); }
.accordion-title {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.accordion-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: rgba(255,255,255,0.5);
    text-transform: uppercase;
    letter-spacing: 0.8px;
}
.accordion-dates {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.accordion-dates i { color: var(--gat-orange); font-size: 0.85rem; }
.date-display { color: white; font-weight: 700; font-size: 0.95rem; }
.time-display { color: rgba(255,255,255,0.65); font-size: 0.82rem; }
.date-separator { color: rgba(255,255,255,0.4); }
.btn-update-dates {
    color: var(--gat-orange);
    font-size: 0.75rem;
    font-weight: 700;
    margin-top: 2px;
}
.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    padding: 0 16px;
}
.accordion-content.show {
    max-height: 400px;
    padding: 16px;
}
.form-grid-compact { display: flex; flex-direction: column; gap: 12px; }
.form-group-compact label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--gat-gray-700);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
}
.input-row { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.form-control {
    height: 40px;
    border-radius: 7px;
    border: 1px solid var(--gat-gray-300);
    font-size: 0.85rem;
    padding: 6px 10px;
}
.form-control:focus {
    border-color: var(--gat-orange);
    box-shadow: 0 0 0 3px rgba(232,94,13,0.15);
    outline: none;
}
.btn.btn-primary {
    background: var(--gat-orange);
    border: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}
.btn.btn-primary:hover { background: var(--gat-orange-dark); }

/* Info summary */
.info-summary {
    background: white;
    border-radius: 10px;
    border: 1px solid var(--gat-gray-200);
    padding: 12px 16px;
    margin-bottom: 12px;
    box-shadow: var(--card-shadow);
}
.summary-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 0;
    font-size: 0.82rem;
    color: var(--gat-black);
    font-weight: 600;
}
.summary-item:not(:last-child) { border-bottom: 1px solid var(--gat-gray-200); }
.summary-item i { color: var(--gat-green); font-size: 0.85rem; }

/* Calendar info box */
.calendar-update-container {
    background: white;
    border-radius: 10px;
    border: 1px solid var(--gat-gray-200);
    overflow: hidden;
    box-shadow: var(--card-shadow);
}
.info-header {
    background: var(--gat-gray-100);
    padding: 10px 16px;
    border-bottom: 1px solid var(--gat-gray-200);
}
.info-header h4 {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--gat-black);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.info-header i { color: var(--gat-orange); }
.info-body { padding: 12px 16px; }
.info-block { margin-bottom: 12px; }
.info-block:last-child { margin-bottom: 0; }
.info-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--gat-orange);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}
.info-text {
    font-size: 0.78rem;
    color: var(--gat-gray-700);
    line-height: 1.5;
}
.info-text i { color: var(--gat-orange); margin-right: 4px; }

/* ==========================================================================
   ALERT NO DATES
   ========================================================================== */
.alert-fecha {
    border-radius: 14px;
    border: none;
    background: var(--gat-orange-light);
    border-left: 5px solid var(--gat-orange);
    color: var(--gat-black);
}
.alert-fecha h3 { color: var(--gat-orange-dark); font-weight: 800; }
.alert-fecha i { color: var(--gat-orange); }

/* ==========================================================================
   RESPONSIVE — TABLET
   ========================================================================== */
@media (max-width: 991px) {
    .vehicle-title { font-size: 1.7rem; }
    .vehicle-subtitle { font-size: 0.85rem; }
    .price-value { font-size: 1.9rem; }
    /* Targeta apilada: franja més inclinada, com a gat2000 */
    .overlay-ocupado {
        padding: 14px 0;
        transform: translate(-50%, -50%) rotate(-22deg);
    }
    .ribbon-text-main { font-size: 1.5rem; }
    .ribbon-text-main i { font-size: 1.7rem; }
    .ribbon-text-sub { font-size: 0.85rem; }
    .info-sidebar { position: relative; top: 0; margin-bottom: 16px; }
}

/* ==========================================================================
   RESPONSIVE — MOBILE
   ========================================================================== */
@media (max-width: 767px) {
    .page-title { font-size: 1.35rem; margin-bottom: 18px; }
    .vehicle-header { padding: 14px 15px 10px; }
    .vehicle-title { font-size: 1.5rem; }
    .vehicle-subtitle { font-size: 0.8rem; }
    .vehicle-image { height: 168px; }
    .specs-container { padding: 14px 15px 12px; }
    .spec-value { font-size: 0.86rem; }
    .price-container { padding: 12px 14px 14px; }
    .price-value { font-size: 1.7rem; }
    .action-buttons { grid-template-columns: 1fr; }
    .btn-info { width: 100%; }
    .overlay-ocupado { padding: 11px 0; }
    .ribbon-text-main { font-size: 1.25rem; gap: 10px; letter-spacing: 0.1em; }
    .ribbon-text-main i { font-size: 1.4rem; }
    .ribbon-text-sub { font-size: 0.7rem; }
}

@media (max-width: 575px) {
    .vehicle-header-top {
        flex-wrap: wrap;
        gap: 4px;
    }
    .vehicle-title { font-size: 1.4rem; }
    .specs-grid { grid-template-columns: repeat(3, 1fr); }
    .price-value { font-size: 1.6rem; letter-spacing: -1px; }
}
