/* ============================================
   FRATTIN SMART SEARCH - NIKE INSPIRED
   Minimal, Clean, Elegant Design
   v7.8.1 - Complete Redesign
   ============================================ */

/* RESET & BASE */
.frattin-search-wrapper * {
    box-sizing: border-box;
}

.frattin-search-wrapper {
    width: 100%;
    max-width: 680px;
    margin: 0 auto;
    position: relative;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Helvetica Neue', sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* ========== INPUT BAR ========== */
.frattin-search-input-wrapper {
    display: flex;
    gap: 0;
    background: #f5f5f5;
    border-radius: 100px;
    padding: 0;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.frattin-search-input-wrapper:focus-within {
    background: #ffffff;
    border-color: #111111;
}

.frattin-search-input {
    flex: 1;
    border: none !important;
    outline: none !important;
    background: transparent !important;
    padding: 14px 20px;
    font-size: 16px;
    color: #111111;
    font-weight: 400;
    box-shadow: none !important;
}

.frattin-search-input::placeholder {
    color: #8d8d8d;
    font-weight: 400;
}

.frattin-search-button {
    background: #111111;
    color: white;
    border: none;
    border-radius: 100px;
    padding: 14px 24px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    margin: 4px;
}

.frattin-search-button:hover:not(:disabled) {
    background: #333333;
}

.frattin-search-button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.frattin-search-button .btn-icon {
    display: none;
}

/* ========== FILTRI - NIKE STYLE ========== */
.frattin-search-filters {
    margin-top: 16px;
}

.frattin-filters-wrapper {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-start;
}

.frattin-filter-btn {
    padding: 10px 18px;
    border: 1px solid #e5e5e5;
    background: #ffffff;
    border-radius: 100px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #111111;
}

.frattin-filter-btn:hover {
    border-color: #111111;
}

.frattin-filter-btn.active {
    background: #111111;
    border-color: #111111;
    color: white;
}

/* ========== LOADING ========== */
.frattin-search-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 24px;
    color: #8d8d8d;
    font-weight: 400;
    font-size: 14px;
}

.loading-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid #e5e5e5;
    border-top-color: #111111;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* ========== MODAL - NIKE CLEAN ========== */
.frattin-search-results {
    position: absolute;
    top: calc(100% + 12px);
    left: 0;
    right: 0;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
    z-index: 1000;
    max-height: 70vh;
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.3s ease;
    border: 1px solid #e5e5e5;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========== HEADER - MINIMAL ========== */
.search-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    background: #ffffff;
    border-radius: 16px 16px 0 0;
    position: sticky;
    top: 0;
    z-index: 10;
    flex-shrink: 0;
    border-bottom: 1px solid #e5e5e5;
}

.header-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    font-size: 16px;
    color: #111111;
}

.ai-icon {
    font-size: 18px;
}

.close-btn {
    background: #f5f5f5;
    border: none;
    color: #111111;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.close-btn:hover {
    background: #e5e5e5;
}

/* ========== BODY ========== */
.search-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0;
    min-height: 0;
}

.search-body::-webkit-scrollbar {
    width: 6px;
}

.search-body::-webkit-scrollbar-track {
    background: transparent;
}

.search-body::-webkit-scrollbar-thumb {
    background: #e5e5e5;
    border-radius: 6px;
}

/* ========== SEZIONI ========== */
.results-section {
    padding: 12px 16px;
}

.exact-results {
    background: #ffffff;
}

.suggested-results {
    background: #fafafa;
    border-top: 1px solid #e5e5e5;
}

/* ========== DIVIDER - NIKE STYLE ========== */
.results-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    background: #ffffff;
}

.divider-line {
    flex: 1;
    height: 1px;
    background: #e5e5e5;
}

.divider-text {
    font-size: 11px;
    font-weight: 600;
    color: #8d8d8d;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ========== CARD - NIKE INSPIRED ========== */
.result-card {
    display: flex;
    gap: 16px;
    padding: 12px 8px;
    border-radius: 0;
    text-decoration: none;
    color: inherit;
    transition: background 0.15s ease;
    margin-bottom: 0;
    background: transparent;
    align-items: flex-start;
    border-bottom: 1px solid #f5f5f5;
}

.result-card:last-child {
    border-bottom: none;
}

.result-card:hover {
    background: #fafafa;
}

.result-card.suggested {
    background: transparent;
}

/* ========== IMMAGINE - PICCOLA E PULITA ========== */
.card-image {
    position: relative;
    width: 100px;
    height: 100px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    background: #f5f5f5;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ========== BADGE - RIMOSSI (TROPPO INVASIVI) ========== */
.card-badges {
    display: none !important;
}

/* ========== INFO - NIKE LAYOUT ========== */
.card-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-top: 4px;
}

.card-title {
    font-size: 15px;
    font-weight: 500;
    color: #111111;
    margin: 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ========== META - MINI INFO ========== */
.card-meta {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: #8d8d8d;
    flex-wrap: wrap;
    font-weight: 400;
}

.card-meta span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* ========== PREZZI - TOTALMENTE A DESTRA ========== */
.card-price {
    margin-left: auto;
    flex-shrink: 0;
    text-align: right;
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: flex-end;
    padding-top: 4px;
}

/* Prezzo normale */
.card-price:not(.has-promo) {
    font-size: 16px;
    font-weight: 600;
    color: #111111;
}

/* CON PROMO - NIKE STYLE */
.price-original {
    font-size: 11px;
    color: #8d8d8d;
    text-decoration: line-through;
    font-weight: 400;
}

.price-promo {
    font-size: 16px;
    font-weight: 600;
    color: #fa5400;
    display: inline-flex;
    align-items: center;
    gap: 0;
}

.price-promo::before {
    content: '';
    display: none;
}

/* ========== FOOTER - NIKE BUTTON ========== */
.search-footer {
    padding: 16px 24px;
    background: #ffffff;
    border-top: 1px solid #e5e5e5;
    border-radius: 0 0 16px 16px;
    position: sticky;
    bottom: 0;
    z-index: 10;
    flex-shrink: 0;
}

.view-all-btn {
    display: block;
    padding: 14px 24px;
    background: #111111;
    color: #ffffff !important;
    text-decoration: none !important;
    border-radius: 100px;
    font-weight: 500;
    font-size: 15px;
    text-align: center;
    transition: all 0.2s ease;
}

.view-all-btn:hover {
    background: #333333;
}

/* ========== NO RESULTS ========== */
.no-results {
    padding: 48px 24px;
    text-align: center;
}

.no-results-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.no-results h3 {
    font-size: 18px;
    color: #111111;
    margin: 0 0 8px;
    font-weight: 500;
}

.no-results p {
    font-size: 14px;
    color: #8d8d8d;
    margin: 0;
}

/* ========== RESPONSIVE MOBILE ========== */
@media (max-width: 768px) {
    .frattin-search-wrapper {
        padding: 0 16px;
    }
    
    .frattin-search-input {
        padding: 12px 18px;
        font-size: 15px;
    }
    
    .frattin-search-button {
        padding: 12px 20px;
    }
    
    .frattin-search-button .btn-text {
        display: none;
    }
    
    .frattin-search-button .btn-icon {
        display: block;
        font-size: 16px;
    }
    
    /* MOBILE: Modal fullscreen */
    .frattin-search-results {
        position: fixed;
        top: 8px;
        left: 8px;
        right: 8px;
        bottom: 8px;
        max-height: none;
        border-radius: 16px;
    }
    
    /* MOBILE: Card più compatta */
    .result-card {
        flex-direction: row;
        padding: 12px 8px;
        gap: 12px;
    }
    
    .card-image {
        width: 80px;
        height: 80px;
    }
    
    .card-title {
        font-size: 14px;
    }
    
    .card-price:not(.has-promo) {
        font-size: 15px;
    }
    
    .price-promo {
        font-size: 15px;
    }
}

/* ========== ACCESSIBILITÀ ========== */
.frattin-search-input:focus,
.frattin-search-button:focus {
    outline: 2px solid rgba(17, 17, 17, 0.2);
    outline-offset: 2px;
}