/* ==========================================================================
   SalMall Yan Sepet - Premium Stil
   ========================================================================== */

:root {
    --salmall-primary: #111111;
    --salmall-accent: #16a34a;
    --salmall-bar-bg: #f5f5f5;
    --salmall-text: #1a1a1a;
    --salmall-muted: #6b7280;
    --salmall-border: #ececec;
    --salmall-bg: #ffffff;
    --salmall-radius: 14px;
    --salmall-shadow: 0 25px 60px -12px rgba(0,0,0,0.25);
}

/* ===== Overlay ===== */
.salmall-cart-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 15, 15, 0.45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: opacity .35s ease, visibility .35s ease;
    z-index: 99998;
}
.salmall-cart-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

/* ===== Drawer ===== */
.salmall-cart-drawer {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    height: 100dvh;
    width: 100%;
    max-width: 440px;
    background: var(--salmall-bg);
    box-shadow: var(--salmall-shadow);
    transform: translateX(100%);
    transition: transform .42s cubic-bezier(.22,.61,.36,1);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    color: var(--salmall-text);
}
.salmall-cart-drawer.is-open {
    transform: translateX(0);
}

/* ===== Header ===== */
.salmall-cart-header {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 24px 18px;
    border-bottom: 1px solid var(--salmall-border);
}
.salmall-cart-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--salmall-primary);
    line-height: 1;
}
.salmall-cart-header-count {
    color: var(--salmall-muted);
    font-weight: 500;
    margin-left: 4px;
    font-size: 15px;
}
.salmall-cart-close {
    background: #f3f4f6;
    border: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--salmall-text);
    transition: background .2s ease, transform .2s ease;
    padding: 0;
}
.salmall-cart-close:hover {
    background: #e5e7eb;
    transform: rotate(90deg);
}

/* ===== Shipping Bar ===== */
.salmall-shipping-bar {
    flex-shrink: 0;
    background: var(--salmall-bar-bg);
    padding: 14px 24px 16px;
    border-bottom: 1px solid var(--salmall-border);
}
.salmall-shipping-bar__text {
    margin: 0 0 9px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
    color: var(--salmall-text);
    text-align: center;
}
.salmall-shipping-bar__text strong {
    color: var(--salmall-accent);
    font-weight: 700;
}
.salmall-shipping-bar__text .free {
    color: var(--salmall-accent);
    font-weight: 700;
}
.salmall-shipping-bar__track {
    height: 6px;
    background: rgba(0,0,0,0.08);
    border-radius: 999px;
    overflow: hidden;
    position: relative;
}
.salmall-shipping-bar__fill {
    height: 100%;
    background: var(--salmall-accent);
    border-radius: 999px;
    width: 0%;
    transition: width .6s cubic-bezier(.22,.61,.36,1);
    position: relative;
}
.salmall-shipping-bar__fill::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 30px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5));
    animation: salmall-shimmer 2s infinite;
}
@keyframes salmall-shimmer {
    0% { transform: translateX(-30px); opacity: 0; }
    50% { opacity: 1; }
    100% { transform: translateX(30px); opacity: 0; }
}

/* ===== Body ===== */
.salmall-cart-body {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0;
    -webkit-overflow-scrolling: touch;
}
.salmall-cart-body::-webkit-scrollbar { width: 6px; }
.salmall-cart-body::-webkit-scrollbar-track { background: transparent; }
.salmall-cart-body::-webkit-scrollbar-thumb { background: #ddd; border-radius: 4px; }

.salmall-cart-items {
    padding: 8px 0;
}

/* ===== Loading ===== */
.salmall-cart-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 0;
}
.salmall-spinner {
    width: 28px;
    height: 28px;
    border: 2.5px solid #e5e7eb;
    border-top-color: var(--salmall-primary);
    border-radius: 50%;
    animation: salmall-spin .9s linear infinite;
}
@keyframes salmall-spin {
    to { transform: rotate(360deg); }
}

/* ===== Empty State ===== */
.salmall-cart-empty {
    text-align: center;
    padding: 60px 24px 40px;
}
.salmall-empty-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 18px;
    background: #f9fafb;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
}
.salmall-empty-title {
    margin: 0 0 6px;
    font-size: 18px;
    font-weight: 700;
    color: var(--salmall-primary);
}
.salmall-empty-sub {
    margin: 0 0 22px;
    color: var(--salmall-muted);
    font-size: 14px;
}
.salmall-empty-btn {
    display: inline-block;
    padding: 12px 28px;
    background: var(--salmall-primary);
    color: #fff !important;
    border-radius: 999px;
    text-decoration: none !important;
    font-weight: 600;
    font-size: 14px;
    transition: transform .2s ease, opacity .2s ease;
}
.salmall-empty-btn:hover {
    transform: translateY(-1px);
    opacity: .9;
    color: #fff !important;
}

/* ===== Cart Item ===== */
.salmall-cart-item {
    display: flex;
    gap: 14px;
    padding: 16px 24px;
    border-bottom: 1px solid var(--salmall-border);
    position: relative;
    animation: salmall-fadeIn .3s ease both;
}
@keyframes salmall-fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.salmall-cart-item.is-removing {
    opacity: 0;
    transform: translateX(20px);
    transition: opacity .3s ease, transform .3s ease;
}

.salmall-item-thumb {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: 10px;
    overflow: hidden;
    background: #f3f4f6;
    display: block;
}
.salmall-item-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.salmall-item-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.salmall-item-title {
    color: var(--salmall-text) !important;
    text-decoration: none !important;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    padding-right: 24px;
}
.salmall-item-title:hover {
    color: var(--salmall-primary) !important;
    opacity: .75;
}
.salmall-item-meta {
    margin: 0;
    font-size: 12px;
    color: var(--salmall-muted);
}

.salmall-item-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 6px;
}

/* Quantity selector */
.salmall-qty {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--salmall-border);
    border-radius: 999px;
    overflow: hidden;
    background: #fff;
}
.salmall-qty-btn {
    width: 28px;
    height: 28px;
    border: 0;
    background: transparent;
    cursor: pointer;
    font-size: 16px;
    color: var(--salmall-text);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
    transition: background .15s ease;
}
.salmall-qty-btn:hover {
    background: #f3f4f6;
}
.salmall-qty-btn:disabled {
    opacity: .4;
    cursor: not-allowed;
}
.salmall-qty-value {
    min-width: 28px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    padding: 0 4px;
}

.salmall-item-price {
    font-size: 14px;
    font-weight: 700;
    color: var(--salmall-primary);
}
.salmall-item-price .woocommerce-Price-amount {
    font-weight: 700;
}

.salmall-item-remove {
    position: absolute;
    top: 14px;
    right: 18px;
    background: transparent;
    border: 0;
    padding: 4px;
    cursor: pointer;
    color: #9ca3af;
    transition: color .15s ease, transform .15s ease;
    line-height: 0;
}
.salmall-item-remove:hover {
    color: #ef4444;
    transform: scale(1.1);
}

/* ===== Recommended ===== */
.salmall-cart-recommended {
    padding: 22px 0 28px;
    border-top: 8px solid #f9fafb;
    margin-top: 8px;
}
.salmall-cart-recommended h3 {
    margin: 0 0 14px;
    font-size: 14px;
    font-weight: 700;
    color: var(--salmall-primary);
    padding: 0 24px;
    letter-spacing: -0.01em;
}
.salmall-recommended-scroll {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 0 24px;
}

.salmall-rec-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: #fafafa;
    border-radius: 12px;
    transition: background .2s ease;
}
.salmall-rec-item:hover {
    background: #f3f4f6;
}
.salmall-rec-thumb {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    display: block;
}
.salmall-rec-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.salmall-rec-info {
    flex: 1;
    min-width: 0;
}
.salmall-rec-title {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--salmall-text) !important;
    text-decoration: none !important;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 3px;
}
.salmall-rec-price {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--salmall-primary);
}
.salmall-rec-price del {
    color: var(--salmall-muted);
    font-weight: 400;
    margin-right: 4px;
    font-size: 11px;
}
.salmall-rec-add {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--salmall-primary);
    color: #fff !important;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none !important;
    border: 0;
    cursor: pointer;
    transition: transform .2s ease, opacity .2s ease;
}
.salmall-rec-add:hover {
    transform: scale(1.08);
    opacity: .9;
    color: #fff !important;
}
.salmall-rec-add.loading {
    pointer-events: none;
    opacity: .6;
}
.salmall-rec-add.loading svg {
    animation: salmall-spin .8s linear infinite;
}
.salmall-rec-add.added {
    background: var(--salmall-accent);
}

/* ===== Footer ===== */
.salmall-cart-footer {
    flex-shrink: 0;
    padding: 18px 24px 22px;
    border-top: 1px solid var(--salmall-border);
    background: #fff;
    box-shadow: 0 -8px 24px -12px rgba(0,0,0,0.06);
}
.salmall-cart-subtotal {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}
.salmall-cart-subtotal .label {
    font-size: 14px;
    color: var(--salmall-muted);
    font-weight: 500;
}
.salmall-cart-subtotal .amount {
    font-size: 20px;
    font-weight: 800;
    color: var(--salmall-primary);
    letter-spacing: -0.02em;
}
.salmall-cart-checkout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 15px 20px;
    background: var(--salmall-primary);
    color: #fff !important;
    text-decoration: none !important;
    border-radius: 999px;
    font-weight: 700;
    font-size: 15px;
    letter-spacing: 0.01em;
    transition: transform .2s ease, opacity .2s ease, box-shadow .2s ease;
    box-shadow: 0 4px 14px -4px rgba(0,0,0,0.25);
}
.salmall-cart-checkout:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px -6px rgba(0,0,0,0.3);
    opacity: .95;
    color: #fff !important;
}
.salmall-cart-checkout:active {
    transform: translateY(0);
}
.salmall-cart-secure {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin: 10px 0 0;
    font-size: 11px;
    color: var(--salmall-muted);
    text-align: center;
}

/* ===== Hide cart button when empty ===== */
.salmall-cart-drawer.is-empty .salmall-cart-footer,
.salmall-cart-drawer.is-empty .salmall-shipping-bar,
.salmall-cart-drawer.is-empty .salmall-cart-recommended {
    display: none;
}

/* ===== Mobile ===== */
@media (max-width: 480px) {
    .salmall-cart-drawer {
        max-width: 100%;
    }
    .salmall-cart-header,
    .salmall-cart-item,
    .salmall-shipping-bar,
    .salmall-cart-footer,
    .salmall-cart-recommended h3,
    .salmall-recommended-scroll {
        padding-left: 18px;
        padding-right: 18px;
    }
    .salmall-item-thumb {
        width: 70px;
        height: 70px;
    }
}

/* Body lock when open */
body.salmall-cart-locked {
    overflow: hidden;
}

/* ==========================================================================
   Yüzen Sepet İkonu (sol alt)
   ========================================================================== */
.salmall-floating-cart {
    position: fixed;
    bottom: 22px;
    left: 22px;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: var(--salmall-primary);
    color: #fff;
    border: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 25px -8px rgba(0,0,0,0.35), 0 4px 8px -2px rgba(0,0,0,0.15);
    z-index: 99990;
    transition: transform .25s cubic-bezier(.22,.61,.36,1), box-shadow .25s ease, opacity .25s ease;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}
.salmall-floating-cart:hover {
    transform: translateY(-3px) scale(1.04);
    box-shadow: 0 14px 30px -8px rgba(0,0,0,0.4), 0 6px 12px -2px rgba(0,0,0,0.18);
}
.salmall-floating-cart:active {
    transform: translateY(-1px) scale(0.98);
}
.salmall-floating-cart__icon {
    transition: transform .2s ease;
}
.salmall-floating-cart:hover .salmall-floating-cart__icon {
    transform: scale(1.08);
}

/* Bildirim rozeti */
.salmall-floating-cart__badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--salmall-accent);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
    line-height: 1;
    transform: scale(0);
    transition: transform .3s cubic-bezier(.34,1.56,.64,1);
    pointer-events: none;
}
.salmall-floating-cart.has-items .salmall-floating-cart__badge {
    transform: scale(1);
}

/* Sepete eklendiğinde "pulse" efekti */
.salmall-floating-cart.salmall-pulse {
    animation: salmall-pulse 0.6s ease;
}
@keyframes salmall-pulse {
    0%   { transform: scale(1); }
    30%  { transform: scale(1.15); }
    60%  { transform: scale(0.95); }
    100% { transform: scale(1); }
}

/* Drawer açıkken yüzen ikonu gizle */
.salmall-floating-cart.is-hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px) scale(0.8);
}

@media (max-width: 480px) {
    .salmall-floating-cart {
        bottom: 18px;
        left: 18px;
        width: 54px;
        height: 54px;
    }
}

/* ==========================================================================
   "Alışverişe Devam Et" - metin link (Sepete Git ile çakışmasın diye sade)
   ========================================================================== */
.salmall-cart-continue {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin: 12px auto 0;
    padding: 4px 8px;
    background: transparent;
    color: var(--salmall-muted);
    border: 0;
    border-radius: 4px;
    font-weight: 500;
    font-size: 13px;
    cursor: pointer;
    transition: color .2s ease;
    font-family: inherit;
    text-decoration: none;
    width: auto;
    position: relative;
}
.salmall-cart-continue::after {
    content: "";
    position: absolute;
    left: 8px;
    right: 8px;
    bottom: 2px;
    height: 1px;
    background: currentColor;
    opacity: 0;
    transition: opacity .2s ease;
}
.salmall-cart-continue:hover {
    color: var(--salmall-primary);
}
.salmall-cart-continue:hover::after {
    opacity: 0.4;
}
.salmall-cart-continue svg {
    transition: transform .2s ease;
}
.salmall-cart-continue:hover svg {
    transform: translateX(-2px);
}

/* Footer içinde merkezlemek için */
.salmall-cart-footer {
    text-align: center;
}
.salmall-cart-drawer.is-empty .salmall-cart-continue {
    display: none;
}
