/* Side Cart Drawer (Panier Latéral Coulissant) Styles */

/* Overlay / Backdrop */
.intex-cart-drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(2px);
    z-index: 999990;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.intex-cart-drawer-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Drawer Container Panel */
.intex-cart-drawer-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 440px;
    max-width: 100vw;
    height: 100vh;
    height: 100dvh;
    background-color: #ffffff;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 25px rgba(0, 0, 0, 0.15);
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.intex-cart-drawer-panel.active {
    transform: translateX(0);
}

/* Prevent body scrolling when drawer is open */
body.intex-drawer-open {
    overflow: hidden !important;
}

/* Header */
.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #f0f0f0;
    background-color: #ffffff;
}

.drawer-header-title {
    margin: 0;
    font-size: 24px;
    font-weight: 800;
    color: #111827;
    letter-spacing: -0.02em;
}

.drawer-close-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    margin: -8px;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.drawer-close-btn:hover {
    background-color: #f3f4f6;
    color: #111827;
}

/* Body Content Area */
.drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.drawer-body::-webkit-scrollbar {
    width: 5px;
}

.drawer-body::-webkit-scrollbar-thumb {
    background: #e5e7eb;
    border-radius: 10px;
}

/* Empty Cart View */
.drawer-empty-cart {
    text-align: center;
    padding: 40px 20px;
    color: #6b7280;
}

.drawer-empty-icon {
    margin-bottom: 16px;
    color: #9ca3af;
}

.drawer-empty-title {
    font-size: 18px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 8px;
}

.drawer-empty-btn {
    display: inline-block;
    margin-top: 16px;
    padding: 12px 24px;
    background-color: #1c90a1;
    color: #ffffff !important;
    font-weight: 600;
    border-radius: 8px;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.drawer-empty-btn:hover {
    background-color: #167887;
}

/* Cart Items List */
.drawer-items-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Individual Cart Item Card */
.drawer-cart-item {
    display: flex;
    align-items: center;
    gap: 16px;
    background-color: #f8f9fa;
    padding: 14px 16px;
    border-radius: 12px;
    position: relative;
    border: 1px solid #f0f0f0;
}

.drawer-item-img {
    width: 72px;
    height: 72px;
    min-width: 72px;
    background-color: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #eaeaea;
}

.drawer-item-img img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.drawer-item-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-right: 28px;
}

.drawer-item-title {
    font-size: 14px;
    font-weight: 700;
    color: #111827;
    line-height: 1.35;
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.drawer-item-title:hover {
    color: #1c90a1;
}

.drawer-item-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 4px;
}

/* Quantity Control Box */
.drawer-qty-box {
    display: inline-flex;
    align-items: center;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    overflow: hidden;
    height: 32px;
}

.drawer-qty-btn {
    background: transparent;
    border: none;
    width: 28px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
    transition: background 0.15s ease;
}

.drawer-qty-btn:hover {
    background: #f3f4f6;
}

.drawer-qty-input {
    width: 32px;
    height: 100%;
    border: none;
    border-left: 1px solid #f3f4f6;
    border-right: 1px solid #f3f4f6;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: #111827;
    padding: 0;
    -moz-appearance: textfield;
}

.drawer-qty-input::-webkit-outer-spin-button,
.drawer-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.drawer-item-price {
    font-size: 15px;
    font-weight: 800;
    color: #111827;
    white-space: nowrap;
}

/* Item Remove Trash Icon */
.drawer-remove-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: transparent;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: color 0.2s ease, background 0.2s ease;
}

.drawer-remove-btn:hover {
    color: #ef4444;
    background: #fee2e2;
}

/* Section "Vous aimerez aussi" (Cross-sells) */
.drawer-crosssells-section {
    margin-top: 8px;
    padding-top: 16px;
    border-top: 1px dashed #e5e7eb;
}

.drawer-crosssells-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.drawer-crosssells-title {
    font-size: 18px;
    font-weight: 800;
    color: #111827;
    margin: 0;
}

.drawer-slider-nav {
    display: flex;
    gap: 6px;
}

.drawer-nav-arrow {
    background: #e5e7eb;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #374151;
    transition: all 0.2s ease;
}

.drawer-nav-arrow:hover {
    background: #262626;
    color: #ffffff;
}

/* Cross-sell items horizontal carousel */
.drawer-crosssells-slider {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding-bottom: 8px;
    scrollbar-width: none;
}

.drawer-crosssells-slider::-webkit-scrollbar {
    display: none;
}

.drawer-crosssell-card {
    min-width: 145px;
    width: 145px;
    background: #f8f9fa;
    border-radius: 10px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border: 1px solid #f0f0f0;
}

.drawer-crosssell-img {
    width: 100%;
    height: 100px;
    background: #ffffff;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.drawer-crosssell-img img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.drawer-crosssell-title {
    font-size: 12px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 6px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 32px;
}

.drawer-crosssell-price {
    font-size: 13px;
    font-weight: 800;
    color: #111827;
    margin-bottom: 8px;
}

.drawer-crosssell-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 6px 10px;
    background: #ffffff;
    border: 1px solid #1c90a1;
    color: #1c90a1;
    font-size: 11px;
    font-weight: 700;
    border-radius: 6px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    transition: all 0.2s ease;
}

.drawer-crosssell-btn:hover {
    background: #1c90a1;
    color: #ffffff;
}

/* Fixed Footer Summary & Buttons */
.drawer-footer {
    padding: 20px 24px;
    border-top: 1px solid #f0f0f0;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.drawer-summary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 14px;
    color: #374151;
    font-weight: 500;
}

.drawer-summary-row.drawer-subtotal-row {
    font-size: 16px;
    font-weight: 700;
    color: #111827;
}

.drawer-summary-val {
    font-weight: 800;
    color: #111827;
}

/* Primary CTA Button - PASSER COMMANDE */
.drawer-checkout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 16px 20px;
    background-color: #262626;
    color: #ffffff !important;
    font-size: 15px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 8px;
    border: none;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.15s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.drawer-checkout-btn:hover {
    background-color: #000000;
    transform: translateY(-1px);
}

/* Secondary Button - VOIR LE PANIER */
.drawer-viewcart-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 10px 16px;
    background-color: transparent;
    color: #4b5563 !important;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.drawer-viewcart-btn:hover {
    background-color: #f9fafb;
    color: #111827 !important;
    border-color: #9ca3af;
}

/* Mobile Adjustments */
@media (max-width: 480px) {
    .intex-cart-drawer-panel {
        width: 100vw;
    }
    .drawer-header {
        padding: 16px 18px;
    }
    .drawer-body {
        padding: 16px 18px;
    }
    .drawer-footer {
        padding: 16px 18px;
    }
}
