/* ============================================================
   RideNest — Public Vehicle Detail (Renter-facing) Redesign
   Frontend restyle only. No new tags, variables, URLs, or fields.
   ============================================================ */

.public-detail{
    max-width:1280px;
    margin:0 auto;
    padding:40px 24px 84px;
    position:relative;
    isolation:isolate;
}

.public-detail::before,
.public-detail::after{
    content:"";
    position:absolute;
    inset:auto;
    z-index:-1;
    pointer-events:none;
    border-radius:999px;
    filter:blur(18px);
    opacity:.7;
}

.public-detail::before{
    width:280px;
    height:280px;
    top:18px;
    right:-90px;
    background:radial-gradient(circle, rgba(37,99,235,.14) 0%, rgba(37,99,235,0) 70%);
}

.public-detail::after{
    width:320px;
    height:320px;
    left:-110px;
    top:340px;
    background:radial-gradient(circle, rgba(16,185,129,.10) 0%, rgba(16,185,129,0) 72%);
}

.public-detail > *{
    position:relative;
    z-index:1;
}

/* ============ BREADCRUMB (existing back link, restyled) ============ */

.detail-breadcrumb{
    margin-bottom:28px;
}

.detail-breadcrumb a{
    display:inline-flex;
    align-items:center;
    gap:8px;
    font-size:.92rem;
    font-weight:600;
    color:#64748b;
    text-decoration:none;
    transition:color .2s ease, transform .2s ease;
}

.detail-breadcrumb a::before{
    content:"";
    width:16px;
    height:16px;
    background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='15 18 9 12 15 6'%3E%3C/polyline%3E%3C/svg%3E");
    background-size:contain;
    background-repeat:no-repeat;
    transition:transform .2s ease;
}

.detail-breadcrumb a:hover{
    color:#2563eb;
}

.detail-breadcrumb a:hover::before{
    transform:translateX(-2px);
}

/* ============ HEADING ============ */

.public-detail-heading{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:24px;
    margin-bottom:28px;
    flex-wrap:wrap;
    background:rgba(255,255,255,.78);
    border:1px solid rgba(148,163,184,.18);
    border-radius:28px;
    padding:24px 26px;
    box-shadow:
        0 1px 2px rgba(15,23,42,.03),
        0 20px 42px rgba(15,23,42,.08);
    backdrop-filter:blur(14px);
}

.public-detail-heading .eyebrow{
    font-size:.82rem;
    font-weight:700;
    color:#2563eb;
    text-transform:uppercase;
    letter-spacing:.05em;
    margin-bottom:8px;
}

.public-detail-heading h1{
    font-size:clamp(2rem,3.6vw,2.75rem);
    font-weight:800;
    letter-spacing:-.02em;
    color:#0f172a;
    line-height:1.1;
    margin-bottom:8px;
}

.detail-subline{
    color:#64748b;
    font-size:1.05rem;
}

.availability{
    display:inline-flex;
    align-items:center;
    flex:0 0 auto;
    white-space:nowrap;
    padding:9px 18px;
    border-radius:999px;
    font-size:.85rem;
    font-weight:700;
    letter-spacing:.01em;
    box-shadow:0 8px 22px rgba(5,150,105,.12);
}

.availability.available{
    background:#ecfdf5;
    color:#059669;
    border:1px solid #a7f3d0;
}

/* ============ GALLERY ============ */

.public-gallery{
    display:grid;
    grid-template-columns:repeat(12,minmax(0,1fr));
    gap:16px;
    margin-bottom:44px;
    padding:18px;
    background:linear-gradient(180deg, rgba(255,255,255,.92), rgba(255,255,255,.78));
    border:1px solid rgba(148,163,184,.16);
    border-radius:32px;
    box-shadow:
        0 1px 2px rgba(15,23,42,.03),
        0 24px 56px rgba(15,23,42,.08);
    backdrop-filter:blur(10px);
}

.public-gallery img{
    width:100%;
    height:100%;
    min-height:280px;
    object-fit:cover;
    border-radius:24px;
    box-shadow:
        0 1px 2px rgba(15,23,42,.03),
        0 16px 40px rgba(15,23,42,.08);
}

.public-gallery img:first-child{
    grid-column:span 7;
    min-height:520px;
}

.public-gallery img:nth-child(2),
.public-gallery img:nth-child(3),
.public-gallery img:nth-child(4){
    grid-column:span 5;
    min-height:166px;
}

/* Single image: let it take full width and a taller hero height */
.public-gallery img:only-child{
    min-height:560px;
    grid-column:1 / -1;
}

.image-placeholder{
    grid-column:1 / -1;
    width:100%;
    min-height:420px;
    display:flex;
    align-items:center;
    justify-content:center;
    background:linear-gradient(135deg, #f8fafc, #eef2f7);
    color:#94a3b8;
    font-weight:600;
    border-radius:24px;
    border:1.5px dashed #dbe4ef;
}

/* ============ LAYOUT ============ */

.public-detail-layout{
    display:grid;
    grid-template-columns:minmax(0,1fr) 390px;
    gap:48px;
    align-items:start;
}

.detail-main{
    display:flex;
    flex-direction:column;
    gap:28px;
    min-width:0;
}

/* ============ SECTIONS ============ */

.detail-section{
    background:rgba(255,255,255,.86);
    border:1px solid rgba(148,163,184,.16);
    border-radius:28px;
    padding:28px;
    box-shadow:
        0 1px 2px rgba(15,23,42,.03),
        0 18px 42px rgba(15,23,42,.07);
}

.detail-section h2{
    font-size:1.35rem;
    font-weight:800;
    letter-spacing:-.015em;
    color:#0f172a;
    margin-bottom:18px;
}

.detail-description{
    color:#475569;
    font-size:1rem;
    line-height:1.85;
}

/* ============ SPECIFICATIONS — elegant cards replacing a bare <dl> ============ */

.public-specs{
    display:grid;
    grid-template-columns:repeat(auto-fill,minmax(150px,1fr));
    gap:14px;
    margin:0;
}

.public-specs > div{
    display:flex;
    flex-direction:column;
    gap:6px;
    padding:18px 20px;
    background:#f8fafc;
    border:1px solid #eef2f7;
    border-radius:16px;
    transition:background .2s ease, border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}

.public-specs > div:hover{
    background:#fff;
    border-color:#dbe4ef;
    transform:translateY(-2px);
    box-shadow:0 10px 24px rgba(15,23,42,.06);
}

.public-specs dt{
    font-size:.78rem;
    font-weight:700;
    color:#94a3b8;
    text-transform:uppercase;
    letter-spacing:.04em;
}

.public-specs dd{
    margin:0;
    font-size:1.05rem;
    font-weight:700;
    color:#0f172a;
}

/* ============ STICKY BOOKING CARD (existing CTA is the centerpiece) ============ */

.rental-summary{
    position:sticky;
    top:22px;
}

.rental-summary-inner{
    background:linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,250,252,.96));
    border:1px solid rgba(15,23,42,.06);
    border-radius:28px;
    padding:30px;
    box-shadow:
        0 1px 2px rgba(15,23,42,.03),
        0 28px 60px rgba(15,23,42,.10);
    overflow:hidden;
}

.rental-summary-inner::before{
    content:"";
    display:block;
    position:relative;
    height:6px;
    margin:-30px -30px 24px;
    background:linear-gradient(90deg, #2563eb, #10b981);
}

.rental-summary .eyebrow{
    font-size:.8rem;
    font-weight:700;
    color:#94a3b8;
    text-transform:uppercase;
    letter-spacing:.05em;
    margin-bottom:10px;
}

.rental-summary .price{
    font-size:2.25rem;
    font-weight:800;
    letter-spacing:-.02em;
    color:#0f172a;
    margin-bottom:18px;
}

.rental-summary .price small{
    font-size:.95rem;
    font-weight:500;
    color:#94a3b8;
}

.rental-summary-inner > p{
    font-size:.92rem;
    color:#64748b;
    margin-bottom:12px;
}

.rental-summary-inner > p strong{
    color:#0f172a;
    font-weight:700;
}

.rental-summary hr{
    border:none;
    border-top:1px solid #eef2f7;
    margin:18px 0;
}

.owner-label{
    font-size:.78rem;
    font-weight:700;
    color:#94a3b8;
    text-transform:uppercase;
    letter-spacing:.04em;
    margin-bottom:6px !important;
}

.rental-summary .muted{
    font-size:.86rem;
    color:#94a3b8;
    margin-bottom:22px !important;
}

/* The existing "Request booking" / "Log in to request" link —
   promoted to a large, full-width, high-contrast CTA so it reads
   as the centerpiece of the card. */
.rental-summary .button{
    display:flex;
    align-items:center;
    justify-content:center;
    width:100%;
    height:58px;
    border-radius:16px;
    background:linear-gradient(135deg,#2563eb,#1d4ed8);
    color:#fff;
    text-decoration:none;
    font-size:16px;
    font-weight:700;
    letter-spacing:.01em;
    box-shadow:
        0 6px 16px rgba(37,99,235,.24),
        0 2px 4px rgba(37,99,235,.14);
    transition:transform .25s cubic-bezier(.16,1,.3,1), box-shadow .25s ease, background .25s ease;
}

.rental-summary .button:hover{
    color:#fff;
    transform:translateY(-2px);
    background:linear-gradient(135deg,#1d4ed8,#1e40af);
    box-shadow:
        0 10px 24px rgba(37,99,235,.32),
        0 3px 8px rgba(37,99,235,.18);
}

/* ============ RELATED VEHICLES ============ */

.related-section{
    margin-top:72px;
}

.related-section h2{
    font-size:1.5rem;
    font-weight:800;
    letter-spacing:-.015em;
    color:#0f172a;
    margin-bottom:24px;
}

.related-section .market-card-grid{
    display:grid;
    grid-template-columns:repeat(auto-fill,minmax(390px,1fr));
    gap:30px;
}

.related-section .market-card{
    background:#fff;
    border-radius:24px;
    overflow:hidden;
    box-shadow:
        0 1px 2px rgba(15,23,42,.03),
        0 10px 30px rgba(15,23,42,.07);
    transition:transform .4s cubic-bezier(.16,1,.3,1), box-shadow .4s cubic-bezier(.16,1,.3,1);
}

.related-section .market-card:hover{
    transform:translateY(-8px);
    box-shadow:
        0 2px 4px rgba(15,23,42,.04),
        0 24px 50px rgba(15,23,42,.14);
}

.related-section .market-card-image{
    position:relative;
    display:block;
    height:250px;
    overflow:hidden;
    isolation:isolate;
}

.related-section .market-card-image img{
    width:100%;
    height:100%;
    object-fit:cover;
    transition:transform .6s cubic-bezier(.16,1,.3,1);
}

.related-section .market-card:hover img{
    transform:scale(1.08);
}

.related-section .favorite-btn{
    position:absolute;
    top:16px;
    right:16px;
    width:40px;
    height:40px;
    border:none;
    border-radius:50%;
    background:white;
    box-shadow:
        0 2px 4px rgba(0,0,0,.06),
        0 6px 18px rgba(0,0,0,.14);
    cursor:pointer;
    transition:transform .25s cubic-bezier(.16,1,.3,1), box-shadow .25s ease;
}

.related-section .favorite-btn:hover{
    transform:scale(1.1);
    box-shadow:
        0 3px 6px rgba(0,0,0,.08),
        0 10px 24px rgba(0,0,0,.18);
}

.related-section .market-card-image .availability{
    position:absolute !important;
    left:16px;
    bottom:16px;
    top:auto;
    right:auto;
    display:inline-flex !important;
    align-items:center;
    justify-content:center;
    flex:0 0 auto;
    align-self:flex-start;
    width:auto !important;
    height:auto !important;
    min-width:0;
    max-width:none;
    white-space:nowrap;
    line-height:1;
    writing-mode:horizontal-tb !important;
    text-orientation:mixed;
    background:#10b981;
    color:#fff;
    padding:7px 13px;
    border-radius:999px;
    font-size:13px;
    font-weight:700;
    letter-spacing:.01em;
    box-shadow:
        0 2px 4px rgba(16,185,129,.18),
        0 6px 16px rgba(16,185,129,.28);
}

.related-section .market-card-body{
    padding:22px;
}

.related-section .market-card-body h2{
    font-size:1.4rem;
    font-weight:700;
    letter-spacing:-.01em;
    margin-bottom:6px;
}

.related-section .market-card-body h2 a{
    color:#0f172a;
    text-decoration:none;
}

.related-section .market-card-body h2 a:hover{
    color:#2563eb;
}

.related-section .vehicle-meta{
    color:#64748b;
    font-size:.94rem;
    margin-bottom:14px;
}

.related-section .card-location{
    display:flex;
    align-items:center;
    gap:8px;
    color:#475569;
    font-size:.94rem;
    margin-bottom:18px;
}

.related-section .vehicle-specs{
    display:flex;
    gap:10px;
    flex-wrap:wrap;
    margin-bottom:20px;
}

.related-section .vehicle-specs span{
    background:#f8fafc;
    border:1px solid #eef2f7;
    border-radius:999px;
    padding:8px 12px;
    display:inline-flex;
    align-items:center;
    gap:6px;
    color:#475569;
    font-size:.88rem;
}

.related-section .card-footer{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:16px;
    padding-top:18px;
    border-top:1px solid #eef2f7;
}

.related-section .price strong{
    font-size:1.25rem;
    color:#0f172a;
}

.related-section .price small{
    color:#94a3b8;
}

.related-section .details-btn{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    padding:12px 18px;
    border-radius:12px;
    background:#2563eb;
    color:#fff;
    text-decoration:none;
    font-weight:700;
    transition:background .2s ease, transform .2s ease;
}

.related-section .details-btn:hover{
    background:#1d4ed8;
    transform:translateY(-1px);
}

/* ============ RESPONSIVE ============ */

@media (max-width:1024px){

    .public-detail-layout{
        grid-template-columns:1fr;
        gap:32px;
    }

    .rental-summary{
        position:static;
        top:auto;
        order:-1;
    }

    .public-gallery img,
    .public-gallery img:only-child,
    .image-placeholder{
        min-height:360px;
    }

    .public-detail{
        padding:28px 20px 60px;
    }

    .public-gallery{
        grid-template-columns:1fr 1fr;
    }

    .public-gallery img:first-child,
    .public-gallery img:nth-child(2),
    .public-gallery img:nth-child(3),
    .public-gallery img:nth-child(4){
        grid-column:1 / -1;
        min-height:320px;
    }
}

@media (max-width:640px){

    .public-detail{
        padding:20px 16px 48px;
    }

    .public-detail-heading{
        flex-direction:column;
        align-items:flex-start;
        gap:14px;
    }

    .public-gallery{
        grid-template-columns:1fr;
        padding:12px;
        border-radius:24px;
    }

    .public-gallery img,
    .public-gallery img:only-child,
    .image-placeholder{
        min-height:260px;
        border-radius:18px;
    }

    .detail-main{
        gap:20px;
    }

    .public-detail-heading,
    .detail-section,
    .rental-summary-inner{
        border-radius:22px;
        padding:22px;
    }

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

    .rental-summary-inner{
        padding:22px;
        border-radius:20px;
    }

    .rental-summary .price{
        font-size:1.8rem;
    }

    .related-section .market-card-grid{
        grid-template-columns:1fr;
    }
}