/* ==========================================================================
   CART & MINI-CART MANAGEMENT STYLES
   Isolated CSS for all cart-related components
   ========================================================================== */

/* --------------------------------------------------------------------------
   01. MINI-CART TOGGLE & BUTTONS (Global Header)
   -------------------------------------------------------------------------- */

.cart__mini-wrapper {
    position: relative;
    display: flex;
}

.cart__toggle {
    width: 50px;
    height: 50px;
    line-height: 46px;
    text-align: center;
    border: 2px solid #ebebeb;
    display: inline-block;
    border-radius: 100%;
    position: relative;
    font-size: 14px;
    color: #222;
}

.cart__toggle::after {
    content: "\f290";
    font-family: "Font Awesome 5 Pro";
    font-size: 18px;
    color: #222;
    position: absolute;
    top: 0;
    margin-right: 2px;
    line-height: 46px;
    right: 12px;
}

.cart__toggle:hover {
    background: #10b981;
    color: #ffffff;
    border-color: #10b981;
}

.cart__toggle:hover::after {
    color: #ffffff;
}

.cart__toggle:hover .cart__total-item {
    background: #222;
    color: #ffffff;
}

.cart__toggle.cart__toggle-open {
    background: #10b981;
    color: #ffffff;
    border-color: #10b981;
}

.cart__toggle.cart__toggle-open::after {
    color: #ffffff;
}

.cart__toggle.cart__toggle-open .cart__total-item {
    background: #222;
    color: #ffffff;
}

.cart__total-item {
    min-width: 20px;
    height: 20px;
    text-align: center;
    line-height: 20px;
    position: absolute;
    top: -2px;
    left: 35px;
    color: #ffffff;
    background: #10b981;
    border-radius: 100%;
    font-size: 10px;
}

.cart__content span {
    display: block;
}

/* Specific Header Variants */
.yellow-header .cart__toggle {
    border-color: #ffd6a5;
}
.yellow-header .cart__toggle:hover,
.yellow-header .cart__toggle.cart__toggle-open {
    background: #222;
    color: #fff;
    border-color: #222;
}
.yellow-header .cart__total-item {
    background: #222;
}

.grey-header .cart__toggle {
    border-color: #f1f1f1;
}
.grey-header .cart__toggle:hover,
.grey-header .cart__toggle.cart__toggle-open {
    background: #10b981;
    color: #fff;
    border-color: #10b981;
}
.grey-header .cart__total-item {
    background: #10b981;
}

/* --------------------------------------------------------------------------
   02. MINI-CART DROPDOWN (Mini-Wrapper)
   -------------------------------------------------------------------------- */

.cart__mini {
    position: absolute;
    top: 120%;
    right: 0;
    width: 380px;
    background: #ffffff;
    -webkit-box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
    -moz-box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
    z-index: 11;
    border-top: 2px solid #10b981;
    padding: 35px 25px;
    padding-top: 27px;
    visibility: hidden;
    opacity: 0;
    -webkit-transition: all 0.2s ease-out 0s;
    -moz-transition: all 0.2s ease-out 0s;
    -ms-transition: all 0.2s ease-out 0s;
    -o-transition: all 0.2s ease-out 0s;
    transition: all 0.2s ease-out 0s;
}

.cart__mini.cart__opened {
    visibility: visible;
    opacity: 1;
    top: 100%;
}

.cart__mini-4 {
    border-color: #d01418;
}

.cart__mini-4 .cart__price span {
    color: #d01418;
}

.cart__mini-4 .cart__sub-total {
    color: #d01418;
}

.cart__close {
    position: absolute;
    top: 15px;
    right: 15px;
}

.cart__close-btn {
    font-size: 16px;
    color: #222;
    background: transparent;
    border: none;
}

.cart__close-btn:hover {
    color: #10b981;
}

.cart__title {
    border-bottom: 1px solid #ebebeb;
    padding-bottom: 20px;
}

.cart__title h4 {
    font-size: 18px;
    display: inline-block;
    margin-right: 5px;
    margin-bottom: 0;
}

.cart__title span {
    font-size: 12px;
}

.cart__item {
    padding-bottom: 20px;
    padding-top: 20px;
    border-bottom: 1px solid #ebebeb;
    display: flex;
    align-items: center;
}

.cart__img {
    width: 70px;
    margin-right: 20px;
}

.cart__img img {
    width: 100%;
}

.cart__info h6 {
    font-size: 14px;
    margin-bottom: 5px;
}

.cart__price span {
    color: #10b981;
    font-weight: 600;
}

.cart__del {
    margin-left: auto;
}

.cart__del a {
    color: #222;
    font-size: 14px;
}

.cart__del a:hover {
    color: #10b981;
}

.cart__sub {
    padding-top: 20px;
    padding-bottom: 20px;
}

.cart__sub-total {
    font-size: 16px;
    color: #10b981;
    font-weight: 600;
}

.cart__checkout {
    margin-top: 25px;
}

.cart__checkout .os-btn {
    width: 100%;
    margin-bottom: 10px;
    text-align: center;
}

/* --------------------------------------------------------------------------
   03. FULL CART PAGE STYLES (cart.blade.php)
   -------------------------------------------------------------------------- */

:root {
    --olive-50: #f3f7ef;      /* arrière-plan très clair */
    --olive-100: #e6efdb;     /* léger fond/hover */
    --olive-200: #d7e6c7;
    --olive-300: #c7dcb2;
    --olive-400: #b7c59a;     /* olive clair dominant */
    --olive-500: #a3b18a;     /* olive moyen */
    --olive-600: #8aa66a;     /* olive soutenu (hover) */
    --olive-700: #6b8f59;     /* olive foncé (accents) */
    --orange-lite: #ffd6a5;   /* orange très léger */
    --orange-soft: #ffc78a;   /* un peu plus soutenu */
    --muted-ink: #2f3b2f;     /* texte principal sur clair */
    --muted-700: #5c6b5c;     /* texte secondaire */
    --card-bg: #ffffff;
    --border-soft: #e5eddc;
    --shadow-1: 0 2px 8px rgba(51, 78, 26, 0.08);
}

.cart-page {
    padding: 20px 0;
    background: radial-gradient(1200px 600px at 10% -10%, rgba(16,185,129,0.08), transparent 60%),
    radial-gradient(1000px 500px at 110% 10%, rgba(59,130,246,0.08), transparent 60%),
    linear-gradient(180deg, #f8fafc, #ffffff);
}

.cart-header {
    background: linear-gradient(180deg, #ffffff, #eef2f7);
    color: #1f2a1f;
    padding: 16px 18px;
    border-radius: 14px;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(2, 6, 23, 0.06);
    border: 1px solid rgba(2,6,23,0.06);
}

.cart-header h1 {
    margin: 0;
    font-size: 1.6rem;
    color: #1f2a1f;
    letter-spacing: .2px;
}

.cart-count {
    position: relative;
    background: radial-gradient(120% 120% at 0% 0%, rgba(16,185,129,.18), transparent 60%), rgba(16,185,129,0.09);
    color: #064e3b;
    border: 1px solid rgba(16,185,129,0.22);
    padding: 4px 14px 4px 12px;
    border-radius: 999px;
    font-size: 0.82rem;
    margin-top: 6px;
    display: inline-block;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.5), 0 6px 18px rgba(16,185,129,.12);
    animation: cartBadgePulse 3.5s ease-in-out infinite;
    overflow: hidden;
}

.cart-count:after {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(120deg, rgba(255,255,255,.0) 20%, rgba(255,255,255,.35) 35%, rgba(255,255,255,.0) 55%);
    border-radius: inherit;
    transform: translateX(-120%);
    animation: shimmerSweep 5s linear infinite;
    pointer-events: none;
}

@keyframes shimmerSweep { 0% { transform: translateX(-120%);} 100% { transform: translateX(120%);} }
@keyframes cartBadgePulse {
    0%, 100% { box-shadow: inset 0 1px 0 rgba(255,255,255,.5), 0 6px 18px rgba(16,185,129,.12); }
    50% { box-shadow: inset 0 1px 0 rgba(255,255,255,.6), 0 10px 28px rgba(16,185,129,.22); }
}

.cart-container {
    background: var(--card-bg);
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(2, 6, 23, 0.06);
    border: 1px solid rgba(2,6,23,0.06);
}

.cart-table th {
    background: linear-gradient(180deg, #eef2f7, #e3eaf2);
    color: #2f3b2f;
    padding: 10px 10px;
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(2,6,23,0.06);
}

.cart-table td {
    padding: 12px;
    vertical-align: middle;
}

.cart-table tbody tr:hover { background: #fbfefc; }

.product-thumbnail {
    width: 85px;
    height: 85px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border-soft);
    background: var(--olive-50);
}

.product-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-name {
    font-weight: 600;
    color: var(--muted-ink);
}

.product-name a {
    color: var(--muted-ink);
    text-decoration: none;
}

.product-name a:hover {
    color: var(--olive-700);
}

.product-price, .product-subtotal {
    font-weight: 700;
    color: #059669;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.9);
    border: 1px solid rgba(2,6,23,0.06);
    border-radius: 14px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.6), 0 8px 24px rgba(2,6,23,0.05);
    padding: 6px;
}

.quantity-controls .quantity-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid rgba(2,6,23,0.08);
    background: linear-gradient(180deg, #ffffff, #f3f6fb);
    color: #0f172a;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(2,6,23,0.06);
    transition: transform .08s ease, background .2s ease, box-shadow .2s ease, color .2s ease, border-color .2s ease;
    cursor: pointer;
}

.quantity-controls .quantity-btn:hover {
    background: linear-gradient(180deg, #ecfdf5, #e3f2ff);
    color: #065f46;
    border-color: rgba(16,185,129,0.35);
    box-shadow: 0 6px 16px rgba(16,185,129,0.15);
}

.quantity-controls .quantity-btn:active { transform: translateY(1px) scale(0.98); }

.quantity-controls .quantity-input {
    width: 56px;
    border: none;
    background: transparent;
    font-weight: 700;
    color: #065f46;
    padding: 6px 4px;
    font-size: 0.95rem;
    text-align: center;
}

.quantity-controls .quantity-input:focus { outline: none; }

.remove-btn {
    background: #fff;
    color: #b91c1c;
    border: 1px solid rgba(185,28,28,0.25);
    width: 30px;
    height: 30px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.remove-btn:hover {
    background: #fef2f2;
}

.cart-summary {
    background: var(--card-bg);
    padding: 16px;
    border-radius: 14px;
    margin-top: 20px;
    border: 1px solid rgba(2,6,23,0.06);
    box-shadow: 0 10px 30px rgba(2, 6, 23, 0.06);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-soft);
    color: var(--muted-ink);
}

.summary-row:last-child {
    border-bottom: none;
    font-weight: 700;
    color: var(--olive-700);
    border-top: 2px solid var(--olive-600);
    margin-top: 10px;
    padding-top: 10px;
}

.checkout-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.btn-action {
    flex: 1;
    padding: 10px 16px;
    border-radius: 12px;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.95rem;
    border: none;
}

.btn-action.btn-primary, .btn-action.primary {
    background: linear-gradient(135deg, #10b981, #3b82f6);
    color: #fff;
    box-shadow: 0 8px 24px rgba(16,185,129,0.25);
}

.btn-action.btn-primary:hover, .btn-action.primary:hover {
    background: linear-gradient(135deg, #059669, #2563eb);
}

.btn-action.btn-secondary, .btn-action.secondary {
    background: #ffffff;
    border: 1px solid rgba(2,6,23,0.08);
    color: var(--olive-700);
}

.btn-action.btn-secondary:hover, .btn-action.secondary:hover {
    background: #eef2f7;
}

.empty-cart {
    text-align: center;
    padding: 40px;
    background: var(--card-bg);
    border-radius: 14px;
    border: 1px solid rgba(2,6,23,0.06);
}

.empty-cart-icon {
    width: 80px;
    height: 80px;
    background: var(--olive-200);
    border-radius: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    opacity: 0.85;
}

.empty-cart-icon i {
    font-size: 2rem;
    color: white;
}

/* --------------------------------------------------------------------------
   04. CART TOASTS & MODALS
   -------------------------------------------------------------------------- */

.cart-toast-container {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.cart-toast {
    min-width: 280px;
    max-width: 420px;
    background: #ffffff;
    color: var(--muted-ink);
    border: 1px solid var(--border-soft);
    border-left-width: 4px;
    border-radius: 12px;
    box-shadow: 0 16px 40px rgba(2,6,23,.18);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    transform: translateY(-8px);
    opacity: 0;
    transition: all .25s ease;
    pointer-events: auto;
    position: relative;
    overflow: hidden;
}

.cart-toast.show { transform: translateY(0); opacity: 1; }
.cart-toast__icon { font-size: 18px; }
.cart-toast__body { flex: 1; font-size: 0.95rem; }
.cart-toast__close { background: transparent; color: #374237; border: none; font-size: 20px; line-height: 1; cursor: pointer; }
.cart-toast__progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: linear-gradient(90deg, var(--orange-lite), var(--orange-soft)); transform: scaleX(0); transform-origin: left; }
.cart-toast__progress.animate { transition: transform 3.8s linear; transform: scaleX(1); }
.cart-toast.success { border-left-color: var(--olive-600); background: linear-gradient(180deg, #ffffff, #fcfff7); }
.cart-toast.error { border-left-color: #e46b5f; background: #fff6f5; }

/* Confirm Modal (cart page) */
.cp-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.35);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.cp-modal {
    width: 92%;
    max-width: 460px;
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(2,6,23,.22);
    border: 1px solid var(--border-soft);
}

.cp-modal__header {
    padding: 16px 18px;
    background: var(--orange-lite);
    color: #3a2a00;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cp-modal__title { font-size: 1.05rem; margin: 0; }
.cp-modal__close { background: transparent; border: none; font-size: 22px; line-height: 1; color: #5e4600; cursor: pointer; }
.cp-modal__body { padding: 16px 18px; color: var(--muted-ink); }
.cp-modal__product { font-weight: 700; color: #6b3e00; }
.cp-modal__footer { padding: 14px 18px; display:flex; gap: 10px; justify-content: flex-end; background: #fafaf8; border-top: 1px solid var(--border-soft); }

.cp-btn {
    border: 1px solid var(--olive-300);
    border-radius: 10px;
    padding: 10px 14px;
    cursor: pointer;
    font-weight: 600;
    background: #fff;
    color: var(--muted-ink);
}

.cp-btn.confirm {
    background: linear-gradient(135deg, #3b82f6, #10b981);
    color: #fff;
    border: none;
}

.cp-btn.confirm:hover {
    background: linear-gradient(135deg, #2563eb, #059669);
}

/* --------------------------------------------------------------------------
   05. RESPONSIVENESS
   -------------------------------------------------------------------------- */

@media (max-width: 768px) {
    .checkout-actions {
        flex-direction: column;
    }

    .cart-header, .cart-container, .cart-summary {
        border-radius: 12px;
    }

    .cart-table {
        font-size: .92rem;
    }

    .cart-toast-container {
        left: 12px;
        right: 12px;
    }

    .cart-content > [class^="col-"] {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .quantity-controls {
        padding: 6px;
        border-radius: 12px;
    }

    .quantity-controls .quantity-btn {
        width: 34px;
        height: 34px;
        border-radius: 10px;
    }

    .quantity-controls .quantity-input {
        width: 50px;
        font-size: 0.92rem;
    }

    .cart__mini {
        width: 290px;
        padding: 20px 15px;
    }

    .cart__mini-wrapper .cart__toggle {
        display: flex;
        align-items: center;
        line-height: 1;
        padding-top: 0;
        padding-bottom: 0;
    }

    .cart__mini-wrapper {
        margin-top: 0 !important;
        margin-bottom: 0 !important;
    }

    .cart__mini-wrapper .cart__content {
        display: none !important;
    }
}
