/* =========================================
   UX Hand-Holding Enhancements
   ========================================= */

/* 1. Visual Progress Checks */
.step.completed .dot {
    background: var(--success) !important;
    color: #fff !important;
    border-color: var(--success) !important;
    font-size: 0;
    /* Hide number */
}

.step.completed .dot::after {
    content: '✔';
    font-size: 14px;
    line-height: 24px;
    display: block;
}

.step.completed .label {
    color: var(--success) !important;
    font-weight: 700;
}

/* 2. Fly-to-Cart Animation */
.fly-item {
    position: fixed;
    z-index: 12000;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    pointer-events: none;
    transition: all 0.8s cubic-bezier(0.19, 1, 0.22, 1);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

/* 3. Smart Sticky Footer Types */
/* Default (Items present) is already styled */
#stickyCart {
    transition: background-color 0.3s ease, transform 0.3s ease;
}

/* Mode: Select Branch (Step 1) */
#stickyCart.mode-branch {
    background: var(--cr-blue) !important;
    /* Distinct from checkout green */
}

#stickyCart.mode-branch .sc-info span {
    color: #fff;
}

/* Mode: Add Items (Step 2 - Empty) */
#stickyCart.mode-add {
    background: var(--bg-card);
    border-top: 2px solid var(--cr-gold);
    color: var(--text-main);
}

#stickyCart.mode-add .sc-info {
    color: var(--text-main);
}

#stickyCart.mode-add .sc-btn {
    background: var(--cr-gold);
    color: var(--text-main);
}

/* Pulse animation for the button in footer */
@keyframes pulse-btn {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

#stickyCart .sc-btn.pulse {
    animation: pulse-btn 1s infinite;
}

/* 4. Payment Method Interactivity */
#paymentMethod.fsel {
    cursor: pointer;
}

.fsel-wrap:has(#paymentMethod) {
    border: 2px solid var(--cr-gold);
    border-radius: 12px;
    transition: all 0.3s ease;
    background: #fff8e1;
    /* Subtle gold tint */
    position: relative;
    overflow: hidden;
}

.fsel-wrap:has(#paymentMethod):hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.4);
    border-color: var(--cr-orange);
}

.fsel-wrap:has(#paymentMethod)::after {
    content: '👆';
    position: absolute;
    right: 40px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
    pointer-events: none;
    animation: finger-tap 1.5s infinite;
}

/* Hide finger once selected */
.fsel-wrap.filled:has(#paymentMethod)::after {
    display: none;
}

@keyframes finger-tap {

    0%,
    100% {
        transform: translateY(-50%) translateX(0);
    }

    50% {
        transform: translateY(-50%) translateX(5px);
    }
}

/* Menu Subsections */
.menu-section-header {
    grid-column: 1 / -1;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--cr-red);
    margin-top: 2rem;
    margin-bottom: 0.5rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Sub Category Nav (Filter Chips) */
.cat-sub-nav {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 10px 15px;
    /* Increased from 5px to 15px */
    margin-bottom: 10px;
    margin-bottom: 10px;
    position: sticky;
    top: 130px;
    /* Adjusted to stack below main tabs on Desktop */
    z-index: 89;
    /* Just below tabs (90) */
    background: var(--bg-page, #fff);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

@media (min-width: 1024px) {
    .cat-sub-nav {
        position: static;
        top: auto;
        overflow-x: visible;
        flex-wrap: wrap;
        padding-left: 0;
        padding-right: 0;
    }
}

.cat-sub-nav::-webkit-scrollbar {
    display: none;
}

.cat-sub-nav button {
    background: #F8F9FA;
    /* Flat light gray */
    border: none;
    /* Minimalist */
    color: var(--ink);
    padding: 7px 14px;
    /* Compact */
    border-radius: 50px;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: none;
    /* Removed default shadow */
}

.cat-sub-nav button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

.cat-sub-nav button:active {
    transform: scale(0.95);
}

/* 5. Tracker Overlay (Real-Time) - KFC/Pizza Hut 2026 Hybrid Premium */
.tracker-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    /* Darker for focus */
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    z-index: 13000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}

.tracker-overlay.hidden {
    opacity: 0;
    pointer-events: none;
    display: none;
}

.tracker-card {
    background: #fff;
    width: 90%;
    max-width: 400px;
    padding: 0;
    border-radius: 32px;
    text-align: center;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.4);
    position: relative;
    overflow: hidden;
    font-family: 'Outfit', sans-serif;
    transform: scale(1);
    animation: pop-in 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Red Roof Accent - Bold */
.tracker-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 12px;
    background: linear-gradient(90deg, #E4002B, #B00020);
    z-index: 5;
    box-shadow: 0 5px 15px rgba(228, 0, 43, 0.3);
}

@keyframes pop-in {
    from {
        transform: scale(0.9) translateY(40px);
        opacity: 0;
    }

    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.tc-header {
    padding: 40px 30px 10px;
}

.tc-header h2 {
    margin: 0;
    font-size: 2.2rem;
    color: #202124;
    font-weight: 900;
    letter-spacing: -0.04em;
    line-height: 1;
    text-transform: uppercase;
}

.tc-time {
    font-size: 0.85rem;
    color: #5F6368;
    margin-top: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: #F1F3F4;
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
}

.tc-status-visual {
    margin: 30px 0;
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    /* Rich Background Glow */
    background: radial-gradient(circle at center, rgba(228, 0, 43, 0.05) 0%, rgba(255, 255, 255, 0) 70%);
}

/* Pulsing Rings */
.tc-status-visual::before {
    content: '';
    position: absolute;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    border: 2px dashed rgba(228, 0, 43, 0.15);
    animation: spin-slow 10s linear infinite;
}

.tc-status-visual::after {
    content: '';
    position: absolute;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    border: 2px solid rgba(228, 0, 43, 0.1);
    animation: ripple 2s infinite linear;
}

@keyframes spin-slow {
    to {
        transform: rotate(360deg);
    }
}

@keyframes ripple {
    0% {
        transform: scale(0.8);
        opacity: 1;
    }

    100% {
        transform: scale(1.6);
        opacity: 0;
    }
}

.tc-icon {
    font-size: 6rem;
    filter: drop-shadow(0 15px 30px rgba(228, 0, 43, 0.25));
    animation: float 3s ease-in-out infinite;
    z-index: 10;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-12px);
    }
}

.tc-message {
    font-size: 1.1rem;
    font-weight: 600;
    color: #202124;
    margin-bottom: 40px;
    padding: 0 40px;
    line-height: 1.4;
    opacity: 0.9;
}

/* Steps: Solid Progress Bar Style */
.tc-steps {
    display: flex;
    justify-content: space-between;
    margin: 0 30px 40px;
    position: relative;
    background: #F1F3F4;
    height: 6px;
    border-radius: 10px;
    align-items: center;
}

/* Progress Fill (Dynamic width set via JS ideally, but here simulated via active step pos) */
/* We will style the steps as nodes on the line */

.tc-steps .step {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0;
    /* Hide default text, show label below */
    flex: 1;
}

/* The Dot */
.tc-steps .step .dot {
    width: 16px;
    height: 16px;
    background: #D1D5DB;
    /* Gray */
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    margin-top: -5px;
    /* Center on line */
}

/* Active Dot */
.tc-steps .step.active .dot {
    background: var(--cr-red);
    transform: scale(1.4);
    box-shadow: 0 4px 10px rgba(228, 0, 43, 0.4);
}

/* Labels below line */
.tc-steps .step::after {
    content: attr(data-label);
    /* Requires JS update or fixed text */
    /* Content is hardcoded in HTML, so we use :nth-child tricks or just rely on the text node visible */
    font-size: 0.75rem;
    color: #9CA3AF;
    font-weight: 700;
    text-transform: uppercase;
    margin-top: 12px;
    transition: color 0.3s;
    white-space: nowrap;
}

/* Hardcoded labels via CSS since HTML has text nodes */
.tc-steps .step {
    font-size: 0;
}

/* Hide text nodes */
.tc-steps #ts1::after {
    content: 'Recibido';
}

.tc-steps #ts2::after {
    content: 'Cocina';
}

.tc-steps #ts3::after {
    content: 'En Camino';
}

.tc-steps .step.active::after {
    color: var(--cr-red);
}

/* Checkmark for finished (previous) steps */
.tc-steps .step.active~.step .dot {
    /* Future steps */
}

/* Previous steps need 'completed' class logic in JS, but here we assume 'active' is current.
   We can style standard 'completed' if main.js adds it.
*/

.tc-actions {
    padding: 0 30px 40px;
}

.tc-actions .btn {
    border-radius: 999px;
    font-size: 1.1rem;
    padding: 20px;
    background: linear-gradient(135deg, #E4002B 0%, #B00020 100%);
    color: #fff;
    font-weight: 900;
    width: 100%;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 10px 30px rgba(228, 0, 43, 0.4);
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.tc-actions .btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 20px 40px rgba(228, 0, 43, 0.5);
}

.tc-actions .btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% {
        left: -100%;
    }

    20% {
        left: 100%;
    }

    100% {
        left: 100%;
    }
}

/* Status Specific Animations (Toggled by JS changing icon) */
/* We rely on the emojis being swapped, but we can add specific classes if we want */
.input-icon-wrap {
    position: relative;
    width: 100%;
}

.addr-badge {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: #10B981;
    /* Green */
    color: white;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
    pointer-events: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 5;
}

.addr-badge.hidden {
    display: none;
}

@keyframes popIn {
    from {
        transform: scale(0);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

#btnAddrGeo {
    color: var(--cr-red, #D71920);
    font-weight: 600;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    font-family: inherit;
}

#btnAddrGeo:hover {
    text-decoration: underline;
}

/* =========================================
   KFC 2026 Location Overlay (Premium Polish)
   ========================================= */
.loc-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    z-index: 20000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

.loc-overlay.hidden {
    opacity: 0;
    pointer-events: none;
    display: none;
}

.loc-panel {
    background: #fff;
    /* Solid White for Premium Feel */
    width: 90%;
    max-width: 400px;
    padding: 40px 30px;
    border-radius: 24px;
    /* Match Cards */
    text-align: center;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    position: relative;
    overflow: hidden;
    transform: scale(1);
    animation: locPopIn 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Red Roof Accent */
.loc-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 8px;
    background: var(--cr-red, #E4002B);
    z-index: 5;
}

@keyframes locPopIn {
    from {
        transform: scale(0.9) translateY(40px);
        opacity: 0;
    }

    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.loc-brand-anim {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(228, 0, 43, 0.3);
    /* Red Glow */
    border: 4px solid #fff;
    animation: floatLogo 3s ease-in-out infinite;
}

.loc-brand-anim img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@keyframes floatLogo {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-6px);
    }
}

.loc-panel h3 {
    font-size: 1.8rem;
    font-weight: 900;
    color: #000;
    margin-bottom: 12px;
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.loc-panel p {
    font-size: 1rem;
    color: #666;
    margin-bottom: 32px;
    line-height: 1.5;
    font-weight: 500;
}

.loc-actions button {
    width: 100%;
    border-radius: 999px;
    /* Pill shape */
    font-size: 1.1rem;
    padding: 16px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: 0 4px 15px rgba(228, 0, 43, 0.3);
    transition: all 0.3s ease;
    background: var(--cr-red, #E4002B);
    color: white;
    border: none;
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
}

.loc-actions button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(228, 0, 43, 0.4);
    background: #B00020;
    /* Darker red on hover */
}

.loc-actions button::after {
    content: '';
    /* Remove old arrow */
}



/* =========================================
   Menu Grid Layout (Responsive & Commercial)
   ========================================= */
.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
    gap: 16px;
    padding: 10px 0 40px;
}

@media(min-width: 768px) {
    .menu-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 24px;
    }
}

/* =========================================
   KFC 2026 Product Cards (Super Commercial)
   ========================================= */
.r-card {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.04);
    border-radius: 20px;
    /* Soft but consistent */
    padding: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 12px;
    height: 100%;
    overflow: visible;
}

.r-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.1), 0 0 0 2px rgba(228, 0, 43, 0.05);
}

/* Image Container */
.r-media {
    aspect-ratio: 4/3;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    background: #f4f4f4;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.03);
    margin-bottom: 0 !important;
}

.r-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.r-card:hover .r-media img {
    transform: scale(1.08);
}

/* FOOLPROOF ADD BUTTON (Text "Agregar") */
/* FOOLPROOF ADD BUTTON (Text "Agregar") */
.fab-add {
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: auto !important;
    min-width: 90px;
    /* Force decent width */
    height: 36px;
    padding: 0 16px !important;
    border-radius: 99px;
    /* Red Gradient Background */
    background: linear-gradient(135deg, #E4002B 0%, #B00020 100%) !important;
    color: #fff !important;
    font-size: 0.85rem !important;
    font-weight: 800 !important;
    font-family: 'Outfit', sans-serif;
    border: none;
    /* Red Glow Shadow */
    box-shadow: 0 4px 15px rgba(228, 0, 43, 0.35);
    cursor: pointer;
    z-index: 5;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Ensure text is visible via pseudo if empty */
.fab-add:empty::after {
    content: 'AGREGAR';
    display: block;
}

/* Remove old pseudo styling that might conflict */
.fab-add::after {
    font-size: inherit;
    font-weight: inherit;
    color: inherit;
}

.r-card:hover .fab-add {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(228, 0, 43, 0.5);
}

.r-card:hover .fab-add::after {
    transform: none;
    /* No rotation for text */
}

.fab-add:active {
    transform: scale(0.95) !important;
}

/* Content */
.r-info {
    padding: 4px 4px 8px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.r-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: #202124;
    margin-bottom: 4px;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.r-desc {
    font-size: 0.85rem;
    color: #5F6368;
    line-height: 1.4;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    opacity: 0.8;
}

/* Price Tag */
.r-price {
    margin-top: auto;
    font-size: 1.3rem;
    font-weight: 900;
    color: var(--cr-red, #E4002B) !important;
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.r-price strong {
    font-weight: 900;
}

/* Ensure no double $ logic interferes */
.r-price::before,
.r-price::after {
    content: none !important;
    display: none !important;
}