/* ============================================
   SAFIR HAIR — Cart Drawer Styles
   Premium Shopping Cart Sidebar
   ============================================ */

/* ---- Drawer Container ---- */
.cart-drawer {
    position: fixed;
    inset: 0;
    z-index: 10000;
    pointer-events: none;
    visibility: hidden;
}

.cart-drawer.open {
    pointer-events: auto;
    visibility: visible;
}

/* ---- Overlay ---- */
.cart-drawer__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    transition: background 0.35s ease;
}

.cart-drawer.open .cart-drawer__overlay {
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(3px);
}

/* ---- Panel ---- */
.cart-drawer__panel {
    position: absolute;
    top: 0;
    right: 0;
    width: 420px;
    max-width: 100vw;
    height: 100%;
    background: var(--white, #fff);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: -8px 0 40px rgba(0, 0, 0, 0.15);
}

.cart-drawer.open .cart-drawer__panel {
    transform: translateX(0);
}

/* ---- Header ---- */
.cart-drawer__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #f0f0f0;
    background: linear-gradient(135deg, #1a3a5c, #0d2238);
    color: #fff;
}

.cart-drawer__header h3 {
    font-family: var(--font-display, 'Playfair Display', serif);
    font-size: 1.125rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.cart-drawer__header h3 i {
    color: var(--gold-primary, #c9a84c);
}

.cart-drawer__count {
    font-family: var(--font-body, sans-serif);
    font-size: 0.8125rem;
    font-weight: 400;
    opacity: 0.7;
}

.cart-drawer__close {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: all 0.2s;
}

.cart-drawer__close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

/* ---- Shipping Bar ---- */
.cart-drawer__shipping-bar {
    padding: 12px 24px;
    background: #fef9e7;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.8125rem;
    color: #5a4e2d;
    text-align: center;
}

.cart-drawer__shipping-bar p {
    margin: 0 0 8px;
}

.cart-drawer__shipping-bar--complete {
    background: #e8f8f0;
    color: #1a6b43;
}

.cart-drawer__shipping-bar--complete i {
    margin-right: 6px;
    color: #2ecc71;
}

.cart-drawer__progress {
    width: 100%;
    height: 4px;
    background: #e8e0c8;
    border-radius: 4px;
    overflow: hidden;
}

.cart-drawer__progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--gold-primary, #c9a84c), #e0c16e);
    border-radius: 4px;
    transition: width 0.5s ease;
}

/* ---- Body ---- */
.cart-drawer__body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 24px;
}

/* ---- Empty State ---- */
.cart-drawer__empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    color: #999;
    gap: 16px;
}

.cart-drawer__empty i {
    font-size: 3rem;
    opacity: 0.3;
}

.cart-drawer__empty p {
    font-size: 1rem;
    margin: 0;
}

/* ---- Cart Item ---- */
.cart-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 0;
    border-bottom: 1px solid #f4f4f4;
    animation: cartItemIn 0.3s ease;
}

@keyframes cartItemIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.cart-item__image {
    width: 72px;
    height: 72px;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
    background: #f8f8f8;
}

.cart-item__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-item__details {
    flex: 1;
    min-width: 0;
}

.cart-item__name {
    display: block;
    font-family: var(--font-display, 'Playfair Display', serif);
    font-size: 0.875rem;
    font-weight: 600;
    color: #1a3a5c;
    text-decoration: none;
    line-height: 1.3;
    margin-bottom: 4px;
    transition: color 0.2s;
}

.cart-item__name:hover {
    color: var(--gold-primary, #c9a84c);
}

.cart-item__price {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--gold-primary, #c9a84c);
    margin: 0 0 8px;
}

.cart-item__qty {
    display: inline-flex;
    align-items: center;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    overflow: hidden;
}

.cart-item__qty-btn {
    width: 30px;
    height: 28px;
    border: none;
    background: #f8f8f8;
    cursor: pointer;
    font-size: 0.8125rem;
    font-weight: 700;
    color: #555;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.cart-item__qty-btn:hover {
    background: #eee;
    color: #1a3a5c;
}

.cart-item__qty-value {
    width: 32px;
    text-align: center;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #333;
}

.cart-item__remove {
    background: none;
    border: none;
    color: #ccc;
    cursor: pointer;
    font-size: 0.75rem;
    padding: 4px;
    transition: color 0.2s;
    flex-shrink: 0;
    margin-top: 4px;
}

.cart-item__remove:hover {
    color: #e74c3c;
}

/* ---- Footer ---- */
.cart-drawer__footer {
    padding: 20px 24px;
    background: #fafafa;
    border-top: 1px solid #f0f0f0;
}

.cart-drawer__totals {
    margin-bottom: 16px;
}

.cart-drawer__total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    color: #666;
    padding: 4px 0;
}

.cart-drawer__total-row--total {
    font-size: 1.0625rem;
    font-weight: 700;
    color: #1a3a5c;
    padding-top: 12px;
    margin-top: 8px;
    border-top: 2px solid #eee;
}

.cart-drawer__total-row--total span:last-child {
    color: var(--gold-primary, #c9a84c);
    font-size: 1.25rem;
}

.cart-drawer__checkout {
    font-weight: 700 !important;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.cart-drawer__checkout i {
    margin-right: 6px;
}

.cart-drawer__continue {
    display: block;
    text-align: center;
    color: #888;
    font-size: 0.8125rem;
    text-decoration: none;
    padding: 6px 0;
    transition: color 0.2s;
}

.cart-drawer__continue:hover {
    color: var(--gold-primary, #c9a84c);
}

.cart-drawer__continue i {
    margin-right: 4px;
    font-size: 0.6875rem;
}

/* ---- Toast ---- */
.cart-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: linear-gradient(135deg, #1a3a5c, #0d2238);
    color: #fff;
    padding: 14px 24px;
    border-radius: 12px;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 10001;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.cart-toast.show {
    transform: translateY(0);
    opacity: 1;
}

.cart-toast i {
    color: #2ecc71;
    font-size: 1.125rem;
}

/* ---- Add to Cart Button on Cards ---- */
.product-card__add-cart {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 10px 16px;
    margin-top: 12px;
    background: linear-gradient(135deg, var(--safira-deep, #1a3a5c), var(--safira-primary, #2c5f8a));
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
}

.product-card__add-cart:hover {
    background: linear-gradient(135deg, var(--gold-primary, #c9a84c), var(--gold-dark, #b08d3a));
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(201, 168, 76, 0.3);
}

.product-card__add-cart i {
    font-size: 0.75rem;
}

/* ---- Responsive ---- */
@media (max-width: 480px) {
    .cart-drawer__panel {
        width: 100vw;
    }

    .cart-toast {
        left: 16px;
        right: 16px;
        bottom: 16px;
    }
}