/**
 * Activity Booking Calendar - Stroller ENIX
 */

:root {
    --enix-primary: var(--e-global-color-primary, var(--wp--preset--color--primary, var(--enix-primary)));
    --enix-primary-hover: color-mix(in srgb, var(--enix-primary) 82%, #000);
}

.enix-activity-booking-widget {
    font-family: inherit;
    max-width: 560px;
    margin: 0 auto;
}

/* ── Pax Selector ─────────────────────────────────────────────── */
.enix-pax-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 16px;
    background: #f8f9fa;
    border: 1px solid #e1e4e8;
    border-radius: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.enix-pax-bar label {
    font-size: 13px;
    font-weight: 600;
    color: #444;
    margin-right: 4px;
}

.enix-pax-bar input[type="number"] {
    width: 60px;
    padding: 5px 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    text-align: center;
}

.enix-pax-field {
    display: flex;
    align-items: center;
    gap: 6px;
}

.enix-child-ages-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 16px;
    background: #f8f9fa;
    border: 1px solid #e1e4e8;
    border-top: none;
    border-radius: 0 0 8px 8px;
    margin-top: -16px;
    margin-bottom: 16px;
}

.enix-child-ages-bar label {
    font-size: 12px;
    color: #555;
}

.enix-child-ages-bar input[type="number"] {
    width: 52px;
    padding: 4px 6px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 13px;
    text-align: center;
}

/* ── Calendar Container ───────────────────────────────────────── */
.enix-calendar-wrap {
    border: 1px solid #e1e4e8;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 16px;
}

.enix-calendar-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--enix-primary);
    color: #fff;
    padding: 12px 16px;
}

.enix-calendar-nav button {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.4);
    color: #fff;
    padding: 4px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    transition: background 0.15s;
}

.enix-calendar-nav button:hover {
    background: rgba(255,255,255,0.15);
}

.enix-calendar-nav button:disabled {
    opacity: 0.35;
    cursor: default;
}

.enix-calendar-month-label {
    font-size: 16px;
    font-weight: 600;
    text-transform: capitalize;
}

/* ── Calendar Grid ────────────────────────────────────────────── */
.enix-calendar-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

.enix-calendar-table thead th {
    text-align: center;
    padding: 8px 4px;
    font-size: 12px;
    font-weight: 700;
    color: #666;
    text-transform: uppercase;
    border-bottom: 1px solid #e1e4e8;
    background: #f8f9fa;
}

.enix-calendar-table tbody td {
    text-align: center;
    padding: 2px;
    vertical-align: top;
}

/* Day cell */
.enix-day-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 58px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    user-select: none;
    padding: 4px;
    gap: 2px;
}

.enix-day-cell:hover {
    background: #d0e8f5;
    transform: scale(1.04);
}

.enix-day-num {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    line-height: 1;
}

.enix-day-price {
    font-size: 10px;
    color: rgba(255,255,255,0.9);
    line-height: 1;
}

/* Available day */
.enix-day-available {
    background: var(--enix-primary);
}

.enix-day-available:hover {
    background: var(--enix-primary-hover);
    transform: scale(1.04);
}

/* Selected day */
.enix-day-selected {
    background: #2e9dd8 !important;
    box-shadow: 0 2px 8px rgba(46,157,216,0.5);
    transform: scale(1.06) !important;
}

.enix-day-selected .enix-day-num,
.enix-day-selected .enix-day-price {
    color: #fff;
}

/* Past / unavailable day */
.enix-day-past {
    color: #ccc;
    cursor: default;
}

.enix-day-past:hover {
    background: transparent;
    transform: none;
}

.enix-day-past .enix-day-num {
    color: #ccc;
    font-weight: 400;
}

/* Empty cell */
.enix-day-empty {
    cursor: default;
}

/* Loading state on cells */
.enix-day-loading .enix-day-price,
.enix-day-price.enix-day-loading {
    animation: enix-pulse 1.2s infinite;
}

@keyframes enix-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* No price available - "Consulte" state */
.enix-day-price.enix-day-no-price {
    font-size: 9px;
    color: #fff;
    font-weight: 400;
}

/* ── Details Panel ────────────────────────────────────────────── */
.enix-booking-details {
    border: 1px solid #e1e4e8;
    border-radius: 8px;
    overflow: hidden;
    margin-top: 4px;
}

.enix-details-loading {
    padding: 24px;
    text-align: center;
    color: #888;
    font-size: 14px;
}

.enix-details-loading .spinner {
    float: none;
    margin: 0 auto 8px;
    display: block;
    visibility: visible;
}

.enix-option-card {
    padding: 16px 18px;
    border-bottom: 1px solid #f0f0f0;
}

.enix-option-card:last-child {
    border-bottom: none;
}

.enix-option-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}

.enix-option-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--enix-primary);
    line-height: 1.4;
    flex: 1;
}

.enix-option-toggle {
    background: none;
    border: none;
    color: #2e9dd8;
    font-size: 13px;
    cursor: pointer;
    padding: 0;
    white-space: nowrap;
    text-decoration: underline;
}

.enix-option-description {
    font-size: 12px;
    color: #666;
    line-height: 1.5;
    margin-bottom: 12px;
    display: none;
}

.enix-option-description.is-open {
    display: block;
}

.enix-option-pricing-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.enix-option-price-info {
    flex: 1;
}

.enix-price-breakdown {
    font-size: 12px;
    color: #666;
    margin-bottom: 4px;
    line-height: 1.4;
}

.enix-price-total {
    font-size: 22px;
    font-weight: 800;
    color: var(--enix-primary);
    line-height: 1;
}

.enix-price-total sup {
    font-size: 13px;
    font-weight: 600;
    vertical-align: super;
    margin-right: 2px;
}

.enix-price-installments {
    font-size: 11px;
    color: #888;
    margin-top: 3px;
}

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

.enix-qty-select {
    padding: 7px 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
    min-width: 100px;
    cursor: pointer;
}

.enix-add-to-cart-btn {
    background: var(--enix-primary);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
}

.enix-add-to-cart-btn:hover {
    background: var(--enix-primary-hover);
}

.enix-add-to-cart-btn:disabled {
    background: #99aabb;
    cursor: default;
}

/* ── Messages ─────────────────────────────────────────────────── */
.enix-calendar-message {
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 14px;
    margin-top: 12px;
    display: none;
}

.enix-calendar-message.success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.enix-calendar-message.error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.enix-calendar-message.info {
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 480px) {
    .enix-pax-bar {
        gap: 10px;
    }

    .enix-day-cell {
        height: 48px;
    }

    .enix-day-num {
        font-size: 13px;
    }

    .enix-day-price {
        font-size: 9px;
    }

    .enix-option-pricing-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .enix-option-actions {
        width: 100%;
    }

    .enix-add-to-cart-btn {
        flex: 1;
    }
}
