/* ===========================
   SIDE CART - Luxury Theme
   =========================== */

/* Overlay */
.side-cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.45);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}
.side-cart-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Drawer */
.side-cart-drawer {
    position: fixed;
    top: 0;
    right: -420px;
    width: 420px;
    max-width: 100vw;
    height: 100%;
    background: #fff;
    z-index: 9999;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.08);
    transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.side-cart-drawer.active {
    right: 0;
}

/* ===== HEADER ===== */
.side-cart-header {
    padding: 18px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
    flex-shrink: 0;
}
.side-cart-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: 0.3px;
    color: #111;
}
.side-cart-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
    color: #888;
    transition: all 0.2s;
    border-radius: 4px;
}
.side-cart-close:hover {
    color: #000;
    background: #f5f5f5;
}

/* ===== BODY (scrollable area) ===== */
.side-cart-body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    -webkit-overflow-scrolling: touch;
}
.side-cart-items {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* ===== ÜRÜN KARTI ===== */
.side-cart-item {
    display: flex;
    gap: 14px;
    padding: 16px 20px;
    border-bottom: 1px solid #f2f2f2;
    align-items: flex-start;
}
.side-cart-item:last-child {
    border-bottom: none;
}

/* Ürün Görseli */
.side-cart-item-img-link {
    flex-shrink: 0;
    display: block;
    width: 80px;
    height: 100px;
    border-radius: 8px;
    overflow: hidden;
    background: #f7f7f7;
    border: 1px solid #eee;
}
.side-cart-item-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s;
}
.side-cart-item-img-link:hover .side-cart-item-img {
    transform: scale(1.05);
}

/* Ürün Bilgi Alanı */
.side-cart-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 8px;
}

/* Başlık + Sil Butonu */
.side-cart-item-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}
.side-cart-item-title {
    font-weight: 500;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    text-decoration: none;
    color: #222;
    font-size: 0.85rem;
    line-height: 1.4;
    flex: 1;
    min-width: 0;
    margin: 0;
}
.side-cart-item-title:hover {
    color: #000;
    text-decoration: underline;
}

/* Sil Butonu (X) */
.side-cart-item-remove-btn {
    background: none;
    border: none;
    color: #bbb;
    cursor: pointer;
    padding: 2px 4px;
    font-size: 0.95rem;
    transition: color 0.2s;
    flex-shrink: 0;
    line-height: 1;
}
.side-cart-item-remove-btn:hover {
    color: #dc3545;
}

/* Stok Uyarıları */
.side-cart-stock-warn {
    color: #d9534f;
    font-size: 0.7rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}
.side-cart-stock-low {
    color: #f0ad4e;
    font-size: 0.7rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ===== ALT KISIM: Adet + Fiyat ===== */
.side-cart-item-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: auto;
}

/* Adet Kontrolü */
.side-cart-qty-control {
    display: inline-flex;
    align-items: center;
    height: 30px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
    background: #fff;
}
.side-cart-qty-control button {
    width: 28px;
    height: 100%;
    border: none;
    background: #f8f8f8;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.9rem;
    color: #555;
    transition: all 0.15s;
    line-height: 1;
    padding: 0;
}
.side-cart-qty-control button:hover {
    color: #000;
    background: #eee;
}
.side-cart-qty-control .qty-val {
    min-width: 30px;
    text-align: center;
    font-size: 0.82rem;
    font-weight: 600;
    color: #222;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 2px;
    background: #fff;
    border-left: 1px solid #e8e8e8;
    border-right: 1px solid #e8e8e8;
}

/* Fiyat Grubu */
.side-cart-item-price-group {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 1px;
}
.side-cart-unit-price {
    font-size: 0.72rem;
    color: #999;
    text-decoration: line-through;
    white-space: nowrap;
}
.side-cart-line-total {
    font-size: 0.9rem;
    font-weight: 700;
    color: #111;
    white-space: nowrap;
}

/* ===== FOOTER ===== */
.side-cart-footer {
    padding: 18px 20px;
    border-top: 1px solid #eee;
    background: #fafafa;
    flex-shrink: 0;
}

/* Kupon Alanı */
.side-cart-coupon-area {
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px dotted #ddd;
}
.side-cart-coupon-form {
    display: flex;
    gap: 8px;
}
.side-cart-coupon-input {
    flex: 1;
    padding: 9px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.85rem;
    outline: none;
    transition: border-color 0.2s;
    min-width: 0;
    background: #fff;
}
.side-cart-coupon-input:focus {
    border-color: #333;
}
.side-cart-coupon-btn {
    padding: 9px 18px;
    background: #444;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: background 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}
.side-cart-coupon-btn:hover {
    background: #111;
}
.side-cart-coupon-msg {
    font-size: 0.75rem;
    margin-top: 5px;
    min-height: 1rem;
}

/* Özet */
.side-cart-summary-group {
    margin-bottom: 16px;
}
.side-cart-summary-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    font-size: 0.88rem;
    color: #555;
}
.side-cart-summary-line.discount-line {
    border-top: 1px solid #f0f0f0;
    padding-top: 8px;
}
.side-cart-summary-line.total-line {
    margin-top: 10px;
    margin-bottom: 0;
    padding-top: 10px;
    border-top: 2px solid #111;
    font-weight: 700;
    font-size: 1.05rem;
    color: #000;
}
.discount-info small {
    font-size: 0.72rem;
    display: block;
    line-height: 1.2;
    font-weight: normal;
}

/* Utility renk sınıfları */
.side-cart-drawer .text-danger { color: #dc3545; }
.side-cart-drawer .text-success { color: #198754; }
.side-cart-drawer .text-info { color: var(--accent, #222222); }
.side-cart-drawer .text-muted { color: #888; }

/* Butonlar */
.side-cart-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.btn-side-cart {
    text-align: center;
    padding: 12px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s;
    display: block;
    cursor: pointer;
}
.btn-view-cart {
    background: #f0f0f0;
    color: #333;
    border: 1px solid #e0e0e0;
}
.btn-view-cart:hover {
    background: #e0e0e0;
    color: #111;
}
.btn-checkout {
    background: #111;
    color: #fff;
}
.btn-checkout:hover {
    background: #333;
    color: #fff;
}
.btn-checkout.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Loading */
.side-cart-loading {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 150px;
    color: #aaa;
    gap: 10px;
    font-size: 0.85rem;
}

/* Boş Sepet */
.empty-side-cart {
    text-align: center;
    padding: 60px 20px;
    color: #aaa;
}
.empty-side-cart i {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.2;
    display: block;
}
.empty-side-cart p {
    font-size: 0.95rem;
    margin-bottom: 15px;
}

/* Hata mesajı */
.side-cart-error {
    padding: 20px;
    text-align: center;
    color: #dc3545;
}

/* d-none */
body .d-none {
    display: none;
}

/* Link */
.btn-link {
    color: #000;
    text-decoration: underline;
    font-weight: 500;
}
.btn-link:hover {
    color: var(--accent, #555);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 480px) {
    .side-cart-drawer {
        width: 100%;
        right: -100%;
    }
    .side-cart-item-img-link {
        width: 65px;
        height: 82px;
    }
    .side-cart-item {
        gap: 10px;
        padding: 14px 16px;
    }
    .side-cart-item-bottom {
        flex-wrap: wrap;
        gap: 8px;
    }
}
