/* ===========================================================
   COTIZADOR A DOMICILIO
   =========================================================== */

.cotizador-page {
    background: var(--cream);
    min-height: 100vh;
}

.cotizador-page .navbar { background: rgba(255,255,255,0.95); }

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: var(--black);
    color: var(--white);
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s var(--ease);
}

.btn-back:hover {
    background: var(--orange);
    transform: translateY(-2px);
    box-shadow: var(--shadow-orange);
}

.cotizador-main {
    padding: calc(var(--header-h) + 60px) 0 80px;
    position: relative;
    z-index: 2;
}

.cotizador-head {
    text-align: center;
    margin-bottom: 48px;
}

.cotizador-title {
    font-family: var(--font-display);
    font-size: clamp(2.4rem, 5vw, 4rem);
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: -1px;
    margin-bottom: 14px;
    text-wrap: balance;
}

.cotizador-title em {
    font-style: normal;
    color: var(--orange);
}

.cotizador-subtitle {
    color: var(--gray);
    font-size: 1.05rem;
    max-width: 540px;
    margin: 0 auto;
    text-wrap: balance;
}

.cotizador-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 32px;
    align-items: stretch;
}

/* === MAP === */
.cotizador-map-wrap {
    position: relative;
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    background: var(--white);
    min-height: 520px;
    display: flex;
    flex-direction: column;
}

.cotizador-map {
    flex: 1;
    width: 100%;
    height: 100%;
    min-height: 520px;
    z-index: 1;
}

.cotizador-map .leaflet-container {
    font-family: var(--font-body);
    background: #ECE7DF;
}

.map-hint {
    position: absolute;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--white);
    padding: 10px 18px;
    border-radius: 999px;
    box-shadow: var(--shadow);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--black);
    z-index: 500;
    pointer-events: none;
    border: 2px solid var(--orange);
    transition: opacity 0.4s ease;
}

.map-hint.hide { opacity: 0; }

.map-hint svg { color: var(--orange); }

.map-legend {
    position: absolute;
    bottom: 16px;
    right: 16px;
    background: var(--white);
    padding: 14px 16px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    z-index: 500;
    max-width: 200px;
}

.map-legend h4 {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--orange);
    font-weight: 700;
    margin-bottom: 10px;
}

.map-legend ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.map-legend li {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--black);
    font-weight: 500;
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* === RESTAURANT MARKER === */
.restaurant-marker {
    width: 44px;
    height: 44px;
    background: var(--orange);
    border: 3px solid var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 16px rgba(255,107,26,0.5);
    color: var(--white);
    font-size: 1.2rem;
    transform: translate(-22px, -22px);
    position: relative;
    animation: restaurantPulse 2.5s ease-in-out infinite;
}

.restaurant-marker img {
    width: 80%;
    height: 80%;
    object-fit: contain;
}

@keyframes restaurantPulse {
    0%, 100% { box-shadow: 0 6px 16px rgba(255,107,26,0.5), 0 0 0 0 rgba(255,107,26,0.45); }
    50% { box-shadow: 0 6px 16px rgba(255,107,26,0.5), 0 0 0 20px rgba(255,107,26,0); }
}

.customer-marker {
    width: 36px;
    height: 36px;
    background: var(--black);
    border: 3px solid var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 14px rgba(0,0,0,0.4);
    color: var(--white);
    font-size: 1rem;
    transform: translate(-18px, -18px);
}

/* === SIDE PANEL === */
.cotizador-side {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.side-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 22px 24px;
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--orange);
}

.card-eyebrow {
    color: var(--orange);
    font-weight: 700;
    font-size: 0.78rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.side-card h3 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.card-address {
    font-size: 0.88rem;
    color: var(--gray);
    line-height: 1.5;
}

.side-actions {
    text-align: center;
}

.side-actions .hint {
    margin-top: 10px;
    font-size: 0.82rem;
    color: var(--gray);
}

.cotizador-btn {
    width: 100%;
    padding: 16px 24px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), background 0.3s ease;
    font-family: inherit;
}

.cotizador-btn-primary {
    background: var(--orange);
    color: var(--white);
    box-shadow: var(--shadow-orange);
}

.cotizador-btn-primary:hover {
    background: var(--black);
    transform: translateY(-2px);
}

.cotizador-btn-whatsapp {
    background: var(--green-wa);
    color: var(--white);
    box-shadow: 0 8px 20px rgba(37,211,102,0.3);
}

.cotizador-btn-whatsapp:hover {
    background: #1ea952;
    transform: translateY(-2px);
}

/* === RESULT === */
.cotizador-result {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    transition: all 0.4s var(--ease);
}

.cotizador-result[data-state="empty"] .result-data,
.cotizador-result[data-state="empty"] .result-confirmed { display: none; }
.cotizador-result[data-state="filled"] .result-empty,
.cotizador-result[data-state="filled"] .result-confirmed { display: none; }
.cotizador-result[data-state="confirmed"] .result-empty,
.cotizador-result[data-state="confirmed"] .result-data { display: none; }
.cotizador-result[data-state="filled"] {
    background: linear-gradient(135deg, var(--white) 0%, #FFF8F2 100%);
    border: 2px solid rgba(255,107,26,0.2);
}
.cotizador-result[data-state="confirmed"] {
    background: linear-gradient(135deg, #ECFDF5 0%, #FFFFFF 100%);
    border: 2px solid rgba(37,211,102,0.4);
}

.result-empty {
    text-align: center;
    padding: 16px 8px;
}

.result-empty-icon {
    color: rgba(0,0,0,0.15);
    margin-bottom: 12px;
    display: flex;
    justify-content: center;
}

.result-empty p {
    color: var(--gray);
    font-size: 0.95rem;
}

.result-data {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 12px;
    border-bottom: 1px dashed rgba(0,0,0,0.08);
}

.result-row:last-of-type { border-bottom: none; padding-bottom: 0; }

.result-label {
    color: var(--gray);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 600;
}

.result-value {
    font-family: var(--font-display);
    font-size: 1.6rem;
    color: var(--black);
}

.result-row-price .result-value {
    font-size: 2.6rem;
    color: var(--orange);
    line-height: 1;
}

.result-zone {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: var(--orange-soft);
    color: var(--orange);
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 700;
    align-self: flex-start;
}

.zone-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--orange);
}

.result-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--black);
    font-weight: 600;
    font-size: 0.9rem;
    padding: 10px 14px;
    background: var(--cream);
    border-radius: 10px;
    transition: all 0.3s var(--ease);
    text-align: center;
    justify-content: center;
}

.result-link:hover {
    background: var(--black);
    color: var(--white);
}

.result-link svg { color: var(--orange); transition: color 0.3s ease; }
.result-link:hover svg { color: var(--white); }

.result-address-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 14px 16px;
    border-left: 4px solid var(--orange);
    margin-top: 4px;
}

.result-address-eyebrow {
    color: var(--orange);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.result-address-text {
    color: var(--black);
    font-size: 0.92rem;
    line-height: 1.45;
    font-weight: 500;
    word-wrap: break-word;
}

.cotizador-btn-confirm {
    background: var(--green-wa);
    color: var(--white);
    box-shadow: 0 8px 20px rgba(37,211,102,0.3);
}

.cotizador-btn-confirm:hover {
    background: #1ea952;
    transform: translateY(-2px);
}

/* === Confirmed state === */
.result-confirmed {
    text-align: center;
    padding: 8px 4px;
}

.confirmed-icon {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: var(--green-wa);
    color: var(--white);
    font-size: 2.4rem;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
    box-shadow: 0 10px 30px rgba(37,211,102,0.4);
    animation: confirmPop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes confirmPop {
    from { transform: scale(0) rotate(-180deg); opacity: 0; }
    to { transform: scale(1) rotate(0); opacity: 1; }
}

.result-confirmed h3 {
    font-family: var(--font-display);
    font-size: 1.8rem;
    text-transform: uppercase;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.result-confirmed p {
    color: var(--gray);
    font-size: 0.92rem;
    line-height: 1.5;
    margin-bottom: 18px;
    text-wrap: balance;
}

/* === INFO === */
.cotizador-info {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 22px 24px;
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--black);
}

.cotizador-info p { font-size: 0.95rem; margin-bottom: 8px; }
.cotizador-info ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cotizador-info li {
    font-size: 0.85rem;
    color: var(--gray);
    line-height: 1.5;
    padding-left: 18px;
    position: relative;
}

.cotizador-info li::before {
    content: '🍣';
    position: absolute;
    left: 0;
    top: 0;
    font-size: 0.8rem;
}

.cotizador-info strong { color: var(--orange); }

/* === Cart preview === */
.preview-card { border-left-color: var(--green-wa); }
.preview-list {
    list-style: none;
    padding: 0;
    margin: 8px 0 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.preview-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    font-size: 0.88rem;
    color: var(--black);
    padding: 4px 0;
    border-bottom: 1px dashed rgba(0,0,0,0.06);
}
.preview-list li:last-child { border-bottom: none; }
.preview-price { font-weight: 700; color: var(--orange); flex-shrink: 0; }
.preview-subtotal {
    display: flex;
    justify-content: space-between;
    padding-top: 10px;
    border-top: 1.5px solid rgba(0,0,0,0.08);
    font-family: var(--font-display);
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.preview-subtotal span:last-child { color: var(--orange); }

/* === FOOTER === */
.cotizador-footer { padding: 30px 0; }
.cotizador-footer .footer-bottom { padding-top: 0; border-top: none; }

.footer-back {
    color: var(--orange);
    font-weight: 600;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.footer-back:hover { color: var(--white); }

/* === LEAFLET CUSTOM === */
.leaflet-control-zoom a {
    background: var(--white) !important;
    color: var(--black) !important;
    border: none !important;
    border-radius: 8px !important;
    margin-bottom: 4px !important;
    transition: all 0.2s ease !important;
    box-shadow: var(--shadow-sm) !important;
}

.leaflet-control-zoom a:hover {
    background: var(--orange) !important;
    color: var(--white) !important;
}

.leaflet-control-attribution {
    font-size: 0.65rem !important;
    background: rgba(255,255,255,0.7) !important;
    padding: 2px 8px !important;
    border-radius: 8px 0 0 0 !important;
}

.leaflet-popup-content-wrapper {
    border-radius: 12px !important;
    box-shadow: var(--shadow-lg) !important;
}

.leaflet-popup-content {
    font-family: var(--font-body) !important;
    font-size: 0.9rem !important;
    line-height: 1.5 !important;
    margin: 12px 14px !important;
}

.leaflet-popup-content strong {
    font-family: var(--font-display);
    font-size: 1.1rem;
    color: var(--black);
    text-transform: uppercase;
    display: block;
    margin-bottom: 4px;
    letter-spacing: 0.5px;
}

/* === RESPONSIVE === */
@media (max-width: 1024px) {
    .cotizador-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    .cotizador-map, .cotizador-map-wrap { min-height: 460px; }
}

@media (max-width: 720px) {
    .cotizador-main { padding-top: calc(var(--header-h) + 30px); }
    .nav-links { display: none; }
    .nav-actions .btn-back span { display: none; }
    .btn-back { padding: 12px; width: 44px; height: 44px; justify-content: center; }
    .cotizador-map, .cotizador-map-wrap { min-height: 380px; }
    .map-legend {
        bottom: 12px;
        right: 12px;
        padding: 10px 12px;
        max-width: 160px;
    }
    .map-legend h4 { font-size: 0.65rem; margin-bottom: 6px; }
    .map-legend li { font-size: 0.72rem; }
    .map-hint { padding: 8px 14px; font-size: 0.75rem; }
    .map-hint svg { width: 16px; height: 16px; }
    .result-row-price .result-value { font-size: 2.2rem; }
    .cotizador-grid { gap: 20px; }
    .side-card, .cotizador-info { padding: 18px 20px; }
}

@media (max-width: 480px) {
    .map-legend { display: none; }
}
