/* ==========================================================================
   Costa Integration — Frontend Stylesheet
   ========================================================================== */

/* ---- Variabili CSS ---- */
:root {
	--costa-blue:        #003087;
	--costa-blue-light:  #0056d2;
	--costa-gold:        #c8a951;
	--costa-white:       #ffffff;
	--costa-gray-light:  #f5f6f7;
	--costa-gray:        #6c757d;
	--costa-border:      #dee2e6;
	--costa-radius:      0px;
	--costa-shadow:      0 2px 8px rgba(0,0,0,.05);
}

/* ---- Layout globale ---- */
.costa-search-wrap,
.costa-cruise-detail,
.costa-booking-wrap {
	margin: 0 auto;
	font-family: inherit;
}

/* ---- Form di ricerca ---- */
.costa-search-form {
	background: var(--costa-gray-light);
	border: 1px solid var(--costa-border);
	border-radius: var(--costa-radius);
	padding: 24px;
	margin-bottom: 30px;
}

.costa-form-row {
	display: flex;
	gap: 16px;
	flex-wrap: wrap;
	margin-bottom: 16px;
}

.costa-form-group {
	display: flex;
	flex-direction: column;
	flex: 1 1 200px;
}

.costa-form-group label {
	font-size: .85rem;
	font-weight: 600;
	margin-bottom: 6px;
	color: #333;
}

.costa-form-group input[type="date"],
.costa-form-group select {
	padding: 8px 12px;
	border: 1px solid var(--costa-border);
	border-radius: var(--costa-radius);
	font-size: .95rem;
	background: var(--costa-white);
	color: #333;
	transition: border-color .2s;
}

.costa-form-group input:focus,
.costa-form-group select:focus {
	outline: none;
	border-color: var(--costa-blue-light);
	box-shadow: 0 0 0 3px rgba(0,86,210,.15);
}

/* ---- Bottoni ---- */
.costa-btn {
	display: inline-block;
	padding: 10px 22px;
	font-size: .95rem;
	font-weight: 600;
	border-radius: var(--costa-radius);
	border: none;
	cursor: pointer;
	text-decoration: none;
	transition: background .2s, transform .1s;
}

.costa-btn--primary {
	background: var(--costa-blue);
	color: var(--costa-white);
}

.costa-btn--primary:hover {
	background: var(--costa-blue-light);
	color: var(--costa-white);
	transform: translateY(-1px);
}

.costa-btn--secondary {
	background: var(--costa-white);
	color: var(--costa-blue);
	border: 2px solid var(--costa-blue);
}

/* ---- Loading spinner ---- */
.costa-loading {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 20px;
    justify-content: center;
	color: var(--costa-gray);
}

.costa-spinner {
	display: inline-block;
	width: 22px;
	height: 22px;
	border: 3px solid var(--costa-border);
	border-top-color: var(--costa-blue);
	border-radius: 50%;
	animation: costa-spin .7s linear infinite;
}

@keyframes costa-spin {
	to { transform: rotate(360deg); }
}


/* ==========================================================================
   CRUISE DETAIL  (.cd-*)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:opsz,wght@9..40,300;9..40,400;9..40,500;9..40,600;9..40,700;9..40,800&display=swap');

.cd-wrap {
    font-family: 'DM Sans', sans-serif;
    color: #111827;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 0 60px;
}

/* ── Breadcrumb ── */
.cd-breadcrumb {
    font-size: 0.82rem;
    color: #6b7280;
    padding: 14px 0 20px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.cd-breadcrumb a { color: #6b7280; text-decoration: none; }
.cd-breadcrumb a:hover { text-decoration: underline; }
.cd-breadcrumb__sep { color: #d1d5db; }

/* ── Hero ── */
.cd-hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    border-radius: 14px;
    overflow: hidden;
    height: 360px;
    margin-bottom: 32px;
}
.cd-hero__map {
    background: #b3cde0;
    overflow: hidden;
}
.cd-hero__map-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.cd-hero__map-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #6b7280;
    font-size: 0.9rem;
}
.cd-hero__gallery {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 6px;
}
.cd-hero__photo {
    position: relative;
    overflow: hidden;
    background: #e5e7eb;
}
.cd-hero__photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s;
}
.cd-hero__photo:hover img { transform: scale(1.04); }
.cd-gallery-btn {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(255,255,255,0.92);
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    color: #111;
    transition: background 0.15s;
    font-family: 'DM Sans', sans-serif;
}
.cd-gallery-btn:hover { background: #fff; }

/* ── Body layout ── */
.cd-body {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 32px;
    align-items: flex-start;
}

/* ── Titolo block ── */
.cd-title {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.15;
    margin: 0 0 8px;
    letter-spacing: -0.02em;
}
.cd-title__accent {
    color: #003087;
    text-decoration: underline;
    text-decoration-color: #f5a623;
    text-underline-offset: 4px;
}
.cd-ports {
    font-size: 0.97rem;
    color: #4b5563;
    margin: 0 0 4px;
}
.cd-ship-name {
    font-size: 0.9rem;
    color: #6b7280;
    font-weight: 500;
    margin: 0 0 12px;
}
.cd-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.cd-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.74rem;
    font-weight: 600;
}
.cd-badge--avail { background: #dcfce7; color: #15803d; }
.cd-badge--star  { background: #fef9c3; color: #854d0e; }

/* ── Vantaggi ── */
.cd-vantaggi {
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #f8f9fb;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 28px;
}
.cd-vantaggio {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: #374151;
}
.cd-vantaggio__icon { color: #003087; flex-shrink: 0; }
.cd-vantaggio__info { color: #9ca3af; cursor: help; }

/* ── Sections ── */
.cd-section {
    margin-bottom: 36px;
}
.cd-section__title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 18px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f3f4f6;
}

/* ── Itinerario/Segments ── */
.cd-segments {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.cd-segment {
    display: grid;
    grid-template-columns: 90px 18px 1fr 80px;
    gap: 0 12px;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f3f4f6;
    position: relative;
}
.cd-segment:last-child { border-bottom: none; }
.cd-segment--sea { background: transparent; }
.cd-segment__day {
    display: flex;
    flex-direction: column;
}
.cd-segment__day-num {
    font-size: 0.72rem;
    font-weight: 700;
    color: #003087;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.cd-segment__date {
    font-size: 0.72rem;
    color: #9ca3af;
}
.cd-segment__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #003087;
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px #003087;
    justify-self: center;
}
.cd-segment--sea .cd-segment__dot { background: #93c5fd; box-shadow: 0 0 0 2px #93c5fd; }
.cd-segment__info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.cd-segment__port {
    font-size: 0.93rem;
    font-weight: 600;
    color: #111827;
    display: flex;
    align-items: center;
    gap: 8px;
}
.cd-segment__sea-badge {
    font-size: 0.65rem;
    background: #dbeafe;
    color: #1d4ed8;
    padding: 2px 7px;
    border-radius: 20px;
    font-weight: 600;
}
.cd-segment__times {
    font-size: 0.75rem;
    color: #6b7280;
}
.cd-segment__thumb {
    width: 72px;
    height: 52px;
    border-radius: 7px;
    overflow: hidden;
    flex-shrink: 0;
}
.cd-segment__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ── Ship specs ── */
.cd-ship-specs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}
.cd-spec {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f8f9fb;
    border-radius: 10px;
    padding: 14px 12px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #374151;
}
.cd-spec__icon { color: #003087; flex-shrink: 0; }

/* ── Fares table ── */
.cd-dep-info {
    font-size: 0.85rem;
    color: #6b7280;
    margin-bottom: 14px;
}
.cd-fares-table-wrap {
    overflow-x: auto;
    border-radius: 10px;
    border: 1px solid #eaecef;
}
.cd-fares-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.86rem;
}
.cd-fares-table thead th {
    background: #f8f9fb;
    padding: 12px 14px;
    text-align: left;
    font-weight: 700;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
    border-bottom: 1px solid #eaecef;
}
.cd-fares-table tbody tr:not(:last-child) td {
    border-bottom: 1px solid #f3f4f6;
}
.cd-fares-table td {
    padding: 12px 14px;
    vertical-align: middle;
}
.cd-fares-table__fare { min-width: 160px; }
.cd-immed-badge {
    display: inline-block;
    font-size: 0.65rem;
    background: #dcfce7;
    color: #15803d;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 6px;
    font-weight: 600;
}
.cd-fares-table__price {
    text-align: right;
    white-space: nowrap;
}
.cd-fare-price {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    color: #111827;
}
.cd-fare-btn {
    display: inline-block;
    margin-top: 4px;
    padding: 4px 10px;
    background: #f5a623;
    color: #111;
    font-size: 0.74rem;
    font-weight: 700;
    border-radius: 6px;
    text-decoration: none;
    transition: background 0.15s;
}
.cd-fare-btn:hover { background: #e09510; color: #111; }
.cd-fare-na { color: #d1d5db; }
.cd-fares-note {
    font-size: 0.73rem;
    color: #9ca3af;
    margin-top: 10px;
}

/* ── Sidebar ── */
.cd-sidebar {
    position: sticky;
    top: 80px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.cd-booking-box {
    background: #fff;
    border: 1px solid #eaecef;
    border-radius: 14px;
    padding: 22px 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.07);
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.cd-price-block {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.cd-price-block__label {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #9ca3af;
    font-weight: 600;
}
.cd-price-block__guarantee {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.78rem;
    color: #374151;
    font-weight: 500;
}
.cd-price-block__total {
    font-size: 0.88rem;
    color: #374151;
    margin-top: 6px;
}
.cd-price-block__total strong {
    font-size: 1.8rem;
    font-weight: 800;
    color: #111827;
    letter-spacing: -0.02em;
    display: block;
    line-height: 1;
}
.cd-price-block__pp {
    font-size: 0.82rem;
    color: #6b7280;
}
.cd-price-block__pp strong { color: #374151; font-weight: 600; }
.cd-price-block__note {
    font-size: 0.7rem;
    color: #9ca3af;
    line-height: 1.4;
    margin: 4px 0 0;
}
.cd-price-block__note a { color: #003087; }

.cd-booking-row {
    display: flex;
    gap: 10px;
}
.cd-booking-field {
    flex: 1;
    background: #f8f9fb;
    border: 1px solid #eaecef;
    border-radius: 8px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.cd-booking-field__label {
    font-size: 0.67rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #9ca3af;
    font-weight: 600;
}
.cd-booking-field__val {
    font-size: 0.88rem;
    font-weight: 600;
    color: #111827;
}
.cd-cta-btn {
    display: block;
    text-align: center;
    padding: 14px;
    background: #f5a623;
    color: #111;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 10px;
    text-decoration: none;
    transition: background 0.15s;
    letter-spacing: 0.01em;
}
.cd-cta-btn:hover { background: #e09510; color: #111; text-decoration: none; }
.cd-payments {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
    padding-top: 4px;
    filter: grayscale(0.3);
}
.cd-payments img { height: 20px; object-fit: contain; }

/* Mappa sidebar */
.cd-sidebar-map {
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    border: 1px solid #eaecef;
}
.cd-sidebar-map img {
    width: 100%;
    display: block;
    aspect-ratio: 1/1;
    object-fit: cover;
}
.cd-sidebar-map__label {
    position: absolute;
    bottom: 8px;
    left: 10px;
    font-size: 0.72rem;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* ── Trust footer ── */
.cd-trust {
    display: flex;
    gap: 24px;
    margin-top: 48px;
    padding: 28px 32px;
    background: #f8f9fb;
    border-radius: 14px;
    border: 1px solid #eaecef;
    flex-wrap: wrap;
}
.cd-trust__item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    flex: 1 1 240px;
}
.cd-trust__item strong {
    display: block;
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 4px;
}
.cd-trust__item p {
    font-size: 0.83rem;
    color: #6b7280;
    margin: 0;
    line-height: 1.5;
}

/* ── Responsive ── */
@media (max-width: 900px) {
    .cd-body {
        grid-template-columns: 1fr;
    }
    .cd-sidebar { position: static; }
    .cd-hero { height: 260px; }
}
@media (max-width: 600px) {
    .cd-hero {
        grid-template-columns: 1fr;
        height: auto;
    }
    .cd-hero__gallery { display: none; }
    .cd-hero__map { height: 220px; }
    .cd-ship-specs { grid-template-columns: repeat(2, 1fr); }
    .cd-segment { grid-template-columns: 70px 14px 1fr 60px; }
    .cd-title { font-size: 1.55rem; }
}
