/* ==========================================================================
   UniD Checkout Search — checkout-search.css  v1.2.0
   Design: peach/salmon box, dark navy titles, large rounded input.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Box wrapper
   -------------------------------------------------------------------------- */

#unid-cs-box {
    background-color: #fdeae1;
    border: 1px solid #f5c9b5;
    border-radius: 12px;
    padding: 24px 24px 20px;
    margin-bottom: 24px;
    position: relative;
}

/* --------------------------------------------------------------------------
   Title & subtitle
   -------------------------------------------------------------------------- */

#unid-cs-title {
    color: #1a2340;
    font-weight: 700;
    font-size: 1.25em;
    line-height: 1.3;
    margin: 0 0 6px;
    padding: 0;
    border: none;
    background: none;
}

#unid-cs-subtitle {
    color: #6b7280;
    font-size: 0.92em;
    line-height: 1.5;
    margin: 0 0 18px;
}

/* --------------------------------------------------------------------------
   Input wrapper & search input
   -------------------------------------------------------------------------- */

#unid-cs-input-wrap {
    position: relative;
}

#unid-cs-input {
    width: 100%;
    padding: 16px 18px;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    box-sizing: border-box;
    font-size: 1em;
    color: #333;
    background-color: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

#unid-cs-input::placeholder {
    color: #b0b7c3;
}

#unid-cs-input:focus {
    border-color: #f5a58a;
    box-shadow: 0 0 0 3px rgba(245, 165, 138, 0.18);
    outline: none;
}

/* --------------------------------------------------------------------------
   Results dropdown
   -------------------------------------------------------------------------- */

#unid-cs-results {
    display: none;          /* shown by JS when there are results */
    list-style: none;
    margin: 0;
    padding: 0;
    border: 1px solid #e8e8e8;
    border-top: none;
    background-color: #fff;
    border-radius: 0 0 10px 10px;
    max-height: 300px;
    overflow-y: auto;
    position: relative;
    z-index: 9999;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* --- Each result card --- */

#unid-cs-results li.unid-cs-result {
    padding: 12px 16px;
    border-bottom: 1px solid #f3f3f3;
    cursor: default;
}

#unid-cs-results li.unid-cs-result:last-child {
    border-bottom: none;
}

#unid-cs-results li.unid-cs-result:hover {
    background-color: #fff8f5;
}

/* Row 1 — product name */
.unid-cs-result-name {
    font-weight: 600;
    font-size: 0.92em;
    color: #1a2340;
    line-height: 1.35;
    margin-bottom: 7px;
}

/* Row 2 — price (left) + buttons (right) */
.unid-cs-result-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

/* --- Single price (no sale) --- */

.unid-cs-result-price {
    font-size: 0.9em;
    color: #1a2340;
    font-weight: 700;
    white-space: nowrap;
}

/* --- Sale: stacked layout (regular above, sale below) --- */

.unid-cs-result-price.has-sale {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.25;
    gap: 0;
}

.unid-cs-regular-price {
    font-size: 0.78em;
    color: #6b7280;
    font-weight: 400;
    text-decoration: line-through;
}

.unid-cs-sale-price {
    font-size: 1.1em;
    color: #e2401c;
    font-weight: 700;
}

.unid-cs-result-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

/* --- Action buttons --- */

.unid-cs-btn-add,
.unid-cs-btn-more {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    font-size: 0.8em;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
    line-height: 1.4;
    white-space: nowrap;
}

/* "Aggiungi" — filled peach */
.unid-cs-btn-add {
    background-color: #f5a58a;
    border: 1px solid #f5a58a;
    color: #fff;
}

.unid-cs-btn-add:hover {
    background-color: #f08e6e;
    border-color: #f08e6e;
    color: #fff;
}

/* "Scopri di più" — outlined */
.unid-cs-btn-more {
    background-color: #fff;
    border: 1px solid #d1d5db;
    color: #1a2340;
}

.unid-cs-btn-more:hover {
    background-color: #f9fafb;
    border-color: #9ca3af;
    color: #1a2340;
}

.unid-cs-btn-add:disabled {
    opacity: 0.5;
    cursor: default;
}

/* "No results" state */
#unid-cs-results li.unid-cs-no-results {
    padding: 12px 16px;
    color: #9ca3af;
    cursor: default;
    font-style: italic;
    font-size: 0.9em;
}

/* --------------------------------------------------------------------------
   Remove button — trash icon in checkout order summary (unchanged)
   -------------------------------------------------------------------------- */

.unid-cs-remove {
    color: #e2401c;
    text-decoration: none;
    font-size: 1em;
    margin-right: 6px;
    cursor: pointer;
    user-select: none;
}

/* Self-contained SVG icons — no FontAwesome dependency */
.unid-cs-icon {
    display: inline-block;
    width: 0.85em;
    height: 0.85em;
    vertical-align: middle;
    flex-shrink: 0;
    fill: currentColor;
}

.unid-cs-remove .unid-cs-icon {
    width: 0.8em;
    height: 0.8em;
}

/* Trash icon — FA5 trash-alt (regular) path embedded as a data URI mask,
   so it inherits color via background-color + mask and never conflicts with
   any FontAwesome version loaded by the host site. */
.unid-cs-trash {
    display: inline-block;
    width: 0.8em;
    height: 0.8em;
    vertical-align: middle;
    background-color: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 448 512'%3E%3Cpath d='M268 416h24a12 12 0 0 0 12-12V188a12 12 0 0 0-12-12h-24a12 12 0 0 0-12 12v216a12 12 0 0 0 12 12zM432 80h-82.41l-34-56.7A48 48 0 0 0 274.41 0H173.59a48 48 0 0 0-41.16 23.3L98.41 80H16A16 16 0 0 0 0 96v16a16 16 0 0 0 16 16h16v336a48 48 0 0 0 48 48h288a48 48 0 0 0 48-48V128h16a16 16 0 0 0 16-16V96a16 16 0 0 0-16-16zM171.84 50.91A6 6 0 0 1 177 48h94a6 6 0 0 1 5.15 2.91L293.61 80H154.39zM368 464H80V128h288zm-212-48h24a12 12 0 0 0 12-12V188a12 12 0 0 0-12-12h-24a12 12 0 0 0-12 12v216a12 12 0 0 0 12 12z'/%3E%3C/svg%3E") no-repeat center / contain;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 448 512'%3E%3Cpath d='M268 416h24a12 12 0 0 0 12-12V188a12 12 0 0 0-12-12h-24a12 12 0 0 0-12 12v216a12 12 0 0 0 12 12zM432 80h-82.41l-34-56.7A48 48 0 0 0 274.41 0H173.59a48 48 0 0 0-41.16 23.3L98.41 80H16A16 16 0 0 0 0 96v16a16 16 0 0 0 16 16h16v336a48 48 0 0 0 48 48h288a48 48 0 0 0 48-48V128h16a16 16 0 0 0 16-16V96a16 16 0 0 0-16-16zM171.84 50.91A6 6 0 0 1 177 48h94a6 6 0 0 1 5.15 2.91L293.61 80H154.39zM368 464H80V128h288zm-212-48h24a12 12 0 0 0 12-12V188a12 12 0 0 0-12-12h-24a12 12 0 0 0-12 12v216a12 12 0 0 0 12 12z'/%3E%3C/svg%3E") no-repeat center / contain;
}

/* CSS spinner for add-to-cart loading state */
.unid-cs-spinner {
    display: inline-block;
    width: 0.85em;
    height: 0.85em;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    border-radius: 50%;
    vertical-align: middle;
    animation: unid-cs-spin 0.6s linear infinite;
}

@keyframes unid-cs-spin {
    to { transform: rotate(360deg); }
}

.unid-cs-remove:hover {
    color: #c00;
}

.unid-cs-remove:active {
    opacity: 0.6;
}
