/* ============================================
   JA Passeios Nauticos — Tour Detail Page
   ============================================ */

/* --------------------------------------------
   Detail Header
   -------------------------------------------- */
.detail-header {
    padding-top: 7.5rem;
    padding-bottom: 1.25rem;
    background: linear-gradient(180deg, var(--light) 0%, #FFFFFF 100%);
}

.detail-title-row {
    margin-top: 0.5rem;
}

.detail-title-row .badge {
    margin-bottom: 0.75rem;
}

.detail-title-row h1 {
    margin-bottom: 0.5rem;
    color: var(--primary);
}

.detail-rating {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-wrap: wrap;
}


/* --------------------------------------------
   Gallery (hero + grid Airbnb-style)
   -------------------------------------------- */
.gallery-section {
    padding: 1rem 0 2rem;
}

/* Mobile: empilha. Hero ocupa toda a largura, demais células abaixo
   em 2 colunas. Aspect 4:3 mais "amigável" pra retrato. */
.gallery-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

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

.gallery-cell {
    position: relative;
    border: 0;
    padding: 0;
    margin: 0;
    overflow: hidden;
    background: var(--gray-light, #e7ecef);
    cursor: zoom-in;
    aspect-ratio: 4 / 3;
    border-radius: var(--radius-sm, 6px);
    display: block;
}

.gallery-cell--hero {
    grid-column: 1 / -1;
    aspect-ratio: 16 / 10;
}

.gallery-cell picture,
.gallery-cell img {
    width: 100%;
    height: 100%;
    display: block;
}

.gallery-cell img {
    object-fit: cover;
    transition: transform 0.4s ease;
}

.gallery-cell:hover img,
.gallery-cell:focus-visible img {
    transform: scale(1.03);
}

.gallery-cell:focus-visible {
    outline: 3px solid var(--accent, #b88a2a);
    outline-offset: 2px;
}

/* Overlay "Ver todas (N)" na última célula visível quando tem mais escondidas */
.gallery-cell-more {
    position: absolute;
    inset: 0;
    background: rgba(7, 24, 39, 0.55);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    font-weight: 700;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    transition: background 0.2s ease;
}

.gallery-cell:hover .gallery-cell-more,
.gallery-cell:focus-visible .gallery-cell-more {
    background: rgba(7, 24, 39, 0.7);
}

.gallery-placeholder {
    aspect-ratio: 16 / 9;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--ocean) 100%);
    border-radius: var(--radius);
    color: rgba(255, 255, 255, 0.4);
}

/* Desktop/tablet: hero à esquerda + 4 células 2x2 à direita */
@media (min-width: 768px) {
    .gallery-grid {
        grid-template-columns: 2fr 1fr 1fr;
        grid-template-rows: 1fr 1fr;
        aspect-ratio: 16 / 9;
        gap: 0.5rem;
    }

    .gallery-cell {
        aspect-ratio: auto;
        height: 100%;
    }

    .gallery-cell--hero {
        grid-column: 1;
        grid-row: 1 / 3;
        aspect-ratio: auto;
    }

    /* Quantidades menores: hero ocupa mais espaço */
    .gallery-grid--n1 {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        aspect-ratio: 16 / 9;
    }

    .gallery-grid--n1 .gallery-cell--hero {
        grid-column: 1;
        grid-row: 1;
    }

    .gallery-grid--n2 {
        grid-template-columns: 2fr 1fr;
        grid-template-rows: 1fr;
    }

    .gallery-grid--n2 .gallery-cell--hero {
        grid-row: 1;
    }

    .gallery-grid--n3 {
        grid-template-columns: 2fr 1fr;
        grid-template-rows: 1fr 1fr;
    }

    .gallery-grid--n3 .gallery-cell--hero {
        grid-row: 1 / 3;
    }

    .gallery-grid--n4 {
        grid-template-columns: 2fr 1fr 1fr;
        grid-template-rows: 1fr 1fr;
    }

    .gallery-grid--n4 .gallery-cell:nth-child(4) {
        grid-column: 2 / 4;
    }
}

/* --------------------------------------------
   Gallery Lightbox (full-screen modal)
   -------------------------------------------- */
.gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(7, 24, 39, 0.96);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: gallery-lightbox-in 0.18s ease-out;
}

.gallery-lightbox[hidden] {
    display: none;
}

@keyframes gallery-lightbox-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.gallery-lightbox__figure {
    margin: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 2.5rem 0 1rem;
}

.gallery-lightbox__figure img {
    max-width: min(95vw, 1400px);
    max-height: 80vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.gallery-lightbox__caption {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.85rem;
    text-align: center;
    max-width: 90vw;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.gallery-lightbox__caption #gallery-lightbox-counter {
    font-weight: 700;
}

.gallery-lightbox__close,
.gallery-lightbox__nav {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 0;
    cursor: pointer;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    line-height: 1;
    transition: background 0.15s ease, transform 0.15s ease;
}

.gallery-lightbox__close:hover,
.gallery-lightbox__nav:hover {
    background: rgba(255, 255, 255, 0.25);
}

.gallery-lightbox__close {
    top: 1rem;
    right: 1rem;
    font-size: 1.7rem;
}

.gallery-lightbox__nav {
    top: 50%;
    transform: translateY(-50%);
    font-size: 2rem;
    width: 52px;
    height: 52px;
}

.gallery-lightbox__nav:hover {
    transform: translateY(-50%) scale(1.05);
}

.gallery-lightbox__nav--prev { left: 1rem; }
.gallery-lightbox__nav--next { right: 1rem; }

.gallery-lightbox__nav[disabled] {
    opacity: 0.25;
    cursor: not-allowed;
    pointer-events: none;
}

@media (max-width: 600px) {
    .gallery-lightbox__nav {
        width: 42px;
        height: 42px;
        font-size: 1.5rem;
    }
    .gallery-lightbox__figure img {
        max-height: 70vh;
    }
}

/* Trava o scroll do body quando lightbox está aberto */
body.gallery-lightbox-open {
    overflow: hidden;
}


/* --------------------------------------------
   Two-column Detail Layout
   -------------------------------------------- */
.detail-content-section {
    padding: 0 0 3rem;
}

.detail-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 1024px) {
    .detail-layout {
        grid-template-columns: 1fr 400px;
        gap: 2.5rem;
        align-items: start;
    }
}


/* --------------------------------------------
   Detail Main (Left Column)
   -------------------------------------------- */
.detail-short-desc {
    font-size: 1.1rem;
    color: var(--text-gray);
    line-height: 1.7;
    margin-bottom: 2rem;
    font-weight: 700;
}

/* Info cards grid */
.detail-info {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.info-card {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    background-color: var(--white);
    border: 1px solid var(--border);
    border-radius: 6px;
    box-shadow: none;
}

.info-card svg {
    flex-shrink: 0;
    color: var(--primary-light);
}

.info-label {
    display: block;
    font-size: 0.78rem;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 0.15rem;
}

.info-value {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    color: var(--dark);
}

@media (max-width: 480px) {
    .detail-info {
        grid-template-columns: 1fr;
    }
}

/* Full description */
.detail-description {
    margin-bottom: 2rem;
    line-height: 1.8;
    color: var(--dark);
    font-size: 0.95rem;
    font-weight: 700;
}

.detail-description p {
    margin-bottom: 1rem;
    color: var(--dark);
}

.detail-description h2,
.detail-description h3,
.detail-description h4 {
    margin-bottom: 0.75rem;
    margin-top: 1.5rem;
}

.detail-description ul,
.detail-description ol {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
    list-style: disc;
}

.detail-description ol {
    list-style: decimal;
}

.detail-description li {
    margin-bottom: 0.35rem;
}

/* Includes / Not includes */
.includes-section {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

@media (min-width: 600px) {
    .includes-section {
        grid-template-columns: 1fr 1fr;
    }
}

.includes-col h3 {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
}

.includes-col {
    padding: 1.15rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--white);
    box-shadow: none;
}

.includes-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.includes-list li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    color: var(--dark);
}

.includes-yes svg {
    color: var(--success);
    flex-shrink: 0;
}

.includes-no svg {
    color: var(--danger);
    flex-shrink: 0;
}


/* --------------------------------------------
   Booking Sidebar (Right Column)
   -------------------------------------------- */
.booking-sidebar {
    order: -1;
}

@media (min-width: 1024px) {
    .booking-sidebar {
        order: 0;
        position: sticky;
        top: 90px;
    }
}

.booking-sidebar-inner {
    background:
        linear-gradient(180deg, #FFFFFF 0%, #F8FAFC 100%);
    border: 1px solid rgba(184, 138, 42, 0.32);
    border-radius: 6px;
    box-shadow: var(--shadow-lg);
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
}

.booking-online-label {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0.25rem 0.65rem;
    margin-bottom: 0.85rem;
    border-radius: 3px;
    background: var(--accent-soft);
    color: var(--accent-hover);
    font-size: 0.78rem;
    font-weight: 800;
}

.booking-price-header {
    text-align: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--gray-light);
}

.booking-price-old {
    display: block;
    font-size: 0.9rem;
    color: var(--gray);
    text-decoration: line-through;
    margin-bottom: 0.15rem;
}

.booking-price-main {
    display: block;
    font-size: 2rem;
    font-weight: 800;
    color: var(--accent);
    line-height: 1.2;
}

.booking-price-type {
    display: block;
    font-size: 0.8rem;
    color: var(--gray);
    margin-top: 0.15rem;
}

.booking-section-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 0.75rem;
    margin-top: 1.25rem;
}

.booking-section-title:first-of-type {
    margin-top: 0;
}


/* --------------------------------------------
   Calendar Widget
   -------------------------------------------- */
.calendar {
    width: 100%;
    margin-bottom: 0.5rem;
}

.calendar-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.calendar-nav-btn {
    background: none;
    border: 1px solid var(--gray-light);
    border-radius: 4px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--dark);
    transition: all var(--transition);
    font-size: 0.9rem;
}

.calendar-nav-btn:hover {
    background-color: var(--light);
    border-color: var(--primary-light);
}

.calendar-nav-btn:disabled {
    opacity: 0.3;
    cursor: default;
}

.calendar-month-label {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--dark);
    text-transform: capitalize;
}

.calendar table {
    width: 100%;
    table-layout: fixed;
}

.calendar th {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--gray);
    text-transform: uppercase;
    text-align: center;
    padding: 0.4rem 0;
}

.calendar td {
    text-align: center;
    padding: 0.15rem;
}

.calendar-day {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin: 0 auto;
    border-radius: 50%;
    font-size: 0.85rem;
    font-weight: 500;
    border: none;
    background: none;
    color: var(--dark);
    cursor: default;
    position: relative;
    transition: all var(--transition);
}

.calendar-day.today {
    font-weight: 700;
    border: 2px solid var(--primary-light);
}

.calendar-day.past,
.calendar-day.disabled {
    color: var(--gray-light);
    cursor: default;
}

.calendar-day.available {
    cursor: pointer;
    color: var(--dark);
    font-weight: 600;
}

.calendar-day.available::after {
    content: '';
    position: absolute;
    bottom: 3px;
    left: 50%;
    transform: translateX(-50%);
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background-color: var(--success);
}

/* Only apply hover on devices that support it (not touch) */
@media (hover: hover) {
    .calendar-day.available:hover {
        background-color: rgba(27, 58, 92, 0.1);
        color: var(--primary);
    }

    .calendar-day.available:hover::after {
        background-color: var(--primary);
    }
}

.calendar-day.selected,
.calendar-day.selected:hover {
    background: var(--primary-dark);
    color: var(--white);
}

.calendar-day.selected::after,
.calendar-day.selected:hover::after {
    background-color: var(--white);
}


/* --------------------------------------------
   Time Slots
   -------------------------------------------- */
.time-slots {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    min-height: 40px;
}

.time-slots-placeholder {
    font-size: 0.85rem;
    color: var(--gray);
    margin: 0;
    padding: 0.5rem 0;
}

.time-slot-btn {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid var(--gray-light);
    border-radius: 4px;
    background-color: var(--white);
    color: var(--dark);
    cursor: pointer;
    transition: all var(--transition);
}

.time-slot-btn:hover {
    border-color: var(--primary-light);
    background-color: var(--light);
}

.time-slot-btn.active {
    background: var(--primary-dark);
    color: var(--white);
    border-color: var(--primary);
}

.time-slot-btn .slot-vagas {
    display: block;
    font-size: 0.7rem;
    font-weight: 400;
    opacity: 0.8;
}

.time-slot-btn:disabled {
    opacity: 0.4;
    cursor: default;
}


/* --------------------------------------------
   People Selector
   -------------------------------------------- */
.people-selector {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: 1rem;
}

.people-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--gray-light);
    background-color: var(--light);
    color: var(--dark);
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition);
    user-select: none;
}

.people-minus {
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.people-plus {
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.people-btn:hover:not(:disabled) {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

.people-btn:disabled {
    opacity: 0.3;
    cursor: default;
}

.people-count {
    width: 50px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--dark);
    border-top: 1px solid var(--gray-light);
    border-bottom: 1px solid var(--gray-light);
    background-color: var(--white);
}


/* --------------------------------------------
   Booking Total & CTA
   -------------------------------------------- */
.booking-breakdown {
    margin-top: 1.25rem;
    margin-bottom: 1rem;
}

.booking-breakdown-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.45rem 0;
    font-size: 0.95rem;
    color: var(--text-gray);
}

.booking-breakdown-row[hidden] {
    display: none;
}

.booking-breakdown-label {
    font-weight: 500;
}

.booking-breakdown-value {
    font-weight: 600;
    color: var(--dark);
}

.booking-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    margin-bottom: 1rem;
    /* margin-top: 1rem; */
    border-top: 1px solid var(--gray-light);
}

.booking-total-label {
    font-size: 1rem;
    font-weight: 600;
    color: var(--dark);
}

.price-total {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--accent);
}

.booking-trust-note {
    margin: 0.85rem 0 0;
    color: var(--text-gray);
    font-size: 0.84rem;
    line-height: 1.5;
    text-align: center;
}

#btn-reservar:disabled {
    opacity: 0.5;
    cursor: default;
    transform: none;
}


/* --------------------------------------------
   Loading Spinner
   -------------------------------------------- */
.booking-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.booking-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid var(--gray-light);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

/* --- Calendar loading overlay (troca de mês) --- */
#booking-calendar {
    position: relative;
}

.calendar-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    border-radius: var(--radius-sm);
    z-index: 5;
    animation: calendarOverlayFade 0.18s ease;
}

.calendar-overlay .booking-spinner {
    width: 36px;
    height: 36px;
    border-width: 3px;
}

@keyframes calendarOverlayFade {
    from { opacity: 0; }
    to   { opacity: 1; }
}

#booking-calendar.is-loading .calendar {
    pointer-events: none;
    user-select: none;
    filter: grayscale(0.4);
}

#booking-calendar.is-loading .calendar-day,
#booking-calendar.is-loading .calendar-nav-btn {
    opacity: 0.55;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.booking-error {
    font-size: 0.85rem;
    color: var(--danger);
    padding: 0.5rem 0;
    text-align: center;
}


/* --------------------------------------------
   Reviews Section
   -------------------------------------------- */
.reviews-section {
    padding: 3rem 0;
}

.reviews-list {
    max-width: 800px;
    margin: 0 auto;
}

.review-card {
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--gray-light);
}

.review-card:last-child {
    border-bottom: none;
}

.review-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.review-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background-color: var(--primary);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    flex-shrink: 0;
}

.review-name {
    display: block;
    font-size: 0.95rem;
    color: var(--dark);
    margin-bottom: 0.15rem;
}

.review-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.review-meta .stars {
    font-size: 0.85rem;
}

.review-date {
    font-size: 0.8rem;
    color: var(--gray);
}

.review-comment {
    font-size: 0.95rem;
    color: var(--gray);
    line-height: 1.7;
    margin-bottom: 0;
}


/* --------------------------------------------
   Location Map
   -------------------------------------------- */
.location-section {
    padding: 3rem 0;
}

.location-map {
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.location-map iframe {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: var(--radius);
}


/* --------------------------------------------
   Related Tours (Horizontal Scroll)
   -------------------------------------------- */
.related-section {
    padding: 3rem 0 4rem;
    background-color: var(--light);
}

.related-scroll {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    padding-bottom: 1rem;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
}

.related-scroll::-webkit-scrollbar {
    height: 6px;
}

.related-scroll::-webkit-scrollbar-thumb {
    background-color: var(--gray-light);
    border-radius: 3px;
}

.related-card {
    min-width: 280px;
    max-width: 320px;
    flex-shrink: 0;
    scroll-snap-align: start;
}

@media (min-width: 768px) {
    .related-card {
        min-width: 300px;
    }
}


/* --------------------------------------------
   Responsive Adjustments
   -------------------------------------------- */
@media (max-width: 767px) {
    .detail-header {
        padding-top: 6.25rem;
        padding-bottom: 0.75rem;
    }

    .detail-title-row h1 {
        font-size: 2rem;
        line-height: 1.08;
    }

    .gallery-section {
        padding-top: 0.5rem;
        padding-bottom: 1.25rem;
    }

    .gallery-main {
        aspect-ratio: 4 / 3;
        border-radius: 8px;
    }

    .booking-sidebar-inner {
        padding: 1rem;
        border-radius: 8px;
        box-shadow: 0 14px 34px rgba(16, 24, 32, 0.12);
    }

    .booking-price-main {
        font-size: 1.65rem;
    }

    .booking-price-header {
        margin-bottom: 1rem;
        padding-bottom: 0.75rem;
    }

    .booking-section-title {
        margin-top: 1rem;
        margin-bottom: 0.55rem;
    }

    .calendar th {
        font-size: 0.64rem;
        padding: 0.25rem 0;
    }

    .calendar-day {
        width: 40px;
        height: 40px;
        font-size: 0.8rem;
    }

    .time-slots {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.5rem;
    }

    .time-slot-btn {
        min-height: 48px;
        padding: 0.6rem 0.5rem;
        text-align: center;
    }

    .people-btn,
    .people-count {
        width: 48px;
        height: 48px;
    }

    .booking-total {
        position: sticky;
        bottom: 0;
        z-index: 3;
        
        padding: 0.85rem 1rem;
        background: rgba(255, 255, 255, 0.96);
        backdrop-filter: blur(10px);
        border-top: 1px solid var(--border);
        border-bottom: 1px solid var(--border);
    }

    #btn-reservar {
        min-height: 56px;
    }

    .booking-trust-note {
        font-size: 0.8rem;
    }

    .review-card {
        padding: 1rem 0;
    }
}
