/* ll-kit-builder.css — Lucas & Lola */
:root {
    --ll-kit-bg:       #F5F0EA;
    --ll-kit-border:   #E8DDD4;
    --ll-kit-text:     #1A1410;
    --ll-kit-cta:      #2B2318;
    --ll-kit-accent:   #fcb6b6;
    --ll-kit-badge-bg: #2B2318;
    --ll-kit-radius:   8px;
    --ll-kit-green:    #4a7c59;
}

/* ══════════════════════════════════════
   WIDGET KIT — BASE (mobile first)
══════════════════════════════════════ */

.ll-kit-section {
    background: var(--ll-kit-bg);
    border: 1px solid var(--ll-kit-border);
    border-radius: var(--ll-kit-radius);
    padding: 16px;
    margin-bottom: 20px;
    font-family: 'DM Sans', sans-serif;
}

/* ── Header ── */
.ll-kit-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}
.ll-kit-title {
    font-family: 'Playfair Display', serif;
    font-size: 1rem;
    font-weight: 700;
    color: var(--ll-kit-text);
    line-height: 1.2;
}
.ll-kit-badge {
    background: var(--ll-kit-badge-bg);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

/* ── Griglia prodotti ── */
/* Mobile: 2 colonne */
.ll-kit-products {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 14px;
}

.ll-kit-product {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 5px;
}
.ll-kit-product--current { opacity: 0.72; }

.ll-kit-product__image-wrap {
    position: relative;
    display: block;
    width: 100%;
    max-width: 90px;
    aspect-ratio: 1;
    flex-shrink: 0;
}
.ll-kit-product__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--ll-kit-border);
    transition: transform 0.2s ease;
    display: block;
}
.ll-kit-product__image-wrap:hover .ll-kit-product__image {
    transform: scale(1.04);
}
.ll-kit-product__current-badge {
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--ll-kit-accent);
    color: var(--ll-kit-text);
    font-size: 0.6rem;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 10px;
    white-space: nowrap;
}
.ll-kit-product__info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: 100%;
}
.ll-kit-product__name {
    font-size: 0.72rem;
    color: var(--ll-kit-text);
    text-decoration: none;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.ll-kit-product__name:hover { text-decoration: underline; }
.ll-kit-product__price {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--ll-kit-cta);
}
.ll-kit-product__placeholder-btn { display: none; }
.ll-kit-current-label {
    font-size: 0.65rem;
    color: var(--ll-kit-green);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
}

/* ── Riepilogo prezzi ── */
.ll-kit-summary {
    border-top: 1px solid var(--ll-kit-border);
    padding-top: 10px;
    margin-bottom: 0;
}
.ll-kit-summary__prices {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.ll-kit-summary__regular {
    font-size: 0.8rem;
    color: #888;
}
.ll-kit-summary__regular del { color: #bbb; }
.ll-kit-summary__discounted {
    font-size: 0.95rem;
    color: var(--ll-kit-text);
    font-weight: 600;
}
.ll-kit-summary__discounted strong { font-size: 1rem; }
.ll-kit-summary__saving {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 700;
    color: #c0392b;
    background: #fdecea;
    padding: 2px 8px;
    border-radius: 4px;
    align-self: flex-start;
}

/* ── Bottone Comprar kit ── */
.ll-kit-buy-btn {
    display: block;
    width: 100%;
    margin-top: 12px;
    padding: 13px 16px;
    background: var(--ll-kit-cta);
    color: #fff;
    border: none;
    border-radius: 7px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .04em;
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
    transition: background .2s, opacity .2s;
    text-align: center;
    touch-action: manipulation;
}
.ll-kit-buy-btn:hover,
.ll-kit-buy-btn:active { background: #1a1410; }
.ll-kit-buy-btn--loading { opacity: .7; cursor: wait; }

/* ── Notifica kit completo ── */
.ll-kit-complete-notice {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    background: #eaf5ee;
    border: 1px solid #b7dfc5;
    border-radius: 6px;
    padding: 10px 12px;
    margin-top: 12px;
    font-size: 0.82rem;
}
.ll-kit-complete-notice__icon { font-size: 1rem; flex-shrink: 0; }
.ll-kit-complete-notice__text { flex: 1; color: #1a4a2a; line-height: 1.4; }

/* ── Badge carrello ── */
.ll-kit-cart-badge {
    display: block;
    font-size: 0.72rem;
    color: #888;
    margin-top: 2px;
}

/* ── Riga sconto nel carrello ── */
.ll-kit-discount-row th,
.ll-kit-discount-row td {
    color: #c0392b;
    font-weight: 700;
}

/* ── Ver carrito btn ── */
.ll-kit-view-cart-btn {
    background: var(--ll-kit-bg) !important;
    color: var(--ll-kit-cta) !important;
    border: 2px solid var(--ll-kit-cta) !important;
    font-weight: 700 !important;
    transition: background .2s, color .2s !important;
}
.ll-kit-view-cart-btn:hover {
    background: var(--ll-kit-cta) !important;
    color: #fff !important;
}

/* ══════════════════════════════════════
   RESPONSIVE — TABLET (≥ 480px)
══════════════════════════════════════ */
@media (min-width: 480px) {

    .ll-kit-section { padding: 18px; }

    /* 3 prodotti per riga se lo spazio lo permette */
    .ll-kit-products {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }

    .ll-kit-product__image-wrap { max-width: 100px; }
    .ll-kit-product__name { font-size: 0.76rem; }
    .ll-kit-product__price { font-size: 0.82rem; }

    /* Riepilogo prezzi su riga orizzontale */
    .ll-kit-summary__prices {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 10px;
    }
}

/* ══════════════════════════════════════
   RESPONSIVE — DESKTOP (≥ 768px)
══════════════════════════════════════ */
@media (min-width: 768px) {

    .ll-kit-section { padding: 20px; margin-bottom: 24px; }

    /* Auto-fill: 4+ prodotti su desktop */
    .ll-kit-products {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
        gap: 14px;
        margin-bottom: 16px;
    }

    .ll-kit-product__image-wrap { max-width: none; }
    .ll-kit-product__name { font-size: 0.78rem; }

    .ll-kit-title { font-size: 1.1rem; }

    .ll-kit-buy-btn { font-size: 15px; padding: 14px 20px; }
}

/* ══════════════════════════════════════
   MODAL — RESPONSIVE
══════════════════════════════════════ */
.ll-kit-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: flex-end;       /* Mobile: sheet dal basso */
    justify-content: center;
}
.ll-kit-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(26, 20, 16, .55);
    cursor: pointer;
}
.ll-kit-modal__box {
    position: relative;
    background: #fff;
    border-radius: 16px 16px 0 0;  /* Mobile: bordi arrotondati solo in alto */
    padding: 24px 20px 32px;       /* Extra padding bottom per notch iOS */
    width: 100%;
    max-width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 -8px 40px rgba(0,0,0,.15);
    animation: llModalUp .25s cubic-bezier(.25,.8,.25,1);
    font-family: 'DM Sans', sans-serif;
}
@keyframes llModalUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Handle visivo mobile (striscia in cima) */
.ll-kit-modal__box::before {
    content: '';
    display: block;
    width: 40px;
    height: 4px;
    background: #ddd;
    border-radius: 2px;
    margin: 0 auto 20px;
}

.ll-kit-modal__close {
    position: absolute;
    top: 16px; right: 16px;
    background: none; border: none;
    font-size: 22px; font-weight: 700;
    color: #8a7a6a; cursor: pointer;
    line-height: 1; padding: 4px;
    transition: color .15s;
    touch-action: manipulation;
}
.ll-kit-modal__close:hover { color: var(--ll-kit-text); }

.ll-kit-modal__title {
    font-family: 'Playfair Display', serif;
    font-size: 1rem;
    font-weight: 700;
    color: var(--ll-kit-text);
    margin: 0 0 4px;
    padding-right: 28px;
    line-height: 1.3;
}
.ll-kit-modal__subtitle {
    font-size: 12px;
    color: #8a7a6a;
    margin: 0 0 18px;
}

.ll-kit-modal__attr-group { margin-bottom: 16px; }
.ll-kit-modal__attr-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: #8a7a6a;
    margin-bottom: 8px;
    display: block;
}
.ll-kit-modal__attr-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.ll-kit-modal__opt {
    padding: 8px 14px;            /* Target touch più grande su mobile */
    border: 1.5px solid var(--ll-kit-border);
    border-radius: 6px;
    background: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
    color: var(--ll-kit-text);
    transition: all .15s;
    touch-action: manipulation;
    min-height: 40px;
    display: flex;
    align-items: center;
}
.ll-kit-modal__opt:hover { border-color: var(--ll-kit-cta); }
.ll-kit-modal__opt.active {
    background: var(--ll-kit-cta);
    color: #fff;
    border-color: var(--ll-kit-cta);
}
.ll-kit-modal__opt.unavailable {
    opacity: .35;
    cursor: not-allowed;
    text-decoration: line-through;
}

.ll-kit-modal__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--ll-kit-border);
}
.ll-kit-modal__selected-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--ll-kit-cta);
    min-width: 70px;
}
.ll-kit-modal__confirm {
    flex: 1;
    padding: 12px 16px;
    background: var(--ll-kit-cta);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
    transition: background .2s, opacity .2s;
    touch-action: manipulation;
    min-height: 44px;
}
.ll-kit-modal__confirm:disabled { opacity: .4; cursor: not-allowed; }
.ll-kit-modal__confirm:not(:disabled):hover { background: #1a1410; }
.ll-kit-modal__confirm.loading { opacity: .7; cursor: wait; }

/* Modal: layout desktop — centrato come overlay */
@media (min-width: 600px) {
    .ll-kit-modal {
        align-items: center;        /* Desktop: centrato verticalmente */
    }
    .ll-kit-modal__box {
        border-radius: 12px;        /* Desktop: tutti i bordi arrotondati */
        width: 90%;
        max-width: 400px;
        max-height: 85vh;
        padding: 28px 24px;
        animation: llModalIn .2s cubic-bezier(.25,.8,.25,1);
    }
    @keyframes llModalIn {
        from { opacity: 0; transform: translateY(12px) scale(.97); }
        to   { opacity: 1; transform: translateY(0) scale(1); }
    }
    /* Nasconde handle mobile */
    .ll-kit-modal__box::before { display: none; }
}
