:root {
    /* 🎨 Theme Colors (Overrideable) */
    --age-primary: #3b82f6;
    --age-secondary: #1e40af;
    --age-accent: #f59e0b;
    --age-bg: #ffffff;
    --age-text: #1f2937;
    --age-text-muted: #6b7280;
    --age-border: #e5e7eb;
    --age-error: #ef4444;
    --age-success: #10b981;

    /* 📐 Leayout & Radius (Premium) */
    --age-radius: 12px;
    --age-container-max: 1100px;
    --age-gap: 2rem;

    /* Premium Shadows (Soft & Hard) */
    --age-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.08);
    --age-glass: rgba(255, 255, 255, 0.8);
}

/* 📦 Core Container */
#alojagueb-engine-root {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--age-text);
    max-width: var(--age-container-max);
    margin: 0 auto;
    padding: 1rem;
    box-sizing: border-box;
    width: 100%;
    overflow-x: hidden;
    /* Prevent horizontal scroll triggers */
}

@media (max-width: 480px) {
    #alojagueb-engine-root {
        padding: 4px;
        /* Minimal padding to prevent cut-off */
        padding-bottom: 80px;
        /* Footer space */
    }
}

#alojagueb-engine-root * {
    box-sizing: border-box;
}

/* 🧱 Grid Layout (Desktop First) */
.age-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) 350px;
    /* Force left col to shrink if needed, right fixed */
    gap: 40px;
    margin-top: 2rem;
    position: relative;
    align-items: start;
}

/* 🖼️ Main Column (Calendar) */
.age-col-main {
    min-width: 0;
    /* Critical for Grid child to shrink if needed */
    background: #fff;
    border-radius: var(--age-radius);
    padding: 20px;
    /* Internal padding */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    /* Add subtle lift */
}

/* 🧾 Side Column (Summary) */
.age-col-side {
    position: relative;
    min-width: 300px;
}

/* 📌 Sticky Summary Behavior */
.age-sticky-summary {
    position: -webkit-sticky;
    position: sticky;
    top: 20px;
    /* Stick to top with gap */
    z-index: 100;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    /* Visuals */
    background: var(--age-bg);
    border: 1px solid var(--age-border);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.15);
    /* Floating Effect */
    border-radius: var(--age-radius);
    padding: 1.5rem;
    transition: all 0.3s ease;
}

/* 📱 Mobile Responsive (Aggressive Stack) */
@media (max-width: 1024px) {
    .age-grid {
        display: block !important;
        /* Force stack */
        width: 100% !important;
        margin-top: 1rem !important;
    }

    .age-col-main {
        width: 100% !important;
        margin-bottom: 30px;
        /* Space between calendar and summary */
        min-height: 400px;
        /* Ensure height for calendar */
    }

    .age-col-side {
        width: 100% !important;
    }

    .age-sticky-summary {
        position: static !important;
        /* Unstick on tablets/mobile */
        box-shadow: none;
        border: 1px solid #eee;
        width: 100% !important;
        max-height: none !important;
    }
}

/* 📱 Mobile Specific Override (Hardened) */
@media (max-width: 768px) {
    /* Inherits 1024px rules which are now robust */
}

/* 🧩 Components */
.age-card {
    background: var(--age-bg);
    border: 1px solid var(--age-border);
    border-radius: var(--age-radius);
    padding: 1.5rem;
    box-shadow: var(--age-shadow);
}

.age-btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 0.75rem 1.5rem;
    background-color: var(--age-primary);
    color: white;
    font-weight: 600;
    border-radius: var(--age-radius);
    border: none;
    cursor: pointer;
    transition: background-color 0.2s;
    width: 100%;
}

.age-btn:hover {
    background-color: var(--age-secondary);
}

.age-spinner {
    border: 3px solid rgba(0, 0, 0, 0.1);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border-left-color: var(--age-primary);
    animation: spin 1s linear infinite;
    display: inline-block;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Modal Overlay */
.age-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    animation: fadeIn 0.3s forwards;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

.age-modal {
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    position: relative;
    max-height: 85vh;
    /* Prevent cut-off */
    overflow-y: auto;
    /* Allow Scroll */
    display: flex;
    flex-direction: column;
}

/* 📅 Calendar Specifics */
.age-day {
    font-size: 1rem;
    /* Bigger numbers */
}

/* 🏷️ Min Stay Badge */
.age-min-stay-badge {
    position: absolute;
    top: 2px;
    left: 2px;
    background: #1f2937;
    color: white;
    font-size: 9px;
    font-weight: 700;
    line-height: 1;
    padding: 2px 4px;
    border-radius: 4px;
    z-index: 5;
}

/* 🎨 Force Colors (User Request) */
.age-day-available {
    background-color: #f0fdf4 !important;
    color: #15803d !important;
    border: 1px solid #dcfce7 !important;
    font-weight: 600;
}

.age-day-past {
    background-color: #fef2f2 !important;
    color: #cbd5e1 !important;
    /* Very muted */
    cursor: not-allowed !important;
    opacity: 0.5 !important;
    border: none !important;
}

.age-day-available:hover {
    background-color: #dcfce7 !important;
    transform: scale(1.05);
}

.age-day-price {
    font-size: 0.75rem;
    /* Readable small price */
    color: inherit;
    font-weight: normal;
    display: block;
    margin-top: 2px;
}

/* ❌ Hide Unwanted Footer Elements */
.age-mobile-footer {
    display: none !important;
}

/* 📱 Mobile Specific Override (Hardened V21.18) */
@media (max-width: 768px) {

    #alojagueb-engine-root,
    #alojagueb-engine-root * {
        box-sizing: border-box;
        /* 🛡️ Global Safety */
    }

    #alojagueb-engine-root {
        padding: 0;
        width: 100%;
        overflow-x: hidden;
        padding-bottom: 50px;
    }

    /* 📅 Calendar Container */
    .age-col-main {
        padding: 0 15px !important;
        /* Fixed Padding */
        box-shadow: none;
        border: none;
        background: transparent;
        width: 100% !important;
        margin: 0 !important;
    }

    /* 📝 Summary Box */
    .age-sticky-summary {
        position: static;
        margin: -10px 15px 30px 15px !important;
        /* Pull up (-10px) to close gap, match side margins (15px) */
        width: auto !important;
        border: 1px solid #eee;
        border-radius: 12px;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    }

    /* ❌ Hide "Resumen" Title */
    .age-sticky-summary h3,
    .age-summary-title {
        display: none !important;
    }
}

/* 📱 Mobile Specific Fix */
@media (max-width: 480px) {
    .age-modal {
        padding: 20px;
        width: 95%;
        max-height: 90vh;
    }
}

.age-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    border: none;
    background: transparent;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    z-index: 10;
}

.age-form-group {
    margin-bottom: 15px;
}

.age-form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.age-form-input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
}

.age-engine-title {
    text-align: center;
    font-size: 24px;
    margin-bottom: 20px;
    color: #333;
    font-weight: 700;
}


/* === CHAT WIDGET (Premium Solid) === */
.age-chat-widget {
    position: fixed;
    bottom: 25px;
    right: 25px;
    z-index: 99999;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: #333;
}

/* TRIGGER BUTTON */
.age-chat-trigger {
    width: 60px;
    height: 60px;
    border-radius: 30px;
    background: var(--age-primary);
    color: white;
    border: none;
    font-size: 26px;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.age-chat-trigger img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.age-chat-trigger:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
}

/* WINDOW */
.age-chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    height: 600px;
    max-height: 80vh;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.05);
    animation: agePopIn 0.25s cubic-bezier(0.18, 0.89, 0.32, 1.28);
    transform-origin: bottom right;
}

@keyframes agePopIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(10px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* HEADER */
.age-chat-header {
    padding: 18px 20px;
    background: #fff;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.age-chat-avatar {
    font-size: 24px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.age-chat-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.age-chat-title {
    flex: 1;
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.age-chat-title strong {
    font-size: 15px;
    font-weight: 600;
    color: #111;
}

.age-chat-title span {
    font-size: 11px;
    color: #22c55e;
    /* Online Green */
    font-weight: 500;
}

.age-chat-close {
    background: transparent;
    border: none;
    color: #999;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    transition: color 0.2s;
}

.age-chat-close:hover {
    color: #333;
}

/* MESSAGES */
.age-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: #ffffff;
}

.age-chat-msg {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.age-chat-msg.user {
    align-self: flex-end;
    background: var(--age-primary);
    color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-bottom-right-radius: 2px;
}

.age-chat-msg.ai {
    align-self: flex-start;
    background: #f3f4f6;
    color: #1f2937;
    border-bottom-left-radius: 2px;
}

/* TYPING INDICATOR */
.age-chat-msg.typing {
    background: transparent;
    padding: 0;
    color: #999;
    font-size: 12px;
    font-style: italic;
}

/* INPUT AREA */
.age-chat-input-area {
    padding: 15px 20px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    gap: 10px;
    background: #fff;
    align-items: center;
}

.age-chat-input-area input {
    flex: 1;
    border: 1px solid #e5e7eb;
    border-radius: 24px;
    padding: 12px 16px;
    outline: none;
    font-size: 14px;
    transition: border-color 0.2s;
    background: #f9fafb;
}

.age-chat-input-area input:focus {
    border-color: var(--age-primary);
    background: #fff;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.age-chat-send {
    background: var(--age-primary);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
    flex-shrink: 0;
}

.age-chat-send:hover {
    background: var(--age-secondary);
}

.age-chat-send:active {
    transform: scale(0.95);
}

/* MOBILE */
@media (max-width: 480px) {
    .age-chat-window {
        bottom: 0 !important;
        right: 0 !important;
        width: 100% !important;
        height: 100% !important;
        max-height: none;
        border-radius: 0;
        z-index: 100000;
    }
}


/* === SHOP EVOLUTION (v5.0) === */
.age-shop-tabs {
    -ms-overflow-style: none;
    /* IE and Edge */
    scrollbar-width: none;
    /* Firefox */
}

.age-shop-tabs::-webkit-scrollbar {
    display: none;
}

.age-extra-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
    border-color: var(--age-primary) !important;
}

.age-extra-btn:active {
    transform: scale(0.9);
}

/* Animations */
.age-extra-card {
    animation: ageFadeInUp 0.3s ease-out forwards;
}

@keyframes ageFadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}