/* =========================================================
   Single Car Page — Dark Theme
   Layout: header block (featured + gallery grid at top),
           then 70 / 30 split below.
   ========================================================= */

.rankup-single-car-wrap {
    background-color: #0e1013;
    color: #ffffff;
    padding: 0;
    margin: 0;
    width: 100%;
}

.rankup-single-car-container {
    max-width: var(--ui-container-size, 1200px);
    margin: 0 auto;
    padding: 140px 20px 40px 20px;
    display: flex;
    flex-direction: column;
    gap: 40px;
}

/* ─── HEADER: featured + side gallery grid ─── */
.rankup-single-car-header {
    display: grid;
    grid-template-columns: 1fr 200px;
    grid-template-rows: 1fr;
    gap: 8px;
    height: 420px;
    border-radius: 10px;
    overflow: hidden;
}

.rankup-single-car-featured-image {
    grid-column: 1;
    grid-row: 1;
    display: block;
    overflow: hidden;
}

.rankup-single-car-featured-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    cursor: pointer;
    transition: transform 0.4s ease;
}

.rankup-single-car-featured-image:hover img {
    transform: scale(1.02);
}

/* Side gallery column — stacks 2 thumbnails vertically */
.rankup-single-car-gallery-grid {
    grid-column: 2;
    grid-row: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rankup-single-car-gallery-grid .gallery-item {
    flex: 1;
    display: block;
    position: relative;
    overflow: hidden;
}

.rankup-single-car-gallery-grid .gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    cursor: pointer;
    transition: transform 0.4s ease;
}

.rankup-single-car-gallery-grid .gallery-item:hover img {
    transform: scale(1.05);
}

/* "+N more" overlay on last tile */
.gallery-more-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 18px;
    color: #fff;
    pointer-events: none;
}

/* ─── 70 / 30 CONTENT SPLIT ─── */
.rankup-single-car-content-split {
    display: grid;
    grid-template-columns: 1fr 40%;
    gap: 40px;
    align-items: start;
}

/* ─── LEFT — Car main info ─── */
.rankup-single-car-main-info {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.car-brand-name {
    color: #6b7280;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.car-title {
    font-size: 42px;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
    line-height: 1.1;
}

.car-specs-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 20px;
}

.car-specs-row .spec-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #121621;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 8px 16px;
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.car-specs-row .spec-item svg {
    width: 18px;
    height: 18px;
    color: #8e94a5;
    flex-shrink: 0;
    transition: color 0.2s ease;
}

.car-specs-row .spec-item:hover {
    background: #1a1f2e;
    border-color: rgba(255, 255, 255, 0.15);
}

.car-specs-row .spec-item:hover svg {
    color: #ff6b00;
}

.car-description {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid #1f2330;
    color: #9ca3af;
    line-height: 1.8;
    font-size: 14px;
}

.details-title {
    font-size: 22px;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 24px 0;
}

.car-description p {
    font-size: 14px;
    margin-bottom: 16px;
}

/* ─── RIGHT — Booking form sidebar ─── */
.rankup-single-car-sidebar {
    position: sticky;
    top: 80px;
}

.car-booking-section {
    background: #141720;
    border: 1px solid #1f2330;
    border-radius: 12px;
    padding: 30px;
}

.car-booking-section h3 {
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 12px 0;
    color: #ffffff;
}

.car-booking-section .price-wrap {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid #1f2330;
}

.car-booking-section .price-amount {
    font-size: 28px;
    font-weight: 700;
    color: #ff6b00;
}

.car-booking-section .price-period {
    font-size: 14px;
    color: #6b7280;
    margin-left: 4px;
}

/* Booking Form */
.single-booking-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.single-booking-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
}

.single-booking-form label {
    font-size: 12px;
    color: #6b7280;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.single-booking-form .dates-row {
    display: flex;
    gap: 12px;
    width: 100%;
}

.single-booking-form .dates-row .form-group {
    flex: 1;
}

.single-booking-form .form-input {
    width: 100%;
    background-color: #0e1013;
    border: 1px solid #2d3136;
    color: #ffffff;
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s;
    appearance: none;
    -webkit-appearance: none;
}

.single-booking-form .form-input:focus {
    border-color: #ff6b00;
}

.single-booking-form input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
    opacity: 0.7;
}

.single-booking-form ::placeholder {
    color: #4b5563;
}

/* ─── Trip Date Blocks (Turo-style) ─── */
.trip-date-block {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-header {
    font-size: 13px;
    font-weight: 700;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin: 0 0 12px 0;
    display: block;
}

.trip-block-inputs {
    display: flex;
    flex-direction: row;
    gap: 6px;
}

.trip-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.trip-date-wrap .form-input {
    padding-right: 10px;
}

.trip-time-wrap .form-input {
    padding-right: 36px;
}

.trip-input-wrap .form-input {
    cursor: pointer;
}

.trip-date-wrap {
    flex: 1 1 70%;
    min-width: 70%;
}

.trip-time-wrap {
    flex: 1 1 30%;
    min-width: 0;
}

.trip-chevron {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7280;
    pointer-events: none;
    flex-shrink: 0;
}

/* Custom Location Selector UI */
.trip-location-block {
    margin: 25px 0;
    position: relative;
}

.location-display-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #121621;
    padding: 16px;
    border-radius: 12px;
    margin-top: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.location-current-info {
    flex: 1;
}

.display-loc-name {
    color: #ffffff;
    font-weight: 800;
    font-size: 16px;
    letter-spacing: -0.2px;
}

.display-loc-addr {
    color: #8e94a5;
    font-size: 14px;
    margin-top: 4px;
}

.edit-location-btn {
    background: #ffffff;
    border: none;
    color: #111827;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    margin-left: 15px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.edit-location-btn svg,
.edit-location-btn path {
    pointer-events: none;
}

.edit-location-btn:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Selection Menu - Accordion Drawer style */
.location-selection-menu {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    z-index: 10;
    margin-top: 0;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.location-selection-menu.active {
    max-height: max-content;
    /* Allows for full content expansion */
    opacity: 1;
    visibility: visible;
    margin-top: 15px;
    padding: 10px 0;
    overflow: visible;
    /* To allow address suggestions to overflow if needed, though they are inside */
}

.address-suggestions {
    margin-top: 5px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    max-height: 200px;
    overflow-y: auto;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(5px);
    transition: all 0.2s ease;
}

.address-suggestions.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .location-selection-menu {
        position: fixed;
        bottom: 0;
        top: auto;
        left: 0;
        right: 0;
        border-radius: 20px 20px 0 0;
        transform: translateY(100%);
        box-shadow: 0 -10px 25px rgba(0, 0, 0, 0.2);
    }

    .location-selection-menu.active {
        transform: translateY(0);
    }

    .trip-location-block::before {
        content: "";
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 99;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s;
    }

    .trip-location-block.menu-open::before {
        opacity: 1;
        visibility: visible;
    }
}

.location-group {
    padding: 10px 0;
}

.location-group .group-label {
    padding: 0 20px 8px;
    font-size: 11px;
    font-weight: 700;
    color: #6b7280;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.location-option-item {
    display: flex;
    align-items: flex-start;
    padding: 12px 20px;
    cursor: pointer;
    transition: background 0.2s;
}

.location-option-item:hover {
    background: #f3f4f6;
}

.option-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #374151;
    margin-right: 15px;
    flex-shrink: 0;
}

.location-option-item:hover .option-icon {
    background: #e5e7eb;
}

.option-content {
    flex: 1;
}

.option-title {
    color: #111827;
    font-weight: 500;
    font-size: 15px;
}

.option-note {
    color: #6b7280;
    font-size: 13px;
    line-height: 1.4;
    margin-top: 4px;
}

.option-subtitle {
    color: #9ca3af;
    font-size: 13px;
    margin-top: 2px;
}

.delivery-address-menu-input {
    padding: 10px 0 5px;
}

.delivery-input-group {
    display: flex;
    gap: 8px;
}

.delivery-input-group .form-input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
    color: #111827;
}

.submit-address-btn {
    background: #f97316;
    color: #fff;
    border: none;
    padding: 0 15px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}

.submit-address-btn:hover {
    background: #ea580c;
}

.address-suggestions {
    margin-top: 5px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    max-height: 200px;
    overflow-y: auto;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    z-index: 101;
}

.suggestion-item {
    padding: 10px 12px;
    font-size: 13px;
    color: #374151;
    cursor: pointer;
    border-bottom: 1px solid #f3f4f6;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover {
    background: #f3f4f6;
}

.delivery-input-group .form-input:focus {
    border-color: #f97316;
    outline: none;
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
}

/* Price / availability feedback rows */
.price-calculation-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #1e1409;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
}

.price-calculation-row #priceBreakdown {
    color: #9ca3af;
}

.price-calculation-row .total-price {
    font-size: 18px;
    font-weight: 700;
    color: #ff6b00;
}

.availability-status-row {
    background-color: #06402b;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    color: #ffffff;
}

.trip-location-block {
    margin: 25px 0 35px;
    /* Increased bottom margin for better separation */
    position: relative;
}

/* Policy Information Blocks */
.booking-policy-info {
    margin-top: 40px;
    display: flex;
    flex-direction: column;
}

.policy-item {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 24px 0;
}

.policy-item:first-child {
    border-top: none;
    padding-top: 0;
}

/* Policy style headers are now handled by .sidebar-header */

.policy-content {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.policy-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    flex-shrink: 0;
}

.policy-text {
    flex: 1;
}

.policy-label {
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.25;
}

.policy-note {
    font-size: 14px;
    color: #8e94a5;
    margin-top: 5px;
    font-weight: 400;
}

.policy-info-icon {
    margin-left: auto;
    color: #8e94a5;
    cursor: pointer;
    opacity: 0.8;
}

.availability-status-row {
    background-color: #06402b;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    color: #ffffff;
}

.availability-status-row.not-available {
    background-color: #450a0a;
    color: #f87171;
}

.availability-status-row.checking {
    background-color: #1e3a8a;
    color: #60a5fa;
}

/* Submit button */
.btn-primary-orange {
    background-color: #ff6b00;
    color: #fff;
    border: none;
    padding: 15px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.25s;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 35px;
}

.btn-primary-orange:hover {
    background-color: #e05f00;
}

/* ─── Toast ─── */
.rankup-toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    display: none;
}

/* ─── Vehicle Features ─── */
.car-vehicle-features {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid #1f2330;
}

.features-title {
    font-size: 22px;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 24px 0;
}

.features-groups-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px 40px;
}

.features-group-label {
    font-size: 14px;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 12px 0;
    text-transform: capitalize;
}

.features-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.features-list li {
    font-size: 14px;
    color: #9ca3af;
    line-height: 1.5;
}

/* --- PhotoSwipe Thumbnails --- */
.pswp__thumbnails-container {
    position: absolute;
    bottom: 24px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    z-index: 1000;
    pointer-events: none;
}

.pswp__thumbnails-scroll {
    display: flex;
    gap: 10px;
    padding: 10px 40px;
    overflow-x: auto;
    max-width: 90%;
    scrollbar-width: none;
    -ms-overflow-style: none;
    pointer-events: auto;
    mask-image: linear-gradient(to right, transparent, black 40px, black calc(100% - 40px), transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 40px, black calc(100% - 40px), transparent);
}

.pswp__thumbnails-scroll::-webkit-scrollbar {
    display: none;
}

.pswp__thumbnail-item {
    width: 64px;
    height: 64px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
    border: 2px solid transparent;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    background: #000;
}

.pswp__thumbnail-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.5;
    transition: opacity 0.2s ease;
}

.pswp__thumbnail-item:hover img {
    opacity: 0.8;
}

.pswp__thumbnail-item.is-active {
    border-color: #ff6b00;
    transform: scale(1.05);
}

.pswp__thumbnail-item.is-active img {
    opacity: 1;
}

.pswp__bg {
    background: #000000 !important;
}

.pswp__img {
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

/* ─── RESPONSIVE ─── */
@media (max-width: 900px) {
    .rankup-single-car-header {
        grid-template-columns: 1fr;
        height: auto;
    }

    .rankup-single-car-featured-image {
        height: 280px;
    }

    .rankup-single-car-gallery-grid {
        grid-column: 1;
        flex-direction: row;
        height: 120px;
    }

    .rankup-single-car-content-split {
        grid-template-columns: 1fr;
    }

    .rankup-single-car-sidebar {
        position: static;
    }

    .car-title {
        font-size: 28px;
    }
}

@media (max-width: 600px) {
    .single-booking-form .dates-row {
        flex-direction: column;
    }
}