/* ============================================================
   PREMIUM EXCHANGE MODAL (Make a Deal) — ELITE UI/UX
   ============================================================ */

.prod-modal-overlay {
    backdrop-filter: blur(8px);
    background: rgba(17, 40, 54, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
}.deal-exchange-modal {
    width: 100%;
    max-width: 650px;
    max-height: 95vh;
    background: #ffffff;
    border-radius: 32px;
    overflow-y: auto;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: eliteModalIn 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes eliteModalIn {
    from { opacity: 0; transform: scale(0.9) translateY(40px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* HEADER */
.deal-ex-header {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #ffffff;
    padding: 30px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.prod-modal-close {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s;
}

.prod-modal-close:hover {
    background: #ff4757;
    transform: rotate(90deg);
}

.deal-ex-title {
    display: flex;
    align-items: center;
    gap: 20px;
}

.deal-ex-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--accent-green, #00ff84), #00d977);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0f172a;
    font-size: 1.6rem;
    box-shadow: 0 8px 20px rgba(0, 255, 132, 0.3);
}

.deal-ex-title h3 {
    margin: 0;
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.deal-ex-title p {
    margin: 5px 0 0;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 500;
}

/* BODY */
.deal-ex-body {
    padding: 25px 40px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #ffffff;
    position: relative;
}

.deal-ex-col {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 0;
}

.deal-col-label {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.85rem;
    font-weight: 800;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.deal-col-label i {
    color: var(--accent-green);
    font-size: 1rem;
}

/* GRIDS TO CAROUSEL */
.deal-products-grid {
    display: flex;
    flex-wrap: nowrap;
    gap: 15px;
    padding: 10px 5px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-green) #f1f5f9;
    -webkit-overflow-scrolling: touch;
}

.deal-products-grid::-webkit-scrollbar {
    height: 6px;
}

.deal-products-grid::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 10px;
}

.deal-products-grid::-webkit-scrollbar-thumb {
    background: var(--accent-green);
    border-radius: 10px;
}

.deal-prod-card {
    flex: 0 0 140px; /* Fixed width for carousel */
    background: #f8fafc;
    border: 2px solid transparent;
    border-radius: 20px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.deal-prod-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    background: #ffffff;
}

.deal-prod-card.selected {
    border-color: var(--accent-green);
    background: #f0fff4;
    box-shadow: 0 10px 15px -3px rgba(0, 255, 132, 0.2);
}

.deal-prod-check {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 26px;
    height: 26px;
    background: var(--accent-green);
    color: #0f172a;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    opacity: 0;
    transform: scale(0.5) rotate(-45deg);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 5;
    box-shadow: 0 4px 10px rgba(0, 255, 132, 0.4);
}

.deal-prod-card.selected .deal-prod-check {
    opacity: 1;
    transform: scale(1) rotate(0);
}

.deal-prod-card img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.deal-prod-card:hover img {
    transform: scale(1.1);
}

.deal-prod-info {
    padding: 12px;
    background: inherit;
}

.deal-prod-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.deal-prod-cat {
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 500;
}

/* VS DIVIDER (HORIZONTAL) */
.deal-ex-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 0;
    position: relative;
}

.deal-ex-divider::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    background: linear-gradient(to right, transparent, #e2e8f0 20%, #e2e8f0 80%, transparent);
}

.deal-ex-vs {
    width: 52px;
    height: 52px;
    background: #0f172a;
    color: var(--accent-green);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 1.2rem;
    box-shadow: 0 0 0 8px #ffffff, 0 10px 25px rgba(0, 0, 0, 0.15);
    z-index: 10;
    position: relative;
}

/* MESSAGE & PREVIEW */
.deal-ex-bottom-sections {
    background: #f8fafc;
    padding: 0 40px 30px;
}

.deal-selected-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 5px;
    padding: 12px;
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    min-height: 45px;
}

.deal-preview-chip {
    background: #f0fff4;
    border: 1px solid rgba(0, 255, 132, 0.3);
    padding: 6px 14px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 700;
    color: #065f46;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: chipIn 0.3s ease-out;
}

@keyframes chipIn {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
}

.deal-ex-message textarea {
    width: 92%;
    margin: 0 auto;
    display: block;
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 20px;
    padding: 15px 20px;
    font-family: inherit;
    font-size: 0.95rem;
    resize: none;
    outline: none;
    transition: 0.3s;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}

.deal-ex-message textarea:focus {
    border-color: var(--accent-green);
    box-shadow: 0 0 0 5px rgba(0, 255, 132, 0.1);
}

.deal-summary {
    width: 100%;
    margin: 15px 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: #475569;
    text-align: center;
    display: block;
}

/* FOOTER */
.deal-ex-footer {
    padding: 20px 40px 35px;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-top: 1px solid #f1f5f9;
}

.deal-send-btn {
    padding: 16px 40px;
    background: #e2e8f0;
    color: #94a3b8;
    border: none;
    border-radius: 18px;
    font-weight: 800;
    font-size: 1.1rem;
    cursor: not-allowed;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 12px;
}

.deal-send-btn:not(:disabled) {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: var(--accent-green);
    cursor: pointer;
    box-shadow: 0 15px 30px rgba(15, 23, 42, 0.25);
}

.deal-send-btn:not(:disabled):hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.3);
}

.deal-send-btn:active {
    transform: translateY(-2px);
}
}

/* RESPONSIVE */
@media (max-width: 850px) {
    .prod-modal-overlay {
        padding: 15px;
        align-items: center; /* Toujours centré */
    }

    .deal-exchange-modal {
        width: 88%;
        max-width: 450px;
        border-radius: 24px;
        max-height: 94vh;
    }

    .deal-ex-header {
        padding: 15px 20px;
    }

    .deal-ex-icon {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }

    .deal-ex-title h3 {
        font-size: 1.1rem;
    }

    .deal-ex-body {
        padding: 15px;
        gap: 10px;
    }

    .deal-ex-divider {
        padding: 5px 0;
        min-height: 35px;
    }

    .deal-ex-divider::before {
        height: 1px;
    }

    .deal-ex-vs {
        width: 36px;
        height: 36px;
        font-size: 0.85rem;
        box-shadow: 0 0 0 4px #ffffff, 0 4px 10px rgba(0, 0, 0, 0.1);
    }

    .deal-ex-bottom-sections {
        padding: 0 15px 15px;
    }

    .deal-selected-preview {
        padding: 10px;
        margin-bottom: 10px;
        min-height: 40px;
    }

    .deal-ex-message textarea {
        width: 100%;
        padding: 12px;
        font-size: 0.9rem;
        border-radius: 15px;
    }

    .deal-ex-footer {
        padding: 15px;
        padding-bottom: 140px !important;
        flex-direction: column;
        gap: 15px;
    }

    .deal-send-btn {
        width: 100%;
        padding: 12px;
        font-size: 0.95rem;
        border-radius: 14px;
        justify-content: center;
    }

    .deal-summary {
        width: 100%;
        margin: 8px 0 0;
        font-size: 0.85rem;
        text-align: center;
    }

    .deal-products-grid {
        flex-wrap: nowrap;
        justify-content: flex-start;
        overflow-x: auto;
        overflow-y: hidden;
        gap: 12px;
        padding: 5px 0 10px;
        scrollbar-width: thin;
        -webkit-overflow-scrolling: touch;
    }

    .deal-prod-card {
        flex: 0 0 130px; /* Carousel item width */
        max-width: none;
    }

    .deal-prod-card img {
        height: 90px;
    }
}
