/* ==============================================
   Knife Selector — Stili base
   Personalizza liberamente secondo il tuo tema
   ============================================== */

/* --- Selector (pagina prodotto / loop) --- */

.ks-selector-wrap {
    font-family: inherit;
}

.ks-rows {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ks-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ks-select {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    background: #fff;
    cursor: pointer;
    min-width: 0;
}

.ks-select:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.15);
}

.ks-btn-add {
    flex-shrink: 0;
    width: 35px;
    height: 35px;
    background: #d60816;
    color: #fff;
    border: none;
    border-radius: 7px;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.ks-btn-add:hover {
    background: #111111;
}

/* Riga header fissa — select + pulsante + */
.ks-row-header {
    border-bottom: 1px solid #e8e8e8;
    padding-bottom: 8px;
    margin-bottom: 4px;
}

/* Righe confermate (quelle che scendono sotto) */
.ks-row-confirmed {
    padding: 0px;
}

.ks-row-confirmed .ks-select {
    background: #fff;
    font-size: 13px;
}

.ks-btn-remove {
    flex-shrink: 0;
    width: 35px;
    height: 35px;
    background: #111111;
    color: #fff;
    border: 1px solid #ddd;
    border-radius: 7px;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.ks-btn-remove:hover {
    background: #000;
    color: #fff;
    border-color: #000;
}

.ks-no-sizes {
    color: #999;
    font-style: italic;
    font-size: 14px;
}

/* --- Summary Button --- */

.ks-summary-btn-wrap {
    margin-top:-20px;
    display: inline-block;
    width:100%;
}

.ks-summary-btn {
    width:100%;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #d60816;
    color: #fff;
    text-decoration: none;
    border-radius: 7px;
    font-size: 0.9rem;
    font-weight: 400;
    transition: background 0.2s;
    font-family: "HAAS Grotesk", helvetica, arial, Sans-Serif;
}

.ks-summary-btn:hover {
    background: #111111;
    color: #fff;
}

.ks-summary-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    background: #fff;
    color: #1a3c5e;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
}

/* --- Summary Page --- */

.ks-summary-wrap {
    font-family: inherit;
    max-width: 100%;
}

.ks-summary-product {
    margin-bottom: 40px;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    overflow: hidden;
}

.ks-summary-product-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: #f7f8f9;
    border-bottom: 1px solid #e5e5e5;
}

.ks-summary-thumb {
    width: 64px;
    height: 64px;
    object-fit: contain;
    border-radius: 4px;
    background: #fff;
    border: 1px solid #e5e5e5;
}

.ks-summary-product-name {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
}

/* Header colonne */
.ks-summary-rows-header {
    display: grid;
    grid-template-columns: 2fr 2fr 1fr 40px;
    gap: 12px;
    padding: 10px 20px;
    background: #f0f2f4;
    border-bottom: 1px solid #e5e5e5;
    font-size: 12px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ks-summary-rows {
    padding: 8px 0;
}

.ks-summary-row {
    display: grid;
    grid-template-columns: 2fr 2fr 1fr 40px;
    gap: 12px;
    align-items: center;
    padding: 10px 20px;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.15s;
}

.ks-summary-row:last-child {
    border-bottom: none;
}

.ks-summary-row:hover {
    background: #fafbfc;
}

.ks-summary-size-text {
    font-size: 14px;
    font-weight: 500;
    color: #1a1a1a;
}

.ks-summary-field {
    display: flex;
    align-items: center;
    gap: 6px;
}

.ks-summary-field--col {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}
.ks-summary-field-input {
    display: flex;
    align-items: center;
    gap: 6px;
}
.ks-input-hint {
    font-size: 13px;
    color: #5e5e5e;
    white-space: nowrap;
}


.ks-summary-field small {
    color: #999;
    font-size: 12px;
}

.ks-input-length,
.ks-input-pu {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: #fff;
    transition: border-color 0.2s;
}

.ks-input-length:focus,
.ks-input-pu:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.1);
}

.ks-input-pu {
    max-width: 70px;
}

.ks-btn-remove-summary {
    width: 35px;
    height: 35px;
    background: #111111;
    color: #fff;
    border: 1px solid #111111;
    border-radius: 7px;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.ks-btn-remove-summary:hover {
    background: #d60816;
    color: #fff;
    border-color: #d60816;
}

.ks-summary-footer {
    margin-top: 24px;
    display: flex;
    flex-direction: row;
    justify-content: flex-end;
    gap: 12px;
    align-items: center;
}

.ks-btn-clear {
    padding: 10px 20px;
    background: #111111;
    color: #fff;
    border: 1px solid #111111;
    border-radius: 7px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.ks-btn-clear:hover {
    border-color: #d60816;
    background: #d60816;
    color: #fff;
}


.ks-summary-empty {
    display: flex;
    flex-direction: column;
    align-content: center;
    align-items: center;
    background: #f4f4f4;
    padding: 20px;
    border-radius: 20px;
}
.ks-summary-empty a {
    color: #d60816;
}


/* Responsive */
@media (max-width: 600px) {
    .ks-summary-rows-header,
    .ks-summary-row {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto;
    }

    .ks-summary-rows-header span:nth-child(3),
    .ks-summary-rows-header span:nth-child(4) {
        display: none;
    }
}

/* =========================================================
   Pulse animation sul pulsante fisso Elementor
   Classe .knives-btn-pulse
========================================================= */

@keyframes ks-pulse {
    0%   { box-shadow: 0 0 0 0px rgba(214, 8, 22, 0.7); }
    50%  { box-shadow: 0 0 0 14px rgba(214, 8, 22, 0.15); }
    100% { box-shadow: 0 0 0 0px rgba(214, 8, 22, 0); }
}

.knives-btn-pulse.ks-is-pulsing {
    animation: ks-pulse 0.6s ease-out 3;
}

/* =========================================================
   Floating Button + Mini Popup
========================================================= */

.ks-floating-wrap {
    position: fixed;
    bottom: 80px;
    right: 30px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0;
}

/* Pulsante principale */
.ks-floating-btn {
    position: relative;
    width: 50px;
    height: 50px;
    border-radius: 10px;
    background: #d60816;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(0,0,0,0.18);
    transition: all 150ms;
}

.ks-floating-btn:hover,
.ks-floating-btn--open {
    background: #111111;
    transform: scale(0.9);
}

.ks-floating-icon {
    width: 28px;
    height: 28px;
    object-fit: contain;
    display: block;
    color: #fff;
    stroke: #fff;
}

/* Badge contatore */
.ks-floating-badge {
    font-family: "HAAS Grotesk", helvetica, Arial, Sans-Serif;
    position: absolute;
    top: -7px;
    right: -7px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    background: #111111;
    color: #fff;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    line-height: 20px;
    text-align: center;
    pointer-events: none;
    z-index: 1;
}

/* Mini popup */
.ks-floating-popup {
    font-family: "HAAS Grotesk", helvetica, Arial, Sans-Serif;
    position: absolute;
    bottom: 66px;
    right: 0;
    width: 300px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
    overflow: hidden;
    animation: ks-popup-in 0.18s ease-out;
}

@keyframes ks-popup-in {
    from { opacity: 0; transform: translateY(10px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.ks-floating-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px 10px;
    border-bottom: 1px solid #f0f0f0;
}

.ks-floating-popup-title {
    font-size: 13px;
    font-weight: 700;
    color: #111;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ks-floating-popup-close {
    background: none;
    border: none;
    font-size: 20px;
    color: #999;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    transition: color 0.15s;
}

.ks-floating-popup-close:hover {
    color: #d60816;
}

/* Lista prodotti nel popup */
.ks-floating-popup-list {
    max-height: 260px;
    overflow-y: auto;
    padding: 10px 16px;
}

.ks-floating-group {
    margin-bottom: 12px;
}

.ks-floating-group:last-child {
    margin-bottom: 0;
}

.ks-floating-group-name {
    font-size: 12px;
    font-weight: 700;
    color: #d60816;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 6px;
}

.ks-floating-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 0;
    border-bottom: 1px solid #f5f5f5;
    font-size: 13px;
    color: #333;
}

.ks-floating-item:last-child {
    border-bottom: none;
}

.ks-floating-item-size {
    flex: 1;
    font-weight: 500;
}

.ks-floating-item-detail {
    color: #999;
    font-size: 12px;
    white-space: nowrap;
}

.ks-floating-empty {
    color: #999;
    font-size: 13px;
    text-align: center;
    padding: 10px 0;
    margin: 0;
}

/* Footer popup */
.ks-floating-popup-footer {
    padding: 10px 16px 14px;
    border-top: 1px solid #f0f0f0;
}

.ks-floating-popup-cta {
    display: block;
    text-align: center;
    padding: 10px 26px;
    background: #d60816;
    color: #fff;
    border-radius: 7px;
    font-size: 1rem;
    font-weight: 400;
    text-decoration: none;
    transition: background 0.2s;
}

.ks-floating-popup-cta:hover {
    background: #111111;
    color: #fff;
}

@media (max-width: 480px) {
    .ks-floating-wrap {
        bottom: 16px;
        right: 16px;
    }
    .ks-floating-popup {
        width: calc(100vw - 32px);
        right: 0;
    }
}

/* Pulse anche sul floating button */
#ks-floating-btn.ks-is-pulsing {
    animation: ks-pulse 0.6s ease-out 3;
}