/* ==========================================================================\n   PANEL PEDIDOS - CONFIGURADOR PÚBLICO DE CESTAS\n   ========================================================================== */

.pp-cesta-configurador {
    width: 100%;
    margin: 30px 0;
    padding: 28px;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    background: #fff;
    box-sizing: border-box;
}

.pp-cesta-configurador *,
.pp-cesta-configurador *::before,
.pp-cesta-configurador *::after {
    box-sizing: border-box;
}

.pp-cesta-configurador__cabecera {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 26px;
}

.pp-cesta-configurador__eyebrow {
    display: block;
    margin-bottom: 5px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .08em;
    color: #666;
}

.pp-cesta-configurador h2,
.pp-cesta-configurador h3,
.pp-cesta-configurador p {
    margin-top: 0;
}

.pp-cesta-configurador h2 {
    margin-bottom: 7px;
    font-size: 28px;
    line-height: 1.15;
}

.pp-cesta-configurador__cabecera p {
    max-width: 650px;
    margin-bottom: 0;
    color: #666;
}

.pp-cesta-contador {
    flex: 0 0 auto;
    min-width: 105px;
    padding: 12px 16px;
    border-radius: 12px;
    background: #f5f5f5;
    text-align: center;
    line-height: 1;
}

.pp-cesta-contador strong {
    font-size: 24px;
}

.pp-cesta-contador small {
    display: block;
    margin-top: 6px;
    color: #666;
    font-size: 11px;
}

.pp-cesta-configurador__layout {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(300px, .75fr);
    gap: 28px;
    align-items: start;
}

.pp-cesta-bloque {
    margin-bottom: 28px;
}

.pp-cesta-bloque h3 {
    margin-bottom: 14px;
    font-size: 19px;
}

.pp-cesta-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.pp-cesta-producto {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 12px;
    border: 2px solid transparent;
    border-radius: 14px;
    background: #f7f7f7;
    transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
}

.pp-cesta-producto:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 18px rgba(0,0,0,.08);
}

.pp-cesta-producto--fijo {
    border-color: #8bcf9a;
    background: #f0faf2;
}

.pp-cesta-producto--cambiable {
    border-color: #82b5e5;
    background: #f0f7fd;
}

.pp-cesta-producto--sustituto {
    border-color: #e9b15f;
    background: #fff8ec;
}

.pp-cesta-producto__imagen {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 10px;
    background: #fff;
}

.pp-cesta-producto__imagen img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.pp-cesta-producto__nombre {
    margin: 10px 0 4px;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.3;
}

.pp-cesta-producto__tipo {
    min-height: 16px;
    color: #666;
    font-size: 11px;
}

.pp-cesta-producto__accion {
    width: 100%;
    margin-top: 10px;
    padding: 8px 10px;
    border: 0;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.pp-cesta-producto__accion--quitar {
    background: #fff;
    color: #a33;
    border: 1px solid #e3b5b5;
}

.pp-cesta-producto__accion--anadir {
    background: #ef8116;
    color: #fff;
}

.pp-cesta-producto__accion:disabled {
    opacity: .45;
    cursor: not-allowed;
}

.pp-cesta-visual {
    min-width: 0;
}

.pp-cesta-visual__sticky {
    position: sticky;
    top: 20px;
    padding: 18px;
    border: 1px solid #e4e4e4;
    border-radius: 16px;
    background: #fafafa;
}

.pp-cesta-visual__cabecera {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
    font-size: 14px;
    font-weight: 700;
}

.pp-cesta-visual__cabecera span:last-child {
    color: #36864a;
}

.pp-cesta-imagen {
    position: relative;
    min-height: 320px;
    overflow: hidden;
    border-radius: 14px;
    background: #f1f1f1;
}

/* Base visual provisional. Más adelante podemos sustituirla por una foto real de la cesta. */
.pp-cesta-imagen__fondo {
    position: absolute;
    inset: 18% 10% 5%;
    border: 8px solid #b77b43;
    border-top-width: 28px;
    border-radius: 8px 8px 28% 28%;
    background: repeating-linear-gradient(90deg, #c89158 0 14px, #b77b43 14px 21px);
    opacity: .95;
}

.pp-cesta-imagen__productos {
    position: absolute;
    inset: 22% 14% 12%;
    display: flex;
    flex-wrap: wrap;
    align-content: flex-end;
    justify-content: center;
    gap: 6px;
    padding: 20px;
}

.pp-cesta-imagen__producto {
    width: 62px;
    height: 62px;
    padding: 4px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 3px 10px rgba(0,0,0,.16);
    object-fit: contain;
}

.pp-cesta-imagen__vacia {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
    text-align: center;
    color: #777;
    font-size: 13px;
    pointer-events: none;
}

.pp-cesta-resumen {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #ddd;
    font-size: 14px;
}

.pp-cesta-ayuda {
    margin: 10px 0 0;
    color: #666;
    font-size: 12px;
    line-height: 1.4;
}

.pp-cesta-bloque--sustitutos {
    padding-top: 4px;
}

.pp-cesta-bloque__titulo p {
    margin-bottom: 14px;
    color: #777;
    font-size: 12px;
}

.pp-cesta-configurador--completa .pp-cesta-ayuda {
    color: #36864a;
}

@media (max-width: 900px) {
    .pp-cesta-configurador__layout {
        grid-template-columns: 1fr;
    }

    .pp-cesta-visual {
        order: -1;
    }

    .pp-cesta-visual__sticky {
        position: relative;
        top: auto;
    }

    .pp-cesta-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .pp-cesta-configurador {
        margin: 20px 0;
        padding: 16px;
        border-radius: 12px;
    }

    .pp-cesta-configurador__cabecera {
        flex-direction: column;
        gap: 14px;
    }

    .pp-cesta-contador {
        align-self: stretch;
    }

    .pp-cesta-configurador h2 {
        font-size: 24px;
    }

    .pp-cesta-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .pp-cesta-producto {
        padding: 8px;
    }

    .pp-cesta-imagen {
        min-height: 260px;
    }

    .pp-cesta-imagen__producto {
        width: 48px;
        height: 48px;
    }
}
#pp-cesta-imagen-productos {
    display: grid !important;

    grid-template-columns: repeat(4, 70px) !important;
    grid-auto-rows: 70px !important;

    justify-content: start !important;
    align-content: start !important;

    gap: 10px !important;

    width: 100% !important;
    min-height: 300px !important;
    height: auto !important;
    max-height: none !important;

    box-sizing: border-box !important;

    padding: 0 !important;

    overflow: visible !important;

    /*
     * Posición provisional de los productos
     */
    transform: translate(-35px, -50px) !important;
}


#pp-cesta-imagen-productos .pp-cesta-imagen__producto {
    width: 70px !important;
    height: 70px !important;

    max-width: 70px !important;
    max-height: 70px !important;

    object-fit: contain !important;

    margin: 0 !important;
    display: block !important;
}


/* MÓVIL */

@media (max-width: 600px) {

    #pp-cesta-imagen-productos {
        grid-template-columns: repeat(3, 55px) !important;
        grid-auto-rows: 55px !important;

        gap: 8px !important;

        min-height: 220px !important;

        transform: translate(-20px, -20px) !important;
    }

    #pp-cesta-imagen-productos .pp-cesta-imagen__producto {
        width: 55px !important;
        height: 55px !important;

        max-width: 55px !important;
        max-height: 55px !important;
    }
}

/* ==========================================================
   FICHAS DE PRODUCTOS
   ========================================================== */

#pp-cesta-productos-iniciales,
#pp-cesta-sustitutos {
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    gap: 10px !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.pp-cesta-producto {
    width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    padding: 8px !important;
    margin: 0 !important;
}

/* Imagen de la ficha */
.pp-cesta-producto__imagen {
    width: 100% !important;
    height: 70px !important;
    margin: 0 auto 6px auto !important;
}

.pp-cesta-producto__imagen img {
    width: 100% !important;
    height: 70px !important;
    object-fit: contain !important;
}

/* Nombre */
.pp-cesta-producto__nombre {
    font-size: 13px !important;
    line-height: 1.2 !important;
    min-height: 31px !important;
}

/* Tipo */
.pp-cesta-producto__tipo {
    font-size: 11px !important;
    line-height: 1.2 !important;
}

/* Botones */
.pp-cesta-producto__accion {
    font-size: 11px !important;
    padding: 5px 7px !important;
    margin-top: 6px !important;
}


/* ==========================================================
   TABLET
   ========================================================== */

@media (max-width: 900px) {

    #pp-cesta-productos-iniciales,
    #pp-cesta-sustitutos {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    }
}


/* ==========================================================
   MÓVIL
   ========================================================== */

@media (max-width: 600px) {

    #pp-cesta-productos-iniciales,
    #pp-cesta-sustitutos {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 7px !important;
    }

    .pp-cesta-producto {
        padding: 6px !important;
    }

    .pp-cesta-producto__imagen,
    .pp-cesta-producto__imagen img {
        height: 55px !important;
    }

    .pp-cesta-producto__nombre {
        font-size: 12px !important;
    }

    .pp-cesta-producto__tipo {
        font-size: 10px !important;
    }
}