﻿@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;0,9..40,800&display=swap');

/* GGT Shortcodes - Stili personalizzati */

/* ============================================================
   SEARCHBOX - Struttura principale
   ============================================================ */

.searchbox {
    position: relative;
    padding: 0.5rem 1rem;
}

.searchbox__wrapper {
    position: relative;
}

/* Form orizzontale */
.searchbox__form {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Campo singolo */
.costa-field {
    display: flex;
    position: relative;
    border-radius: 2rem;
    border: 1px solid rgba(153, 153, 153, 0.23);
    background: white;
    align-items: center;
    width: 100%;
}

/* Input */
.searchbox__wrapper input,
.costa-input {
    display: flex;
    align-items: center;
    border: 0;
    padding: 1.2rem 1rem 1.2rem 3rem;
    outline: none;
    border-radius: 2rem;
    font-family: inherit;
    flex: 1;
    box-sizing: border-box;
    background: transparent;
    font-size: 0.95rem;
    color: #111827;
    cursor: pointer;
    width: 100%;
}

.costa-input::placeholder {
    color: #9ca3af;
}

/* Icona a sinistra (posizionata in assoluto dentro il field) */
.costa-icon {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    padding: 1rem;
    color: #9ca3af;
    pointer-events: none;
    flex-shrink: 0;
}

/* Pulsante cerca */
.costa-submit {
    background: var(--e-global-color-primary, #f5a623);
    color: #fff;
    border: 0;
    border-radius: 2rem;
    margin: 0 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    padding: 1rem;
    width: 52px;
    height: 52px;
    flex-shrink: 0;
    cursor: pointer;
    line-height: 0;
}

.costa-submit:hover {
    opacity: 0.9;
}

.search-icon {
    flex-shrink: 0;
}

.search-text {
    white-space: nowrap;
    transition: all 0.3s ease;
    font-weight: 600;
}

/* Container dropdown pannelli — nascosto di default */
.costa-content {
    position: fixed;
    display: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border-radius: 0.5rem;
    background: white;
    padding: 1rem;
    z-index: 99999;
    opacity: 0;
    transform: scale(0.98);
    transition: opacity 0.2s ease, transform 0.2s ease;
    min-width: 320px;
}

.costa-content.active {
    display: block;
    opacity: 1;
    transform: scale(1);
}

.costa-content.swapping {
    opacity: 0;
    transform: scale(0.95);
}

/* Pannello singolo — il JS usa style.display = "block" per mostrarlo */
.costa-panel {
    display: none;
}

/* Item cliccabile */
.costa-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-radius: 0.5rem;
    transition: background-color 0.2s;
}

.costa-item:hover {
    background-color: rgba(35, 142, 203, 0.1);
}

/* Calendario */
.calendar-wrapper {
    font-family: inherit;
}

.calendar-wrapper button {
    font-family: inherit;
}

.calendar-days button:not(:disabled) {
    cursor: pointer;
}

/* Autocomplete Results */
.autocomplete-results {
    animation: fadeIn 0.2s ease-in-out;
}

/* Scroll nel pannello autocomplete destinazioni */
[data-for="destination"] .space-y-1,
[data-for="from"] .space-y-1 {
    max-height: 320px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

[data-for="destination"] .space-y-1::-webkit-scrollbar,
[data-for="from"] .space-y-1::-webkit-scrollbar {
    width: 6px;
}

[data-for="destination"] .space-y-1::-webkit-scrollbar-track,
[data-for="from"] .space-y-1::-webkit-scrollbar-track {
    background: transparent;
}

[data-for="destination"] .space-y-1::-webkit-scrollbar-thumb,
[data-for="from"] .space-y-1::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 3px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Pulsante submit con spinner */
.costa-submit svg.animate-spin {
    animation: spin 1s linear infinite;
}

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

/* Responsive adjustments */
@media (max-width: 900px) {
    .searchbox__form {
        flex-direction: column;
        gap: 0.75rem;
    }

    .costa-field {
        width: 100%;
    }

    .costa-submit {
        width: 100%;
        justify-content: center;
        border-radius: 2rem;
        margin: 0;
        height: auto;
        padding: 1rem;
    }

    .costa-content {
        position: fixed;
        min-width: calc(100vw - 2rem);
        left: 1rem !important;
    }
}

/* Loading Modal */
.ggt-loading-modal {
    position: fixed !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center !important;
    justify-content: center !important;
    z-index: 999999 !important;
}

.ggt-loading-modal.active {
    display: flex !important;
}

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

.ggt-loading-card {
    background: white;
    border-radius: 1rem;
    padding: 0;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    animation: slideUp 0.4s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.ggt-loading-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
    position: relative;
}

.ggt-loading-image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 250px;
    background: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.6) 100%);
    display: flex;
    align-items: flex-start;
    padding: 1.5rem;
}

.ggt-loading-location {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.ggt-loading-location svg {
    flex-shrink: 0;
}

.ggt-loading-content {
    padding: 2rem;
    text-align: center;
}

.ggt-loading-spinner {
    width: 60px;
    height: 60px;
    margin: 0 auto 1.5rem;
    position: relative;
}

.ggt-loading-spinner::before {
    content: '';
    display: block;
    width: 100%;
    height: 100%;
    border: 4px solid #f3f3f3;
    border-top-color: var(--e-global-color-primary, #238ECB);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.ggt-loading-text {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
    font-family: 'League Spartan', sans-serif;
}

.ggt-loading-subtext {
    font-size: 0.95rem;
    color: #666;
    font-family: 'League Spartan', sans-serif;
}

/* Focus states */
.costa-input:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
}

/* Loading state */
.costa-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* ============================================================
   COSTA INTEGRATION - Card risultati crociere
   ============================================================ */

.costa-results {
    margin-top: 2rem;
    padding: 1rem;
}

.costa-loading {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 24px;
    font-size: 15px;
    color: #6b7280;
}

.costa-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #e5e7eb;
    border-top-color: #003580;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.costa-results-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

/* Compatibilità classi vecchie */
.costa-btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: background 0.2s;
    margin-top: 12px;
}

.costa-btn--primary {
    background: #003580;
    color: #fff;
}

.costa-btn--primary:hover {
    background: #00235a;
    color: #fff;
}

.costa-error {
    color: #dc2626;
    font-size: 15px;
}

/* Campi nascosti */
.costa-hidden-destination,
.costa-hidden-from,
.costa-hidden-date-from,
.costa-hidden-date-to {
    display: none;
}

/* Pulsante conferma passeggeri */
.costa-confirm-people {
    width: 100%;
    margin-top: 16px;
    padding: 10px 16px;
    border-radius: 10px;
    background: var(--e-global-color-primary, #003580);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: opacity 0.2s;
}

.costa-confirm-people:hover {
    opacity: 0.9;
}

/* Calendario giorni */
.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 8px;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.calendar-day {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    width: 36px;
    margin: 0 auto;
    border-radius: 50%;
    font-size: 14px;
    color: #374151;
    cursor: pointer;
    background: none;
    border: none;
    transition: background 0.15s, color 0.15s;
}

.calendar-day:hover:not(.is-disabled):not(.is-empty) {
    background: rgba(35, 142, 203, 0.1);
}

.calendar-day.is-today {
    font-weight: 700;
    color: var(--e-global-color-primary, #003580);
}

.calendar-day.is-selected {
    background: var(--e-global-color-primary, #003580);
    color: #fff;
}

.calendar-day.is-disabled {
    color: #d1d5db;
    cursor: not-allowed;
}

.calendar-day.is-empty {
    cursor: default;
}

.calendar-day.is-range-start,
.calendar-day.is-range-end {
    background: var(--e-global-color-primary, #003580);
    color: #fff;
    border-radius: 50%;
}

.calendar-day.is-in-range {
    background: rgba(35, 142, 203, 0.18);
    border-radius: 4px;
    color: #1a4b7a;
}

@media (max-width: 600px) {
    .costa-results-list {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   RISULTATI CROCIERE — Layout sidebar + griglia
   ============================================================ */

/* Topbar: contatore + sort */
.cr-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0 16px;
    gap: 12px;
    flex-wrap: wrap;
}

.cr-count {
    font-size: 1.05rem;
    font-weight: 700;
    color: #111827;
}

.cr-sort {
    padding: 7px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.88rem;
    color: #374151;
    background: #fff;
    cursor: pointer;
    outline: none;
}

/* Layout sidebar + griglia */
.cr-layout {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

/* Sidebar filtri */
.cr-sidebar {
    flex: 0 0 20vw;
    min-width: 0;
    background: #f8f9fb;
    border: 1px solid #eaecef;
    border-radius: 12px;
    padding: 20px 16px;
    position: sticky;
    top: 80px;
}

.cr-filter-group {
    border-bottom: 1px solid #eaecef;
    padding-bottom: 16px;
    margin-bottom: 16px;
}

.cr-filter-group:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.cr-filter-title {
    font-size: 0.67rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: #9ca3af;
    margin: 0 0 10px;
}

.cr-filter-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.845rem;
    color: #374151;
    cursor: pointer;
    padding: 5px 8px;
    border-radius: 7px;
    line-height: 1.4;
    user-select: none;
    transition: background 0.12s;
}

.cr-filter-label:hover {
    background: #fff;
}

.cr-filter-label input[type="checkbox"] {
    flex-shrink: 0;
    width: 15px;
    height: 15px;
    accent-color: #003580;
    cursor: pointer;
    margin: 0;
}

.cr-filter-label input[type="checkbox"]:checked + span {
    color: #003580;
    font-weight: 600;
}

.cr-filter-label .cr-filter-cnt {
    margin-left: auto;
    font-size: 0.73rem;
    color: #b0b8c4;
    font-variant-numeric: tabular-nums;
}

.cr-filter-show-more {
    background: none;
    border: none;
    color: #003580;
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    padding: 5px 8px 0;
    display: flex;
    align-items: center;
    gap: 4px;
}

.cr-filter-show-more:hover { text-decoration: underline; }

/* Area principale (griglia) */
.cr-main {
    flex: 1;
    min-width: 0;
}

/* Griglia 3 colonne */
.costa-results-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

/* Apply DM Sans to results area */
.cr-results-wrap,
.cr-results-wrap * {
    font-family: 'DM Sans', sans-serif;
}

/* ============================================================
   CARD SINGOLA CROCIERA
   ============================================================ */

.cr-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #eaecef;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.25s, transform 0.25s;
    position: relative;
}

.cr-card:hover {
    box-shadow: 0 8px 28px rgba(0,0,0,0.10);
    transform: translateY(-2px);
}

/* Foto */
.cr-card__photo-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    flex-shrink: 0;
}

.cr-card__photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.cr-card:hover .cr-card__photo {
    transform: scale(1.05);
}

/* Gradient overlay sulla foto */
.cr-card__photo-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.42) 0%, transparent 55%);
    pointer-events: none;
    z-index: 1;
}

/* Badge Last Minute */
.cr-card__badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #fff;
    color: #111;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 4px;
    letter-spacing: 0.4px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.18);
    text-transform: uppercase;
    z-index: 2;
}

/* Cuore (preferiti) */
.cr-card__heart {
    position: absolute;
    top: 8px;
    right: 10px;
    background: none;
    border: none;
    cursor: pointer;
    color: rgba(255,255,255,0.90);
    font-size: 1.15rem;
    line-height: 1;
    padding: 4px;
    text-shadow: 0 1px 3px rgba(0,0,0,0.4);
    transition: color 0.15s;
    z-index: 2;
}
.cr-card__heart:hover { color: #ef4444; }

/* Miniatura mappa — 144px, cliccabile per lightbox */
.cr-card__map {
    position: absolute;
    bottom: 8px;
    right: 8px;
    width: 144px;
    height: 144px;
    border-radius: 9px;
    overflow: hidden;
    box-shadow: 0 3px 12px rgba(0,0,0,0.45);
    background: #d1d5db;
    opacity: 0;
    transition: opacity 0.4s, transform 0.2s;
    z-index: 3;
    cursor: zoom-in;
}
.cr-card__map--loaded { opacity: 1; }
.cr-card__map:hover { transform: scale(1.03); }
.cr-card__map-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Body */
.cr-card__body {
    padding: 12px 14px 14px;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 0;
}

/* Top row: tipo + pills nave/durata */
.cr-card__toprow {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 5px;
}
.cr-card__type {
    font-size: 0.67rem;
    font-weight: 600;
    color: #003580;
    text-transform: uppercase;
    letter-spacing: 0.07em;
}
.cr-card__pills {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.cr-card__pill {
    font-size: 0.67rem;
    font-weight: 500;
    color: #4b5563;
    background: #f3f4f6;
    border-radius: 20px;
    padding: 2px 7px;
    white-space: nowrap;
}

/* Titolo destinazione */
.cr-card__title {
    font-size: 0.97rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 4px;
    line-height: 1.25;
}

/* Date e porto (riga compatta) */
.cr-card__dates {
    font-size: 0.74rem;
    color: #6b7280;
    margin-bottom: auto;
    padding-bottom: 10px;
    line-height: 1.5;
}

/* Bottom bar: prezzo a sinistra, CTA a destra */
.cr-card__bottom {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 10px;
    padding-top: 10px;
    border-top: 1px solid #f1f3f5;
    margin-top: auto;
}

/* Blocco prezzo */
.cr-card__price-wrap {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.cr-card__price-label {
    font-size: 0.67rem;
    color: #9ca3af;
    line-height: 1.2;
}
.cr-card__price {
    font-size: 1.55rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1;
    letter-spacing: -0.02em;
}
.cr-card__price-pp {
    font-size: 0.72rem;
    color: #6b7280;
}
.cr-card__price-note {
    font-size: 0.63rem;
    color: #b0b8c4;
    line-height: 1.3;
}

/* Skeleton prezzo in caricamento */
.cr-price-loading .cr-card__price-label { color: #d1d5db; }
.cr-price-skeleton {
    width: 90px;
    height: 22px;
    border-radius: 4px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: cr-shimmer 1.4s infinite;
    margin: 3px 0 5px;
}
@keyframes cr-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* CTA */
.cr-card__cta {
    display: inline-flex;
    align-items: center;
    padding: 9px 13px;
    background: #f5a623;
    color: #111;
    font-size: 0.8rem;
    font-weight: 700;
    border-radius: 8px;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background 0.15s;
}
.cr-card__cta:hover { background: #e09510; color: #111; text-decoration: none; }

/* ── Lightbox mappa ── */
.cr-lightbox {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0,0,0,0.84);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
    animation: cr-lb-in 0.18s ease;
}
@keyframes cr-lb-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}
.cr-lightbox img {
    max-width: 88vw;
    max-height: 82vh;
    border-radius: 10px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
    pointer-events: none;
    display: block;
}
.cr-lightbox__close {
    position: fixed;
    top: 20px;
    right: 26px;
    color: #fff;
    font-size: 2.2rem;
    line-height: 1;
    cursor: pointer;
    background: none;
    border: none;
    opacity: 0.75;
    transition: opacity 0.15s;
}
.cr-lightbox__close:hover { opacity: 1; }

/* Responsive */
@media (max-width: 1100px) {
    .cr-sidebar { flex: 0 0 190px; }
    .costa-results-list { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
    .cr-layout { flex-direction: column; }
    .cr-sidebar { flex: none; width: 100%; position: static; }
    .costa-results-list { grid-template-columns: repeat(2, 1fr); }
    .cr-card__map { width: 100px; height: 100px; }
}
@media (max-width: 560px) {
    .costa-results-list { grid-template-columns: 1fr; }
    .cr-card__map { width: 80px; height: 80px; }
}