.product-top-layout {
    display: grid;
    grid-template-columns: 1.35fr 0.7fr;
    gap: 1rem;
    align-items: start;
}

.product-main-column {
    min-width: 0;
    display: grid;
    gap: 1rem;
}

/* Dynamic Smart Gallery Grid (Adapts to image count) */
.product-gallery-wrap {
    display: grid;
    gap: 10px;
    height: 500px;
    border-radius: 24px;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: var(--cloud-shadow);
}

.gallery-link {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 16px;
    overflow: hidden;
    cursor: zoom-in;
}

.product-gallery-wrap figure {
    margin: 0;
    min-width: 0;
    border-radius: 16px;
    overflow: hidden;
}

.product-gallery-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
    transition: filter 0.3s ease;
}

.product-gallery-wrap img:hover {
    filter: brightness(0.9);
}

.gallery-main,
.gallery-thumb {
    min-height: 0;
}

/* 1. Exactly 3 Images Total (1 Big Left, 2 Stacked Right) */
.product-gallery-wrap:has(> :nth-child(3):last-child) {
    grid-template-columns: 2fr 1fr;
    grid-template-rows: 1fr 1fr;
}
.product-gallery-wrap:has(> :nth-child(3):last-child) > :nth-child(1) { grid-area: 1 / 1 / 3 / 2; }
.product-gallery-wrap:has(> :nth-child(3):last-child) > :nth-child(2) { grid-area: 1 / 2 / 2 / 3; }
.product-gallery-wrap:has(> :nth-child(3):last-child) > :nth-child(3) { grid-area: 2 / 2 / 3 / 3; }

/* 2. Exactly 4 Images Total (1 Big Left, 1 Wide Top Right, 2 Square Bottom Right) */
.product-gallery-wrap:has(> :nth-child(4):last-child) {
    grid-template-columns: 2fr 1fr 1fr;
    grid-template-rows: 1fr 1fr;
}
.product-gallery-wrap:has(> :nth-child(4):last-child) > :nth-child(1) { grid-area: 1 / 1 / 3 / 2; }
.product-gallery-wrap:has(> :nth-child(4):last-child) > :nth-child(2) { grid-area: 1 / 2 / 2 / 4; }
.product-gallery-wrap:has(> :nth-child(4):last-child) > :nth-child(3) { grid-area: 2 / 2 / 3 / 3; }
.product-gallery-wrap:has(> :nth-child(4):last-child) > :nth-child(4) { grid-area: 2 / 3 / 3 / 4; }

/* 3. 5 or More Images Total (1 Big Left, 4 Small Grid on Right) */
.product-gallery-wrap:has(> :nth-child(5)) {
    grid-template-columns: 2fr 1fr 1fr;
    grid-template-rows: 1fr 1fr;
}
.product-gallery-wrap:has(> :nth-child(5)) > :nth-child(1) { grid-area: 1 / 1 / 3 / 2; }
.product-gallery-wrap:has(> :nth-child(5)) > :nth-child(2) { grid-area: 1 / 2 / 2 / 3; }
.product-gallery-wrap:has(> :nth-child(5)) > :nth-child(3) { grid-area: 2 / 2 / 3 / 3; }
.product-gallery-wrap:has(> :nth-child(5)) > :nth-child(4) { grid-area: 1 / 3 / 2 / 4; }
.product-gallery-wrap:has(> :nth-child(5)) > :nth-child(5) { grid-area: 2 / 3 / 3 / 4; }

/* Hide anything beyond 5 images in the desktop grid */
.product-gallery-wrap > :nth-child(n+6) {
    display: none;
}

.gallery-hidden-links {
    display: none;
}

.gallery-dots {
    display: none;
}

.gallery-dot {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    border: 0;
    background: rgba(17, 63, 97, 0.26);
    transition: transform 0.2s ease, background-color 0.2s ease;
    cursor: pointer;
}

.gallery-dot.is-active {
    background: var(--sky-strong);
    transform: scale(1.2);
}

.product-heading {
    display: grid;
    gap: 0.45rem;
}

.product-heading h1 {
    font-size: clamp(1.6rem, 3vw, 2.25rem);
}

.product-meta-line {
    margin-top: 0.35rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.option-tag {
    display: inline-flex;
    align-items: center;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    color: #0369a1;
    padding: 6px 12px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.85rem;
    margin-right: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
}

.thumb-nav-wrap {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 10px 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.thumb-nav-wrap::-webkit-scrollbar {
    height: 6px;
}

.thumb-nav-item {
    flex: 0 0 60px;
    width: 60px;
    height: 60px;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid transparent;
    opacity: 0.6;
    transition: all 0.2s ease;
    cursor: pointer;
    padding: 0;
    background: #fff;
}

.thumb-nav-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.thumb-nav-item.is-active {
    border-color: var(--sky-strong);
    opacity: 1;
    transform: scale(1.05);
}

.product-summary-card {
    position: static;
    border-radius: var(--radius-card);
    border: 1px solid var(--line);
    background: var(--surface);
    box-shadow: var(--cloud-shadow);
    padding: 1rem;
    display: grid;
    gap: 0.7rem;
}

.summary-price-text {
    display: grid;
    gap: 0.08rem;
    align-content: start;
}

.summary-price-label {
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-500);
    font-weight: 700;
}

.summary-price-value {
    font-size: clamp(1.45rem, 2.3vw, 2rem);
    font-weight: 850;
    color: var(--sky-strong);
    line-height: 1.08;
}

.summary-price-text.is-contact .summary-price-value {
    font-size: 1.34rem;
}

.summary-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.product-content-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 1rem;
}

.hotel-details-grid {
    grid-template-columns: 1.2fr 0.8fr;
}

.hotel-guide-copy {
    margin-bottom: 0.8rem;
}

.room-info-table {
    min-width: 0;
    border-radius: 16px;
    overflow: hidden;
}

.room-info-table th,
.room-info-table td {
    vertical-align: top;
}

.room-info-table th {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.hotel-basic-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 0.75rem;
}

.hotel-basic-list li {
    display: grid;
    gap: 0.22rem;
    padding: 0.66rem 0.72rem;
    border: 1px solid #d9ebf9;
    border-radius: 14px;
    background: #f8fcff;
}

.hotel-basic-list strong {
    font-size: 0.86rem;
    color: var(--text-900);
}

.hotel-basic-list span {
    color: var(--text-700);
    line-height: 1.5;
}

.hotel-important-notes {
    display: grid;
    gap: 0.7rem;
}

.hotel-important-notes p {
    margin: 0;
    padding: 0.65rem 0.72rem;
    border: 1px solid #d9ebf9;
    border-radius: 12px;
    background: #f8fcff;
    line-height: 1.6;
}

@media (min-width: 1024px) {
    .product-top-layout {
        display: flex;
        align-items: flex-start;
        gap: 1rem;
    }

    .product-main-column {
        flex: 1 1 0%;
        min-width: 0;
    }

    .booking-sidebar {
        flex: 0 0 clamp(280px, 33%, 360px);
        position: sticky;
        top: 20px;
        align-self: flex-start;
    }
}

.timeline-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 0.35rem;
}

.timeline-list .itinerary-item {
    position: relative;
    padding: 0.46rem 0.72rem 0.46rem 30px;
    border-radius: 14px;
    border: 1px solid #ddeffd;
    background: #f8fcff;
    color: var(--text-700);
    font-weight: 600;
}

.timeline-list .itinerary-item::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 0.92rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--sky-blue);
    box-shadow: 0 0 0 3px #e9f6ff;
}

.timeline-list .itinerary-item:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 15px;
    top: 1.7rem;
    bottom: -0.62rem;
    width: 1px;
    background: linear-gradient(180deg, #86cdf6 0%, #d9eefd 100%);
}

.bullet-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 0.52rem;
}

.bullet-list li {
    padding-left: 1.1rem;
    position: relative;
    color: var(--text-700);
}

.bullet-list li::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--coral);
    position: absolute;
    left: 0;
    top: 0.6rem;
}

.bullet-list.warning li::before {
    background: #4bbef0;
}

.sub-title {
    margin-top: 1rem;
}

.package-option-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.8rem;
}

.package-option-card {
    border: 1px solid var(--line);
    border-radius: 24px;
    overflow: hidden;
    background: #fff;
    box-shadow: var(--cloud-shadow);
}

.option-media {
    min-height: 170px;
    height: 200px;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.option-media img {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 170px;
    object-fit: cover;
}

.option-body {
    padding: 0.85rem 0.85rem 1.1rem;
    display: grid;
    gap: 0.45rem;
}

.package-option-card .card-footer {
    margin-top: 0.72rem;
    margin-bottom: 0.1rem;
}

.location-title {
    font-size: 1.5rem;
}

.location-stack {
    display: grid;
    gap: 1rem;
}

.map-full-width {
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--line);
    background: #eaf5ff;
}

.map-full-width iframe {
    display: block;
    width: 100%;
    height: 420px;
    border: 0;
}

.location-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.location-address-card {
    padding: 1rem;
    background: var(--bg-soft);
    border-radius: 20px;
    border: 1px solid #d8ebfa;
    display: grid;
    align-content: start;
    gap: 0.35rem;
}

.location-highlights {
    padding: 1rem;
    background: var(--bg-soft);
    border-radius: 20px;
    display: grid;
    align-content: start;
    gap: 0.7rem;
    height: 100%;
}

.location-highlights h3 {
    margin: 0;
    font-size: 1.1rem;
}

.location-address-card small {
    color: var(--text-500);
}

.location-address-card p {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-900);
}

/* Hide thumbnails on Desktop (since we have the grid) */
@media (min-width: 1025px) {
    .thumb-nav-wrap {
        display: none !important;
    }
}

/* Keep thumbnails visible on Mobile/Tablet */
@media (max-width: 1024px) {
    .thumb-nav-wrap {
        display: flex;
    }
}

@media (max-width: 1080px) {
    .product-content-grid {
        grid-template-columns: 1fr;
    }

    .package-option-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1023px) {
    .product-top-layout {
        grid-template-columns: 1fr;
    }

    .booking-sidebar,
    .product-summary-card {
        position: static;
    }
}

@media (max-width: 1024px) {
    .product-gallery-wrap {
        height: 440px;
    }
}

@media (max-width: 768px) {
    .map-full-width iframe {
        height: 300px;
    }

    .product-gallery-wrap {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        scrollbar-width: none;
        height: 350px;
        border-radius: 20px;
    }

    .product-gallery-wrap::-webkit-scrollbar {
        display: none;
    }

    .product-gallery-wrap figure {
        flex: 0 0 100%;
        min-width: 100%;
        border-radius: 0;
        scroll-snap-align: start;
    }

    .product-gallery-wrap img {
        height: 350px;
    }

    .product-gallery-wrap {
        grid-template-columns: unset;
        grid-template-rows: unset;
    }

    .product-gallery-wrap figure:first-child {
        grid-column: auto;
        grid-row: auto;
        min-height: 0;
    }

    .gallery-dots {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.42rem;
        margin-top: 0.5rem;
    }

    .thumb-nav-item {
        flex-basis: 64px;
        width: 64px;
        height: 64px;
    }

    .location-details-grid {
        grid-template-columns: 1fr;
    }
}
