/* Nano Checkout - NOW AT THE TOP */
.nano-checkout {
    position: fixed;
    top: calc(var(--top-bar-h) + var(--header-h));
    left: 0;
    width: 100%;
    background: var(--bg-end);
    /* Oscuro sólido por defecto en TODAS las páginas, misma lógica que
       .top-bar/.fixed-header en header.css. Antes era --bg-start
       (transparente), se perdía sobre el fondo claro fuera del home. */
    border-bottom: 1px solid var(--accent-gold);
    padding: 3px 0;
    z-index: 1000;
    transition: background 0.4s ease;
}

/* Solo páginas con hero (home real, y tour vía index.php con route-home)
   empiezan transparentes */
body.route-home .nano-checkout {
    background: var(--bg-start);
}

body.scrolled-all .nano-checkout {
    background: var(--bg-end);
}

.checkout-main-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    width: 100%;
}

.product-info-group {
    display: flex;
    align-items: center;
    gap: 15px;
}

.unit-pricing {
    font-size: 1.1rem;
    font-weight: 800;
    color: #FFFFFF;
    display: inline-flex;
}

.total-pricing {
    font-size: 1.2rem;
    font-weight: 900;
    color: var(--accent-yellow);
    background: rgba(255, 255, 0, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
}

.checkout-middle-row {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-grow: 1;
    justify-content: space-around;
}

.checkout-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-options {
    padding: 6px 15px;
    background: #1E40AF;
    border: none;
    border-radius: 2px;
    color: #FFFFFF;
    font-weight: 800;
    font-size: 0.75rem;
    text-transform: uppercase;
    cursor: pointer;
    transition: var(--transition);
    height: 32px;
    line-height: 1;
}

.btn-options:hover {
    background: #0033A0;
    box-shadow: 0 4px 15px rgba(0, 40, 104, 0.4);
}

.btn-wa {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #25D366;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    transition: var(--transition);
    flex-shrink: 0;
}

.btn-wa img {
    width: 24px;
    height: 24px;
}

.btn-wa:hover {
    transform: scale(1.1);
}

/* Payment Selection Inline */
.payment-selection {
    margin-top: 15px;
    padding: 20px;
    background: rgba(0, 20, 40, 0.98);
    /* Harmonious Navy */
    border: 1px solid var(--accent-gold);
    border-radius: 8px;
    text-align: center;
}

.payment-selection.hidden {
    display: none;
}

.payment-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin: 10px 0;
}

.btn-text {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    font-size: 0.8rem;
    text-decoration: underline;
}

.current-price {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text-light);
}

/* Ciudad inline junto al nombre del tour */
.product-info-city {
    color: var(--accent-gold);
    font-size: 0.7rem;
    font-weight: 400;
    margin-left: 6px;
    opacity: 0.85;
    white-space: nowrap;
}

.product-info h3 {
    display: inline;
    color: #FFFFFF;
    font-weight: 700;
}

.product-info-name-row {
    display: flex;
    align-items: baseline;
    flex-wrap: nowrap;
    gap: 4px;
    min-width: 0;
}

.currency-select {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-light);
    border-radius: 4px;
    margin-left: 5px;
    padding: 2px 5px;
    font-size: 0.8rem;
    cursor: pointer;
}

.currency-select option {
    color: #000;
    /* Black text for dropdown options as requested */
}

.variation-select {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: var(--accent-yellow);
    border-radius: 4px;
    padding: 3px 6px;
    font-size: 0.8rem;
    font-family: inherit;
    cursor: pointer;
    margin-top: 4px;
    display: block;
    max-width: 100%;
}

.variation-fake {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background: transparent;
    border: none;
    padding: 0;
    cursor: default;
    pointer-events: none;
    color: var(--accent-yellow);
    font-size: 0.8rem;
    font-family: inherit;
}

.variation-select option {
    color: #000;
}

.checkout-controls {
    display: flex;
    gap: 20px;
}

.control-group {
    display: flex;
    flex-direction: column;
}

.control-group label {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 4px;
}

.control-group input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 5px;
    border-radius: 4px;
}

.date-picker-wrapper {
    position: relative;
    display: inline-block;
}

.date-picker-input {
    cursor: pointer;
    width: 100px;
    padding-right: 24px;
}

.date-picker-icon {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.9rem;
    pointer-events: none;
}

.chk-datepicker-popup {
    z-index: 2000;
    width: 260px;
    background: var(--bg-end);
    border: 1px solid var(--accent-gold);
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    color: white;
    font-family: inherit;
}

.chk-datepicker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.chk-datepicker-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--accent-yellow);
    text-transform: uppercase;
}

.chk-datepicker-nav {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 4px;
    width: 26px;
    height: 26px;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
}

.chk-datepicker-nav:disabled {
    opacity: 0.25;
    cursor: not-allowed;
}

.chk-datepicker-nav:not(:disabled):hover {
    border-color: var(--accent-gold);
}

.chk-datepicker-daynames {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    margin-bottom: 4px;
}

.chk-datepicker-daynames span {
    text-align: center;
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
}

.chk-datepicker-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.chk-datepicker-day {
    aspect-ratio: 1;
    background: transparent;
    border: none;
    color: white;
    font-size: 0.8rem;
    border-radius: 4px;
    cursor: pointer;
}

.chk-datepicker-day:not(:disabled):hover {
    background: rgba(255, 204, 0, 0.15);
}

.chk-datepicker-blank {
    cursor: default;
}

.chk-datepicker-day-disabled {
    color: rgba(255, 255, 255, 0.2);
    cursor: not-allowed;
    text-decoration: line-through;
}

.chk-datepicker-day-today {
    border: 1px solid var(--accent-gold);
}

.chk-datepicker-day-selected {
    background: var(--accent-yellow);
    color: var(--primary);
    font-weight: 700;
}

.date-notice {
    display: block;
    font-size: 0.65rem;
    color: var(--accent-yellow);
    margin-top: 3px;
    max-width: 160px;
    line-height: 1.3;
}

.date-notice.hidden {
    display: none;
}

.minor-warning {
    background: rgba(191, 10, 48, 0.15);
    border: 1px solid var(--ferrari-red);
    color: #FFFFFF;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 8px 12px;
    border-radius: 6px;
    margin: 8px 0;
}

.minor-warning.hidden {
    display: none;
}

.spinner-qty {
    display: flex;
    align-items: center;
}

.spinner-qty button {
    background: var(--accent-gold);
    border: none;
    color: var(--primary);
    width: 25px;
    height: 25px;
    cursor: pointer;
    font-weight: bold;
}

.spinner-qty input {
    width: 40px;
    text-align: center;
    border-left: none;
    border-right: none;
    -moz-appearance: textfield;
}

.spinner-qty input::-webkit-outer-spin-button,
.spinner-qty input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.btn-buy {
    padding: 6px 15px;
    background: var(--ferrari-red);
    border: none;
    border-radius: 2px;
    color: #FFFFFF;
    font-weight: 800;
    font-size: 0.75rem;
    text-transform: uppercase;
    cursor: pointer;
    transition: var(--transition);
    height: 32px;
    line-height: 1;
}

.btn-buy:hover {
    background: #ff3b1a;
    box-shadow: 0 4px 15px rgba(255, 40, 0, 0.4);
}

.payment-icons {
    font-size: 0.8rem;
    margin-top: 4px;
    opacity: 0.8;
}

/* Chat Widget */
.ai-chat-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1001;
}

.chat-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #25D366;
    border: none;
    cursor: pointer;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.chat-toggle:hover {
    transform: scale(1.1);
}

.chat-toggle img {
    width: 35px;
}

.chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 320px;
    height: 450px;
    background: white;
    border-radius: 15px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    color: #333;
    transition: var(--transition);
}

.chat-window.hidden {
    opacity: 0;
    transform: translateY(20px) scale(0.9);
    pointer-events: none;
}

.chat-header {
    background: #000;
    color: white;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 2px solid var(--accent-gold);
}

.chat-header .avatar {
    font-size: 1.5rem;
}

.chat-header .status {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.chat-header .status span {
    font-size: 0.7rem;
    opacity: 0.8;
}

#close-chat {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

.chat-messages {
    flex-grow: 1;
    padding: 15px;
    overflow-y: auto;
    background: #E5DDD5;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.message {
    padding: 8px 12px;
    border-radius: 8px;
    max-width: 80%;
    font-size: 0.9rem;
}

.message.bot {
    background: white;
    align-self: flex-start;
}

.vcard-container {
    padding: 10px 0;
}

.vcard-card {
    background: white;
    border-radius: 10px;
    padding: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-left: 4px solid var(--accent);
}

.vcard-info {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.vcard-info strong {
    font-size: 0.8rem;
}

.vcard-info span {
    font-size: 0.7rem;
    color: #666;
}

.btn-vcard {
    background: var(--accent);
    border: none;
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.7rem;
    cursor: pointer;
}

.chat-input {
    padding: 10px;
    display: flex;
    gap: 10px;
    background: #f0f0f0;
}

.chat-input input {
    flex-grow: 1;
    padding: 8px;
    border-radius: 20px;
    border: 1px solid #ddd;
    outline: none;
}

.chat-input button {
    background: var(--ferrari-red);
    border: none;
    color: white;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
}

.payment-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 20px 0;
}

.pay-opt {
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
}

.pay-opt:hover {
    background: var(--accent-gold);
    color: var(--secondary);
}

.nano-checkout .container {
    margin-top: 15px !important;
}

/* Toggle Logic: Hide checkout elements except WhatsApp */
body.checkout-disabled .product-info-group,
body.checkout-disabled .checkout-middle-row,
body.checkout-disabled .btn-buy {
    display: none !important;
}

body.checkout-disabled .checkout-main-row {
    justify-content: flex-end;
}

/* Nano Checkout Accordion & Info Icon */
.btn-info-action {
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin-left: 10px;
    transition: var(--transition);
}

.btn-info-action:hover {
    transform: scale(1.1);
}

.info-icon {
    font-style: normal;
    font-size: 1.1rem;
    color: white;
    border: 2px solid white;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    font-weight: 800;
}

.accordion-panel {
    background: var(--bg-end);
    padding: 30px;
    padding-bottom: 60px;
    border-top: 1px solid var(--glass-border);
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    max-height: calc(100dvh - 160px);
    overflow-y: auto;
    color: white;
    z-index: 1000;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
    visibility: visible;
}

.accordion-panel.hidden {
    opacity: 0;
    transform: translateY(-8px);
    visibility: hidden;
    pointer-events: none;
}

.accordion-panel .panel-header {
    margin-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
}

.accordion-panel .panel-header h4 {
    color: var(--accent-yellow);
    margin-bottom: 5px;
}

.accordion-panel .stars {
    color: var(--accent-gold);
    font-size: 1.2rem;
}

.accordion-panel .rating-number {
    font-size: 0.9rem;
    color: #ccc;
    margin-left: 5px;
}

.accordion-panel .panel-content p.main-desc {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #eee;
    margin-bottom: 20px;
}

.tour-gallery {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    margin-bottom: 15px;
    padding-bottom: 4px;
}

.tour-gallery-thumb {
    width: 90px;
    height: 90px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: var(--transition);
}

.tour-gallery-thumb:hover {
    border-color: var(--accent-gold);
    transform: scale(1.03);
}

/* Sub-accordions from DB */
.sub-accordion {
    margin-bottom: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    padding: 10px;
}

.sub-accordion summary {
    font-weight: 600;
    color: var(--accent-gold);
    cursor: pointer;
    outline: none;
    user-select: none;
}

.sub-accordion .sub-content {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed rgba(255, 255, 255, 0.1);
    font-size: 0.9rem;
    color: #ddd;
    line-height: 1.5;
}

/* Floating Close Button */
.btn-close-overlay {
    position: sticky;
    top: 0px;
    float: right;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    width: 35px;
    height: 35px;
    border-radius: 50%;
    font-weight: bold;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
    transition: var(--transition);
}

.btn-close-overlay:hover {
    background: white;
    color: var(--primary);
    transform: scale(1.1);
}

/* Body Scroll Lock for Overlays */
body.no-scroll {
    overflow: hidden !important;
}

/* Cart Customizer Panel */
.cart-section {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.cart-section.hidden {
    display: none;
}

.cart-section h5 {
    color: var(--accent-gold);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.pax-row,
.extra-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.pax-row {
    margin-bottom: 22px;
}

.extra-row {
    margin-bottom: 8px;
}

.pax-row label,
.extra-row label {
    font-size: 0.85rem;
    text-transform: uppercase;
    flex: 1 1 auto;
    min-width: 0;
}

.pax-controls {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 0 0 auto;
}

.pax-qty {
    width: 60px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 5px;
    border-radius: 4px;
    text-align: center;
}

.pax-unit-price {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 4px;
    white-space: nowrap;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.55);
    font-weight: 500;
}

.pax-line-total {
    font-size: 0.85rem;
    color: var(--accent-yellow);
    font-weight: 700;
    flex: 0 0 auto;
    text-align: right;
    min-width: 60px;
}

.extra-price {
    font-size: 0.85rem;
    color: var(--accent-yellow);
    font-weight: 700;
}

.extra-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-gold);
}

.extra-combo-row label {
    display: flex;
    align-items: center;
    gap: 8px;
}

.extra-combo-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-gold);
    flex-shrink: 0;
}

.extra-combo-row .spinner-qty button:disabled,
.extra-combo-row .pax-qty:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.cart-summary {
    border-bottom: none;
    padding-bottom: 0;
    margin-top: 20px;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.1rem;
    font-weight: 900;
    color: var(--accent-yellow);
    margin-bottom: 15px;
}

#cart-total-value {
    font-size: 1.3rem;
}

#btn-apply-cart {
    width: 100%;
    padding: 10px;
    font-size: 0.9rem;
}

@media (max-width: 992px) {
    .nano-checkout {
        padding: 3px 0;
    }

    .checkout-main-row {
        flex-direction: column;
        gap: 3px;
        align-items: stretch;
    }

    .product-info-group {
        width: 100%;
        justify-content: space-between;
        gap: 10px;
        margin-bottom: 2px;
    }

    .product-info h3 {
        font-size: 0.8rem;
        color: #FFFFFF;
        text-align: left;
    }

    .unit-pricing {
        font-size: 0.8rem;
    }

    .checkout-middle-row {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        margin-top: 0;
    }

    .checkout-controls {
        display: flex;
        align-items: center;
        gap: 8px;
        width: 100%;
        justify-content: space-between;
    }

    .total-pricing {
        font-size: 1rem;
        padding: 1px 6px;
    }

    .checkout-actions {
        display: flex;
        align-items: center;
        gap: 8px;
        margin-top: 2px;
        justify-content: center;
        width: 100%;
    }

    .checkout-actions .btn-wa {
        position: static;
    }

    .btn-buy {
        padding: 5px 12px;
        font-size: 0.7rem;
        width: auto;
    }
}