/**
 * Deal-13: Wrap & Roll — Buy 4 Get 1 Free
 * /assets/css/deal-wraps.css
 *
 * BLACK & WHITE theme to match the BurgerBuz site
 * Site palette: #000, #fff, red accent #cc0000
 * Font: 'Poppins', sans-serif
 */

/* ── Variables ── */
:root {
    --wdm-bg:         #ffffff;
    --wdm-bg-card:    #f8f8f8;
    --wdm-text:       #000000;
    --wdm-text-muted: #666666;
    --wdm-border:     #e0e0e0;
    --wdm-accent:     #000000;
    --wdm-red:        #cc0000;
    --wdm-radius:     16px;
    --wdm-shadow:     0 24px 60px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.06);
    --wdm-transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── OVERLAY ── */
.wdm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    transition: opacity var(--wdm-transition);
}

.wdm-overlay.wdm-visible {
    opacity: 1;
}

/* ── MODAL BOX ── */
.wdm-modal {
    position: relative;
    background: var(--wdm-bg);
    border: 1px solid var(--wdm-border);
    border-radius: var(--wdm-radius);
    box-shadow: var(--wdm-shadow);
    width: 100%;
    max-width: 640px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-family: 'Poppins', sans-serif;

    /* Entry animation — slide up */
    transform: translateY(28px) scale(0.96);
    opacity: 0;
    transition:
        transform var(--wdm-transition),
        opacity var(--wdm-transition);
}

.wdm-modal.wdm-modal-in {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.wdm-modal.wdm-modal-out {
    transform: translateY(20px) scale(0.97);
    opacity: 0;
}

/* Black top accent line */
.wdm-modal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: #000;
}

/* ── CLOSE BUTTON ── */
.wdm-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 32px;
    height: 32px;
    border: 1px solid var(--wdm-border);
    border-radius: 50%;
    background: #fff;
    color: #999;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
    z-index: 2;
    padding: 0;
}

.wdm-close:hover {
    background: #000;
    color: #fff;
    border-color: #000;
}

/* ── HEADER ── */
.wdm-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 28px 28px 20px;
    border-bottom: 1px solid var(--wdm-border);
}

.wdm-trophy {
    font-size: 36px;
    line-height: 1;
    flex-shrink: 0;
    animation: wdm-bounce 0.6s 0.3s ease both;
}

@keyframes wdm-bounce {
    0%   { transform: scale(0.5); opacity: 0; }
    60%  { transform: scale(1.15); }
    100% { transform: scale(1); opacity: 1; }
}

.wdm-deal-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--wdm-red);
    margin: 0 0 4px;
    font-family: 'Poppins', sans-serif;
}

.wdm-heading {
    font-size: 20px;
    font-weight: 700;
    color: var(--wdm-text);
    margin: 0 0 4px;
    line-height: 1.2;
    font-family: 'Poppins', sans-serif;
}

.wdm-subheading {
    font-size: 13px;
    color: var(--wdm-text-muted);
    margin: 0;
    font-family: 'Poppins', sans-serif;
}

/* ── CARDS WRAPPER (scrollable) ── */
.wdm-cards-wrap {
    overflow-x: auto;
    overflow-y: hidden;
    padding: 20px 28px 24px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #ccc transparent;
}

.wdm-cards-wrap::-webkit-scrollbar {
    height: 4px;
}

.wdm-cards-wrap::-webkit-scrollbar-track {
    background: transparent;
}

.wdm-cards-wrap::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 2px;
}

.wdm-cards {
    display: flex;
    gap: 14px;
    width: max-content;
}

/* ── PRODUCT CARD ── */
.wdm-card {
    width: 154px;
    background: var(--wdm-bg-card);
    border: 1px solid var(--wdm-border);
    border-radius: 12px;
    overflow: hidden;
    transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
    flex-shrink: 0;
}

.wdm-card:hover {
    border-color: #000;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.wdm-card-img {
    position: relative;
    width: 100%;
    height: 110px;
    overflow: hidden;
    background: #eee;
}

.wdm-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.35s ease;
}

.wdm-card:hover .wdm-card-img img {
    transform: scale(1.06);
}

/* FREE pill badge */
.wdm-free-pill {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #000;
    color: #fff;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.1em;
    padding: 3px 7px;
    border-radius: 20px;
    text-transform: uppercase;
    line-height: 1;
}

.wdm-card-body {
    padding: 10px 12px 12px;
}

.wdm-card-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--wdm-text);
    margin: 0 0 4px;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: 'Poppins', sans-serif;
}

.wdm-card-price {
    font-size: 11px;
    color: var(--wdm-text-muted);
    text-decoration: line-through;
    margin: 0 0 10px;
    font-family: 'Poppins', sans-serif;
}

.wdm-card-price del,
.wdm-card-price bdi {
    text-decoration: line-through;
}

/* ADD FREE BUTTON */
.wdm-select-btn {
    width: 100%;
    padding: 7px 0;
    background: #000;
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
    font-family: 'Poppins', sans-serif;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.wdm-select-btn:hover:not(:disabled) {
    background: var(--wdm-red);
    transform: translateY(-1px);
}

.wdm-select-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ── FEEDBACK BAR ── */
.wdm-feedback {
    min-height: 0;
    padding: 0 28px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.25s;
    font-family: 'Poppins', sans-serif;
    overflow: hidden;
}

.wdm-feedback:not(:empty) {
    padding: 12px 28px 16px;
    border-top: 1px solid var(--wdm-border);
}

.wdm-fb-success {
    color: #28a745;
}

.wdm-fb-error {
    color: #cc0000;
}

/* ── CART FREE BADGE (inline in cart item name) ── */
.wrap-free-badge {
    display: inline-block;
    background: #000;
    color: #fff;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.1em;
    padding: 2px 7px;
    border-radius: 20px;
    text-transform: uppercase;
    margin-left: 6px;
    vertical-align: middle;
    line-height: 1.4;
}

/* ═══════════════════════════════════════════
   FLOATING CTA — persistent mini-button
   Shows when user has 4+ wraps but dismissed modal
   ═══════════════════════════════════════════ */
.wdm-floating-cta {
    position: fixed;
    bottom: 90px;
    right: 20px;
    z-index: 99999;
    background: #000;
    color: #fff;
    padding: 12px 20px;
    border-radius: 50px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    transition: transform 0.3s, opacity 0.3s, box-shadow 0.2s;

    /* Hidden by default */
    transform: translateY(20px) scale(0.9);
    opacity: 0;
    pointer-events: none;
}

.wdm-floating-cta.wdm-float-visible {
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: auto;
}

.wdm-floating-cta:hover {
    box-shadow: 0 6px 28px rgba(0, 0, 0, 0.35);
    transform: translateY(-2px) scale(1.03);
}

.wdm-float-emoji {
    font-size: 18px;
    line-height: 1;
}

.wdm-float-text {
    white-space: nowrap;
}

/* Pulse animation for floating CTA */
.wdm-floating-cta.wdm-float-visible {
    animation: wdm-float-pulse 2s ease-in-out 1s 3;
}

@keyframes wdm-float-pulse {
    0%, 100% { box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25); }
    50%      { box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25), 0 0 0 6px rgba(0, 0, 0, 0.1); }
}

/* ── MOBILE — bottom-anchored sheet ── */
@media (max-width: 540px) {
    .wdm-overlay {
        padding: 0;
        align-items: flex-end;
    }

    .wdm-modal {
        max-height: 85vh;
        border-radius: var(--wdm-radius) var(--wdm-radius) 0 0;

        /* Slide up from bottom on mobile */
        transform: translateY(100%);
        opacity: 1;
    }

    .wdm-modal.wdm-modal-in {
        transform: translateY(0);
        opacity: 1;
    }

    .wdm-modal.wdm-modal-out {
        transform: translateY(100%);
        opacity: 1;
    }

    .wdm-header {
        padding: 22px 20px 16px;
        gap: 12px;
    }

    .wdm-trophy {
        font-size: 28px;
    }

    .wdm-heading {
        font-size: 17px;
    }

    .wdm-cards-wrap {
        padding: 16px 20px 20px;
    }

    .wdm-card {
        width: 136px;
    }

    .wdm-card-img {
        height: 95px;
    }

    .wdm-feedback:not(:empty) {
        padding: 10px 20px 14px;
    }

    /* Floating CTA — smaller on mobile */
    .wdm-floating-cta {
        bottom: 80px;
        right: 14px;
        padding: 10px 16px;
        font-size: 12px;
    }

    .wdm-float-emoji {
        font-size: 16px;
    }
}