/* Egypt Tours Calendar v3 — Front-End */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@400;500;600&family=Jost:wght@300;400;500&display=swap');

.etc-wrap {
    font-family: 'Jost', sans-serif;
    max-width: 760px;
    margin: 0 auto;
    position: relative;
    --tour-color: #1a5f5a;
}

/* Header */
.etc-cal-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.etc-cal-title { font-family: 'Cormorant Garamond', serif; font-size: 26px; font-weight: 600; color: var(--tour-color); line-height: 1; }

.etc-legend { display: flex; gap: 14px; }
.etc-legend-item { display: flex; align-items: center; gap: 5px; font-size: 12px; color: #7a6e64; }
.etc-dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; vertical-align: -1px; }
.etc-dot-open { background: #dff0eb; border: 1px solid #8fccba; }
.etc-dot-ontrip { background: #f0faf6; border: 1px solid #c9ece0; }
.etc-dot-full { background: #f5d5cc; border: 1px solid #e3ab9c; }
.etc-sunrise-ico { color: #c9973a; font-size: 12px; margin-right: 1px; }

.etc-nav { display: flex; align-items: center; gap: 10px; }
.etc-nav button { background: none; border: 1px solid #e8d9c4; border-radius: 50%; width: 32px; height: 32px; font-size: 20px; color: var(--tour-color); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background .15s; padding: 0; line-height: 1; }
.etc-nav button:hover { background: #d4ebe9; border-color: var(--tour-color); }
.etc-month-label { font-family: 'Cormorant Garamond', serif; font-size: 18px; font-weight: 500; min-width: 160px; text-align: center; }

/* Day labels */
.etc-day-labels { display: grid; grid-template-columns: repeat(7,1fr); gap: 3px; margin-bottom: 3px; }
.etc-day-labels div { text-align: center; font-size: 11px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: #7a6e64; padding: 6px 0; }
.etc-day-labels .etc-trip-day { color: var(--tour-color); font-weight: 700; }

/* Grid */
.etc-grid { display: grid; grid-template-columns: repeat(7,1fr); gap: 3px; }
.etc-loading { grid-column: 1/-1; text-align: center; padding: 40px; color: #7a6e64; font-size: 14px; }

/* ── Cells ──────────────────────────────────────────────────
   Four visual types:
     .etc-cell-other      = padding from prev/next month (faint)
     (no trip class)      = empty available day (transparent)
     .etc-cell-start      = a departure day (bookable, solid)
     .etc-cell-mid        = a continuation "on trip" day (light wash)
     .etc-cell-changeover = a start day that is ALSO a checkout (corner wedge)
*/
.etc-cell { min-height: 86px; border-radius: 8px; padding: 7px 7px 6px; background: transparent; border: 1px solid transparent; transition: background .12s, border-color .12s, transform .1s, box-shadow .12s; display: flex; flex-direction: column; gap: 2px; cursor: default; position: relative; overflow: hidden; }
.etc-cell-other { opacity: .3; min-height: 86px; }

.etc-cell-today .etc-cell-num { background: #c9973a; color: #fff; border-radius: 50%; width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; font-weight: 500; }

/* Departure (start) day — solid, clearly bookable */
.etc-cell-start { background: #dff0eb; border-color: #8fccba; cursor: pointer; }
.etc-cell-start:hover { background: #cfe8e0; border-color: var(--tour-color); transform: translateY(-1px); box-shadow: 0 3px 12px rgba(26,95,90,.15); }
.etc-cell-start.etc-cell-full { background: #f5d5cc; border-color: #e3ab9c; cursor: not-allowed; }
.etc-cell-start.etc-cell-full:hover { transform: none; box-shadow: none; }

/* On-trip continuation day — light wash, not clickable */
.etc-cell-mid { background: #f0faf6; border-color: transparent; }

.etc-cell-cancelled { background: #f0f0f0; opacity: .5; }

/* Top row: date number + status pill */
.etc-cell-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 4px; position: relative; z-index: 2; }
.etc-cell-num { font-size: 13px; font-weight: 500; color: var(--color-text-tertiary, #999); line-height: 1.15; }
.etc-cell-start .etc-cell-num { color: #0f6e56; font-weight: 500; }
.etc-cell-start.etc-cell-full .etc-cell-num { color: #b84a2e; }
.etc-cell-mid .etc-cell-num { color: #8cc3b3; }

.etc-cell-tag { font-size: 8.5px; font-weight: 500; letter-spacing: .03em; padding: 1px 5px; border-radius: 3px; display: inline-block; width: fit-content; white-space: nowrap; }
.etc-tag-open { background: #5dcaa5; color: #04342c; }
.etc-tag-full { background: #b84a2e; color: #fff; }

/* Route + duration (start days) */
.etc-cell-route { font-size: 10.5px; line-height: 1.25; color: #0f6e56; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; position: relative; z-index: 2; margin-top: 1px; }

/* "on trip" / "checkout" label on continuation days */
.etc-cont-label { font-size: 10px; color: #7fb9a8; margin-top: auto; display: flex; align-items: center; gap: 3px; position: relative; z-index: 2; }
.etc-cont-label .etc-sunrise-ico { font-size: 11px; }

/* Modal */
.etc-modal-overlay { position: fixed; inset: 0; background: rgba(28,28,28,.55); z-index: 99999; display: flex; align-items: center; justify-content: center; padding: 20px; backdrop-filter: blur(3px); }
.etc-modal { background: #fffdf9; border-radius: 14px; width: 100%; max-width: 460px; max-height: 92vh; overflow-y: auto; padding: 28px 30px 24px; position: relative; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.etc-modal-close { position: absolute; top: 14px; right: 16px; background: #f5ede0; border: none; border-radius: 50%; width: 30px; height: 30px; font-size: 18px; color: #7a6e64; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; line-height: 1; }
.etc-modal-close:hover { background: #e8d9c4; }


/* Form */
.etc-modal-title { font-family: 'Cormorant Garamond', serif; font-size: 22px; font-weight: 600; color: var(--tour-color); margin: 0 0 6px; }
.etc-trip-summary { background: #f5ede0; border-left: 3px solid #c9973a; border-radius: 0 7px 7px 0; padding: 10px 14px; margin-bottom: 18px; font-size: 13px; color: #7a6e64; }
.etc-trip-summary strong { display: block; color: #1c1c1c; font-size: 14px; font-weight: 500; margin-bottom: 2px; }
.etc-trip-summary a { color: var(--tour-color); font-weight: 500; }

.etc-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.etc-field { margin-bottom: 14px; }
.etc-field label { display: block; font-size: 11px; font-weight: 500; letter-spacing: .07em; text-transform: uppercase; color: #7a6e64; margin-bottom: 5px; }
.etc-field input[type="text"], .etc-field input[type="email"], .etc-field input[type="tel"], .etc-field input[type="number"], .etc-field select, .etc-field textarea {
    width: 100%; border: 1px solid #e8d9c4; border-radius: 6px; padding: 9px 11px; font-size: 14px; font-family: 'Jost', sans-serif; color: #1c1c1c; background: #fff; box-sizing: border-box; outline: none; transition: border-color .15s, box-shadow .15s; }
.etc-field input:focus, .etc-field select:focus, .etc-field textarea:focus { border-color: var(--tour-color); box-shadow: 0 0 0 3px rgba(26,95,90,.1); }
.etc-field textarea { resize: vertical; min-height: 64px; }
.etc-field-options { display: flex; flex-direction: column; gap: 6px; }
.etc-field-options label { font-size: 13px; letter-spacing: 0; text-transform: none; color: #1c1c1c; font-weight: 400; display: flex; align-items: center; gap: 8px; }
.etc-field-options label input { margin: 0; }

.etc-private-notice { background: #faece1; border-left: 3px solid #c9973a; padding: 10px 14px; border-radius: 0 6px 6px 0; font-size: 13px; color: #7a6e64; margin: 10px 0; }
.etc-private-notice strong { color: #1c1c1c; }

.etc-submit-btn { width: 100%; background: var(--tour-color); color: #fff; border: none; border-radius: 7px; padding: 12px; font-family: 'Jost', sans-serif; font-size: 15px; font-weight: 500; cursor: pointer; margin-top: 6px; transition: opacity .15s; }
.etc-submit-btn:hover { opacity: .88; }
.etc-submit-btn:disabled { opacity: .5; cursor: not-allowed; }
.etc-error { background: #f5d5cc; border: 1px solid #e8b8ae; border-radius: 6px; padding: 10px 14px; font-size: 13px; color: #b84a2e; margin-bottom: 14px; }
.etc-success-wrap { text-align: center; padding: 20px 0 10px; }
.etc-success-icon { font-size: 52px; margin-bottom: 12px; display: block; }
.etc-success-title { font-family: 'Cormorant Garamond', serif; font-size: 24px; font-weight: 600; color: var(--tour-color); margin: 0 0 8px; }
.etc-success-msg { font-size: 14px; color: #7a6e64; line-height: 1.6; }

@media (max-width: 600px) {
    .etc-cal-title { font-size: 20px; }
    .etc-cell { min-height: 70px; padding: 5px 4px; gap: 1px; }
    .etc-cell-other { min-height: 70px; }
    .etc-cell-num { font-size: 12px; }
    .etc-cell-route { font-size: 9px; }
    .etc-cell-price { font-size: 12px; }
    .etc-cell-tag { font-size: 7.5px; padding: 1px 3px; }
    .etc-cell-duration { font-size: 8px; padding: 0 4px; }
    .etc-cont-label { font-size: 8.5px; }
    .etc-am-label { font-size: 7.5px; top: 19px; }
    .etc-form-row { grid-template-columns: 1fr; }
    .etc-modal { padding: 22px 18px 18px; }
}
/* Very small phones: hide route text to avoid clutter, keep price + duration */
@media (max-width: 400px) {
    .etc-cell-route { display: none; }
    .etc-cell { min-height: 60px; }
    .etc-cell-other { min-height: 60px; }
}

/* Hide JSON data containers */
.etc-wrap .etc-fields-data { display: none !important; }

/* Duration badge — small inline pill */
.etc-cell-duration {
    display: inline-block;
    font-size: 9px;
    font-weight: 500;
    padding: 1px 5px;
    border-radius: 3px;
    background: rgba(15,110,86,0.12);
    color: #0f6e56;
    width: fit-content;
    margin-top: 1px;
    position: relative;
    z-index: 2;
}

/* ============================================================
   v3.5 — clean span, price, changeover wedge
   ============================================================ */

/* Price — prominent, bottom-anchored */
.etc-cell-price {
    font-size: 14px;
    font-weight: 500;
    color: #0f6e56;
    margin-top: auto;
    line-height: 1.15;
    width: fit-content;
    position: relative;
    z-index: 2;
}
.etc-cell-start.etc-cell-full .etc-cell-price { color: #8a3422; }
.etc-cell-price small { font-size: 9px; font-weight: 400; opacity: .8; }

/* ── Multi-day connecting bar across spanned days ─────────── */
.etc-span-multi::before {
    content: "";
    position: absolute;
    left: -5px;
    right: -5px;
    bottom: 6px;
    height: 3px;
    background: #5dcaa5;
    z-index: 1;
}
.etc-span-multi.etc-span-start::before { left: 8px; border-radius: 2px 0 0 2px; }
.etc-span-multi.etc-span-last::before  { right: 8px; border-radius: 0 2px 2px 0; }

/* ── Changeover day: corner wedge (AM checkout) over a departure ── */
.etc-cell-changeover .etc-wedge {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 1;
    background: linear-gradient(125deg, #cfe6de 0%, #cfe6de 36%, transparent 36.4%);
    pointer-events: none;
}
.etc-am-label {
    font-size: 8.5px;
    color: #6f8d84;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    position: relative;
    margin-top: 1px;
    width: fit-content;
}
.etc-am-label .etc-sunrise-ico { font-size: 10px; }
/* changeover day's connecting bar comes in from the left (ending trip) */
.etc-cell-changeover.etc-span-multi::before { left: -5px; right: 8px; border-radius: 0 2px 2px 0; }

/* Legend swatch for changeover/half */
.etc-legend-item .etc-dot-half {
    background: linear-gradient(125deg, #cfe6de 0 45%, #dff0eb 45% 100%);
    border: 1px solid #8fccba;
}

/* ── Price block in the booking popup ─────────────────────── */
.etc-price-block {
    background: #fff;
    border: 1px solid #e8d9c4;
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 16px;
}
.etc-price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    padding: 3px 0;
}
.etc-price-row strong { color: var(--tour-color); font-size: 16px; }
.etc-checkout-note { font-size: 12px; color: #7a6e64; font-style: italic; }

/* Route in booking popup summary */
.etc-summary-route { display: block; font-size: 13px; font-weight: 500; color: var(--tour-color); margin: 2px 0 4px; }

/* Supplement rows in price block */
.etc-price-sub { font-size: 12px; color: #7a6e64; }
.etc-price-sub strong { color: #7a6e64; font-size: 13px; }

/* Booking popup: occupancy hint + live estimate */
.etc-field-hint { display:block; font-size:11px; color:#7a6e64; margin-top:3px; }
.etc-estimate {
    display:flex; justify-content:space-between; align-items:center;
    background:#eef6f3; border:1px solid #cfe6de; border-radius:8px;
    padding:10px 14px; margin:4px 0 14px; font-size:14px;
}
.etc-estimate strong { color:var(--tour-color); font-size:17px; }

/* Past departures — visible but not bookable */
.etc-cell-past { opacity: .5; }
.etc-cell-past.etc-cell-start { cursor: default; background: #eef0ef; border-color: #dfe3e1; }
.etc-cell-past.etc-cell-start:hover { background: #eef0ef; border-color: #dfe3e1; transform: none; box-shadow: none; }
.etc-cell-past .etc-cell-price { color: #9aa3a0; }
.etc-tag-past { background: #b3bcb8; color: #fff; }

/* Short-notice alert in booking popup */
.etc-shortnotice {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    background: #fff6e5;
    border: 1px solid #f0d8a8;
    border-radius: 8px;
    padding: 11px 13px;
    margin: 4px 0 16px;
    font-size: 13px;
    line-height: 1.4;
    color: #6b5424;
}
.etc-shortnotice-ico { font-size: 16px; line-height: 1; flex-shrink: 0; }
.etc-shortnotice strong { color: #8a5a00; }

/* Cell duration now reads "4 Days – 3 Nights" — allow it to wrap gracefully */
.etc-cell-duration { white-space: normal; line-height: 1.25; }

/* Check-in / check-out block in booking popup */
.etc-checkinout {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 8px;
    padding: 8px 11px;
    background: #eef6f3;
    border: 1px solid #cfe6de;
    border-radius: 8px;
    font-size: 13px;
}
.etc-cio-item { display: flex; flex-direction: column; line-height: 1.25; }
.etc-cio-lbl { font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: #7a948c; }
.etc-cio-item { color: var(--tour-color); font-weight: 600; }
.etc-cio-sep { color: #9ab8af; font-size: 15px; }

/* ===== Mobile agenda list (shown ≤600px, hidden on desktop) ===== */
.etc-agenda { display: none; }

@media (max-width: 600px) {
    /* Hide the month grid + weekday labels; show the agenda instead */
    .etc-wrap .etc-grid,
    .etc-wrap .etc-day-labels { display: none; }
    .etc-wrap .etc-agenda { display: block; }
}

.etc-ag-row {
    display: flex;
    align-items: stretch;
    gap: 12px;
    background: #fff;
    border: 1px solid var(--etc-border, #e4ded2);
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 10px;
}
.etc-ag-clickable { cursor: pointer; transition: box-shadow .15s, transform .15s, border-color .15s; }
.etc-ag-clickable:hover { box-shadow: 0 6px 18px rgba(26,95,90,.12); border-color: var(--tour-color); }
.etc-ag-clickable:focus-visible { outline: 2px solid var(--tour-color); outline-offset: 2px; }
.etc-ag-row-past { opacity: .6; }

/* Date block */
.etc-ag-date {
    flex: 0 0 52px;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    background: var(--tour-color); color: #fff; border-radius: 9px; padding: 6px 4px;
    align-self: flex-start;
}
.etc-ag-row-past .etc-ag-date { background: #b3bcb8; }
.etc-ag-dow { font-size: 10px; letter-spacing: .08em; opacity: .9; }
.etc-ag-daynum { font-size: 22px; font-weight: 700; line-height: 1.05; }
.etc-ag-mon { font-size: 11px; opacity: .9; }

/* Main content */
.etc-ag-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.etc-ag-name { font-weight: 600; font-size: 15px; color: #2a2a28; }
.etc-ag-meta { font-size: 13px; color: #5a5650; }
.etc-ag-range { font-size: 12px; color: #7a746c; }
.etc-ag-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.etc-ag-price { font-size: 15px; font-weight: 700; color: var(--tour-color); }

/* Status pills */
.etc-ag-status { font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 20px; white-space: nowrap; }
.etc-ag-open { background: #e1f5ee; color: #0f6e56; }
.etc-ag-full { background: #fde8e8; color: #a32d2d; }
.etc-ag-cancelled { background: #eee; color: #777; }
.etc-ag-past { background: #eceeed; color: #7d857f; }

/* CTA */
.etc-ag-cta { display: flex; align-items: center; }
.etc-ag-book {
    background: var(--tour-color); color: #fff; font-size: 13px; font-weight: 600;
    padding: 8px 16px; border-radius: 22px; white-space: nowrap;
}
.etc-ag-empty { text-align: center; color: #8a847b; padding: 30px 10px; font-style: italic; }

/* ===== Agenda: collapsible past departures ===== */
.etc-ag-toggle {
    display: block; width: 100%; text-align: left; cursor: pointer;
    background: #f4f1ea; border: 1px solid #e4ded2; border-radius: 10px;
    padding: 10px 14px; margin-bottom: 10px; font-size: 13px; color: #6b655c;
    font-family: inherit;
}
.etc-ag-toggle:hover { background: #efe9df; }
.etc-ag-toggle-caret { display: inline-block; transition: transform .15s; }
.etc-ag-toggle.is-open .etc-ag-toggle-caret { transform: rotate(90deg); }
.etc-ag-past-wrap[hidden] { display: none; }

/* ===== Agenda: bottom month nav (mobile only) ===== */
.etc-ag-nav { display: none; }
@media (max-width: 600px) {
    .etc-ag-nav {
        display: flex; align-items: center; justify-content: space-between; gap: 8px;
        margin-top: 16px; padding-top: 14px; border-top: 1px solid #e4ded2;
    }
}
.etc-ag-nav-prev, .etc-ag-nav-next {
    background: #fff; border: 1px solid var(--tour-color); color: var(--tour-color);
    border-radius: 22px; padding: 9px 16px; font-size: 13px; font-weight: 600;
    cursor: pointer; font-family: inherit; white-space: nowrap;
}
.etc-ag-nav-prev:hover, .etc-ag-nav-next:hover { background: var(--tour-color); color: #fff; }
.etc-ag-nav-label { font-size: 13px; color: #7a746c; font-weight: 600; text-align: center; }

/* ===== Mobile details-first popup gate ===== */
.etc-book-gate {
    display: block; width: 100%; margin: 4px 0 6px;
    background: var(--tour-color); color: #fff; border: none; border-radius: 26px;
    padding: 14px; font-size: 16px; font-weight: 600; cursor: pointer; font-family: inherit;
}
.etc-book-gate:hover { filter: brightness(1.05); }
@media (min-width: 601px) { .etc-book-gate { display: none; } }
.etc-book-section.etc-book-collapsed { display: block; }
@media (max-width: 600px) {
    .etc-book-section.etc-book-collapsed { display: none; }
}
