/* ============================================================================
   PROMO FRANJA DÍA DE LA MADRE — Franca Pastelería
   Componente aislado de campaña.
   Para desinstalar: eliminar este archivo, js/promo-madre.js y sus referencias
   en index.html.
   ============================================================================ */

.promo-franja-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 999;
    background: rgba(88, 10, 26, 0.94);
    -webkit-backdrop-filter: blur(14px) saturate(160%);
    backdrop-filter: blur(14px) saturate(160%);
    border-top: 1px solid rgba(227, 184, 102, 0.5);
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.45);
    color: var(--crema-manteca, #FDF6E3);
    animation: promoFranjaSlideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    will-change: transform, opacity;
}

/* Eleva sutilmente el botón flotante de WhatsApp para no superponerse con la franja fija */
body:has(.promo-franja-bar) .whatsapp-float,
body.has-promo-franja .whatsapp-float {
    bottom: calc(28px + 46px);
    transition: bottom 0.3s ease;
}

@media (max-width: 768px) {
    body:has(.promo-franja-bar) .whatsapp-float,
    body.has-promo-franja .whatsapp-float {
        bottom: calc(16px + 54px);
    }
}

@keyframes promoFranjaSlideUp {
    from {
        opacity: 0;
        transform: translateY(100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.promo-franja-bar.is-closing {
    opacity: 0;
    transform: translateY(100%);
    transition: opacity 0.28s ease, transform 0.28s ease;
}

.promo-franja-inner {
    max-width: 1340px;
    margin: 0 auto;
    padding: 9px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

/* ===== SECCIÓN IZQUIERDA (THUMB, TAG, MENSAJE) ===== */
.promo-franja-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
}

.promo-franja-thumb {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    overflow: hidden;
    border: 1px solid #E3B866;
    flex-shrink: 0;
    background: #580A1A;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.promo-franja-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.promo-franja-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(242, 182, 193, 0.16);
    border: 1px solid rgba(242, 182, 193, 0.35);
    color: #F2B6C1;
    font-family: 'Outfit', sans-serif;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    padding: 3px 10px;
    border-radius: 50px;
    white-space: nowrap;
    flex-shrink: 0;
}

.promo-franja-heart {
    color: #F2B6C1;
    font-size: 0.78rem;
    line-height: 1;
}

.promo-franja-msg {
    font-family: 'Outfit', sans-serif;
    font-size: 0.84rem;
    color: var(--crema-manteca, #FDF6E3);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
}

.promo-franja-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.12rem;
    font-weight: 600;
    font-style: italic;
    color: #FFFFFF;
    letter-spacing: 0.2px;
}

.promo-franja-tagline {
    color: var(--mousse-dulce, #E8D1B3);
    font-weight: 400;
}

.promo-franja-price {
    color: #E3B866;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.promo-franja-dot {
    color: rgba(227, 184, 102, 0.65);
    font-size: 0.85rem;
    user-select: none;
}

.promo-franja-items {
    color: rgba(232, 209, 179, 0.82);
    font-size: 0.78rem;
    font-weight: 400;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===== SECCIÓN DERECHA (CONTADOR, CTA, CERRAR) ===== */
.promo-franja-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.promo-franja-counter {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(227, 184, 102, 0.12);
    border: 1px solid rgba(227, 184, 102, 0.32);
    color: #E3B866;
    font-family: 'Outfit', sans-serif;
    font-size: 0.73rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    padding: 3px 10px;
    border-radius: 50px;
    white-space: nowrap;
}

.promo-franja-counter svg {
    width: 12px;
    height: 12px;
    fill: none;
    stroke: #E3B866;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.promo-franja-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #E3B866;
    color: #3E241F;
    font-family: 'Outfit', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    padding: 6px 16px;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
    white-space: nowrap;
}

.promo-franja-cta svg {
    width: 13px;
    height: 13px;
    fill: none;
    stroke: #3E241F;
    stroke-width: 2.3;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform 0.25s ease;
}

.promo-franja-cta:hover {
    background: #F0CA7D;
    color: #3E241F;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(227, 184, 102, 0.4);
}

.promo-franja-cta:hover svg {
    transform: translateX(2px);
}

.promo-franja-close {
    width: 28px;
    height: 28px;
    background: transparent;
    border: none;
    color: var(--mousse-dulce, #E8D1B3);
    font-size: 1.35rem;
    line-height: 1;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: color 0.2s, background-color 0.2s, transform 0.2s;
    padding: 0;
}

.promo-franja-close:hover {
    color: #FFFFFF;
    background: rgba(255, 255, 255, 0.12);
    transform: scale(1.1);
}

.promo-franja-cta:focus-visible,
.promo-franja-close:focus-visible {
    outline: 2px solid #E3B866;
    outline-offset: 2px;
}

/* ===== AJUSTES RESPONSIVE ===== */
/* Pantallas intermedias / notebooks chicas: ocultamos detalle largo de ítems */
@media (max-width: 1200px) {
    .promo-franja-items {
        display: none;
    }
}

/* Tablets compactas */
@media (max-width: 900px) {
    .promo-franja-tagline {
        display: none;
    }
}

/* Móviles (hasta 768px, incluidos 360px y 390px): 2 líneas muy bajas */
@media (max-width: 768px) {
    .promo-franja-bar {
        box-shadow: 0 -3px 14px rgba(0, 0, 0, 0.35);
    }

    .promo-franja-inner {
        padding: 6px 12px;
        display: grid;
        grid-template-columns: 1fr auto;
        row-gap: 4px;
        column-gap: 8px;
        align-items: center;
    }

    /* Línea 1: Thumb + Tag + Nombre + Precio (a la izquierda), Botón cerrar (a la derecha) */
    .promo-franja-left {
        grid-column: 1;
        grid-row: 1;
        gap: 6px;
        overflow: hidden;
    }

    .promo-franja-thumb {
        width: 22px;
        height: 22px;
    }

    .promo-franja-tag {
        font-size: 0.66rem;
        padding: 2px 7px;
        letter-spacing: 0.4px;
    }

    .promo-franja-msg {
        font-size: 0.77rem;
        gap: 4px;
    }

    .promo-franja-title {
        font-size: 0.98rem;
    }

    .promo-franja-tagline,
    .promo-franja-items {
        display: none;
    }

    .promo-franja-close {
        grid-column: 2;
        grid-row: 1;
        justify-self: end;
        width: 22px;
        height: 22px;
        font-size: 1.15rem;
    }

    /* Línea 2: Contador y lema corto (izquierda), Botón Ver Box (derecha) */
    .promo-franja-right {
        grid-column: 1 / -1;
        grid-row: 2;
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 8px;
        width: 100%;
    }

    .promo-franja-counter {
        font-size: 0.68rem;
        padding: 2px 8px;
    }

    .promo-franja-cta {
        padding: 4px 12px;
        font-size: 0.74rem;
        gap: 4px;
    }

    .promo-franja-cta svg {
        width: 11px;
        height: 11px;
    }
}

/* Teléfonos muy pequeños (360px): ultra optimizado */
@media (max-width: 380px) {
    .promo-franja-inner {
        padding: 5px 8px;
    }

    .promo-franja-tag {
        padding: 1px 6px;
        font-size: 0.62rem;
    }

    .promo-franja-title {
        font-size: 0.9rem;
    }

    .promo-franja-price {
        font-size: 0.76rem;
    }
}

/* Prefers reduced motion */
@media (prefers-reduced-motion: reduce) {
    .promo-franja-bar {
        animation: none !important;
        transition: none !important;
    }

    .promo-franja-bar.is-closing {
        transition: none !important;
        display: none !important;
    }

    .promo-franja-cta,
    .promo-franja-cta svg,
    .promo-franja-close {
        transition: none !important;
    }
}
