/**
 * Almira Bebek Companion - Core Styles
 * Sitewide: Mini Cart Drawer, Toast, Floating Button, Variables
 * @package Almira_Bebek_Companion
 */

/* ==========================================================================
   CSS VARIABLES
   ========================================================================== */

:root {
    --abc-primary: #14B8A6;
    --abc-primary-dark: #0D9488;
    --abc-success: #10B981;
    --abc-warning: #F59E0B;
    --abc-warning-dark: #D97706;
    --abc-danger: #EF4444;
    --abc-text: #1F2937;
    --abc-text-muted: #6B7280;
    --abc-border: #E5E7EB;
    --abc-bg: #FFFFFF;
    --abc-bg-light: #F9FAFB;
    --abc-radius: 18px;
    --abc-radius-sm: 12px;
    --abc-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    --abc-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --abc-shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.15);
}


/* ==========================================================================
   FLOATING CART BUTTON (Fallback trigger)
   ========================================================================== */

.abc-floating-cart {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--abc-primary) 0%, var(--abc-primary-dark) 100%);
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(20, 184, 166, 0.4);
    z-index: 9997;
    transition: all 0.3s ease;
}

.abc-floating-cart:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(20, 184, 166, 0.5);
}

.abc-floating-cart:active {
    transform: scale(0.95);
}

.abc-floating-cart svg {
    width: 26px;
    height: 26px;
}

.abc-floating-cart__count {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    background: var(--abc-danger);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    line-height: 22px;
    text-align: center;
    border-radius: 11px;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
}

.abc-floating-cart__count:empty,
.abc-floating-cart__count[data-count="0"] {
    display: none;
}

/* Hide on cart/checkout pages */
body.woocommerce-cart .abc-floating-cart,
body.woocommerce-checkout .abc-floating-cart {
    display: none;
}


/* ==========================================================================
   MINI CART DRAWER
   ========================================================================== */

/* Backdrop */
.abc-drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    backdrop-filter: blur(2px);
}

.abc-drawer-backdrop.active {
    opacity: 1;
    visibility: visible;
}

/* Drawer */
.abc-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 420px;
    height: 100%;
    background: var(--abc-bg);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.15);
}

.abc-drawer.open {
    transform: translateX(0);
}

/* Drawer Header */
.abc-drawer__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--abc-border);
    flex-shrink: 0;
}

.abc-drawer__title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 700;
    color: var(--abc-text);
    margin: 0;
}

.abc-drawer__title svg {
    color: var(--abc-primary);
}

.abc-drawer__count {
    font-weight: 400;
    color: var(--abc-text-muted);
}

.abc-drawer__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--abc-bg-light);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--abc-text-muted);
}

.abc-drawer__close:hover {
    background: var(--abc-border);
    color: var(--abc-text);
}

/* Drawer Body */
.abc-drawer__body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    overscroll-behavior: contain;
}

/* Empty State */
.abc-drawer__empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 24px;
    text-align: center;
    height: 100%;
}

.abc-drawer__empty-icon {
    color: var(--abc-border);
    margin-bottom: 20px;
}

.abc-drawer__empty-text {
    font-size: 16px;
    color: var(--abc-text-muted);
    margin: 0 0 24px;
}

.abc-drawer__empty-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    background: var(--abc-primary);
    text-decoration: none;
    border-radius: 10px;
    transition: all 0.2s ease;
}

.abc-drawer__empty-btn:hover {
    background: var(--abc-primary-dark);
    color: #fff;
}

/* Cart Items */
.abc-drawer__items {
    list-style: none;
    margin: 0;
    padding: 0;
}

.abc-drawer__item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 24px;
    border-bottom: 1px solid var(--abc-border);
    position: relative;
    transition: background 0.2s ease;
}

.abc-drawer__item:hover {
    background: var(--abc-bg-light);
}

.abc-drawer__item.removing {
    opacity: 0.5;
    pointer-events: none;
}

.abc-drawer__item-image {
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    border-radius: 10px;
    overflow: hidden;
    background: var(--abc-bg-light);
    border: 1px solid var(--abc-border);
}

.abc-drawer__item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.abc-drawer__item-info {
    flex: 1;
    min-width: 0;
    padding-right: 36px; /* space for absolute-positioned remove button */
}

.abc-drawer__item-name {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--abc-text);
    text-decoration: none;
    line-height: 1.4;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.abc-drawer__item-name:hover {
    color: var(--abc-primary);
}

.abc-drawer__item-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
}

.abc-drawer__item-qty {
    color: var(--abc-text-muted);
}

.abc-drawer__item-price {
    font-weight: 600;
    color: var(--abc-primary);
}

/* Sale price: show discount (strikethrough) + actual price */
.abc-drawer__item-price del {
    color: var(--abc-text-muted);
    font-weight: 400;
    font-size: 11px;
    text-decoration: line-through;
    opacity: 0.7;
}

.abc-drawer__item-price ins {
    text-decoration: none;
    font-weight: 700;
    color: var(--abc-primary);
}

/* Gift item in mini cart — premium */
.abc-drawer__item--gift {
    border: 1.5px solid #6EE7B7;
    background: linear-gradient(135deg, #F0FDF9, #ECFDF5, #F0FDF4);
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.08), 0 2px 8px rgba(16, 185, 129, 0.1);
}

.abc-drawer__item--gift::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #10B981, #34D399, #6EE7B7, #34D399, #10B981);
}

.abc-drawer__item-gift-badge {
    font-size: 11px;
    font-weight: 700;
    color: #065F46;
    background: linear-gradient(135deg, #D1FAE5, #A7F3D0);
    border: 1px solid #6EE7B7;
    padding: 2px 8px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.abc-drawer__item-gift-badge svg { color: #059669; }

.abc-drawer__item-price--free {
    color: #059669 !important;
    font-weight: 800 !important;
    font-size: 13px;
}

.abc-drawer__item-remove {
    position: absolute;
    top: 16px;
    right: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    color: var(--abc-text-muted);
    transition: all 0.2s ease;
}

.abc-drawer__item-remove:hover {
    background: #FEE2E2;
    color: var(--abc-danger);
}

/* Drawer Footer */
.abc-drawer__footer {
    flex-shrink: 0;
    padding: 16px 24px 20px;
    border-top: 1px solid var(--abc-border);
    background: var(--abc-bg-light);
}

/* ── Free Shipping (compact) ─────────────── */

/* Achieved — single-line pill */
.abc-foot__ship-ok {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 600;
    color: #059669;
    background: #ECFDF5;
    border: 1px solid #A7F3D0;
    border-radius: 20px;
    padding: 4px 12px;
    margin-bottom: 12px;
}

.abc-foot__ship-ok svg { color: #059669; flex-shrink: 0; }

/* Not achieved — progress bar */
.abc-foot__ship {
    margin-bottom: 12px;
    padding: 8px 12px;
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 10px;
}

.abc-foot__ship-info {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
    color: #92400E;
    margin-bottom: 6px;
}

.abc-foot__ship-info svg { flex-shrink: 0; color: #D97706; }
.abc-foot__ship-info strong { font-weight: 700; }

.abc-foot__ship-bar {
    height: 4px;
    background: rgba(0, 0, 0, 0.06);
    border-radius: 2px;
    overflow: hidden;
}

.abc-foot__ship-fill {
    height: 100%;
    background: linear-gradient(90deg, #F59E0B, #EAB308);
    border-radius: 2px;
    transition: width 0.6s cubic-bezier(0.32, 0.72, 0, 1);
}

/* ── Pricing Summary ─────────────────────── */
.abc-foot__pricing {
    margin-bottom: 14px !important;
    background: linear-gradient(135deg, #F8FAF9 0%, #F0F7F4 100%) !important;
    border: 1px solid rgba(20, 184, 166, 0.12) !important;
    border-radius: 12px !important;
    padding: 12px 14px !important;
    box-shadow: 0 1px 4px rgba(20, 184, 166, 0.06);
}

/* Generic row */
.abc-foot__row {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    line-height: 1.4;
}

/* Subtotal row (muted, small) */
.abc-foot__row--sub {
    font-size: 13px !important;
    color: #6B7280 !important;
    padding-bottom: 4px;
}

.abc-foot__row--sub span:last-child {
    font-weight: 500 !important;
    text-decoration: line-through !important;
    opacity: 0.6;
    font-size: 13px !important;
}

/* Discount row */
.abc-foot__row--discount {
    font-size: 12px !important;
    color: #059669 !important;
    font-weight: 600 !important;
    padding-bottom: 6px;
}

.abc-foot__row--discount span:first-child {
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
}

.abc-foot__row--discount span:first-child svg { flex-shrink: 0; }

/* Total row */
.abc-foot__row--total {
    font-size: 14px !important;
    font-weight: 700 !important;
    color: #1F2937 !important;
    padding-top: 8px !important;
    margin-top: 4px;
    border-top: 1px solid rgba(20, 184, 166, 0.15) !important;
    letter-spacing: -0.01em;
}

.abc-foot__row--total span:last-child {
    font-size: 18px !important;
    font-weight: 800 !important;
    color: #14B8A6 !important;
    letter-spacing: -0.02em;
}

/* ── Old subtotal classes (keep for fallback) ── */
.abc-drawer__subtotal { display: none; }
.abc-drawer__fbt-discount { display: none; }
.abc-drawer__total { display: none; }

.abc-drawer__actions {
    display: flex;
    gap: 12px;
}

.abc-drawer__btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 20px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    border-radius: 12px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.abc-drawer__btn--secondary {
    color: var(--abc-text);
    background: var(--abc-bg);
    border: 2px solid var(--abc-border);
}

.abc-drawer__btn--secondary:hover {
    border-color: var(--abc-primary);
    color: var(--abc-primary);
}

.abc-drawer__btn--primary {
    color: #fff;
    background: linear-gradient(135deg, var(--abc-primary) 0%, var(--abc-primary-dark) 100%);
    border: none;
    box-shadow: 0 4px 15px rgba(20, 184, 166, 0.35);
}

.abc-drawer__btn--primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(20, 184, 166, 0.45);
    color: #fff;
}

.abc-drawer__btn--primary svg {
    transition: transform 0.2s ease;
}

.abc-drawer__btn--primary:hover svg {
    transform: translateX(3px);
}

/* Body scroll lock when drawer open */
body.abc-drawer-open {
    overflow: hidden;
}


/* ==========================================================================
   MINI CART NOTICE
   ========================================================================== */

.abc-mini-notice {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: #FEF3C7;
    border-radius: 8px;
    margin-bottom: 12px;
    font-size: 13px;
    color: #92400E;
    font-weight: 500;
}


/* ==========================================================================
   TOAST NOTIFICATIONS
   ========================================================================== */

.abc-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    max-width: 320px;
    padding: 14px 20px;
    background: var(--abc-bg);
    border-radius: var(--abc-radius-sm);
    box-shadow: var(--abc-shadow-lg);
    z-index: 100000;
    display: flex;
    align-items: center;
    gap: 12px;
    transform: translateX(120%);
    transition: transform 0.3s ease;
}

.abc-toast.show {
    transform: translateX(0);
}

.abc-toast--success { border-left: 4px solid var(--abc-success); }
.abc-toast--error { border-left: 4px solid var(--abc-danger); }

.abc-toast__icon {
    font-size: 20px;
    flex-shrink: 0;
}

.abc-toast__message {
    font-size: 14px;
    color: var(--abc-text);
    line-height: 1.4;
}

.abc-toast__close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: var(--abc-text-muted);
    margin-left: auto;
}

.abc-toast__close:hover { color: var(--abc-text); }


/* ==========================================================================
   CHECKOUT NOTICE
   ========================================================================== */

.abc-checkout-notice {
    display: flex;
    align-items: center;
    gap: 10px;
}


/* ==========================================================================
   DARK MODE SUPPORT
   ========================================================================== */

html[data-theme="dark"] {
    --abc-text: #F9FAFB;
    --abc-text-muted: #9CA3AF;
    --abc-border: #374151;
    --abc-bg: #1F2937;
    --abc-bg-light: #374151;
}

html[data-theme="dark"] .abc-gifts {
    background: linear-gradient(135deg, #78350F, #92400E);
    border-color: #B45309;
}

html[data-theme="dark"] .abc-gifts__title,
html[data-theme="dark"] .abc-gifts__subtitle {
    color: #FDE68A;
}

html[data-theme="dark"] .abc-gifts__subtitle strong { color: #FCD34D; }
html[data-theme="dark"] .abc-gifts__count { background: rgba(251,191,36,0.2); color: #FDE68A; }

html[data-theme="dark"] .abc-gifts__track {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.15);
}

html[data-theme="dark"] .abc-gifts__ms {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.1);
}

html[data-theme="dark"] .abc-gifts__ms--earned { background: rgba(16,185,129,0.15); border-color: #065F46; }
html[data-theme="dark"] .abc-gifts__ms--earned .abc-gifts__ms-amount { color: #6EE7B7; }
html[data-theme="dark"] .abc-gifts__ms--earned .abc-gifts__ms-name { color: #6EE7B7; }

html[data-theme="dark"] .abc-gifts__ms--next { background: rgba(251,191,36,0.15); border-color: #92400E; }
html[data-theme="dark"] .abc-gifts__ms--next .abc-gifts__ms-amount { color: #FDE68A; }
html[data-theme="dark"] .abc-gifts__ms--next .abc-gifts__ms-name { color: #FCD34D; }

html[data-theme="dark"] .abc-gifts__ms--locked .abc-gifts__ms-amount { color: #6B7280; }
html[data-theme="dark"] .abc-gifts__ms--locked .abc-gifts__ms-name { color: #4B5563; }
html[data-theme="dark"] .abc-gifts__ms--locked .abc-gifts__ms-check { background: #374151; color: #6B7280; }

html[data-theme="dark"] .abc-xsell,
html[data-theme="dark"] .abc-drawer {
    background: #1F2937;
    border-color: #374151;
}

html[data-theme="dark"] .abc-xsell__card {
    background: #374151;
    border-color: #4B5563;
}

html[data-theme="dark"] .abc-xsell__btn--link {
    background: #4B5563;
    border-color: #6B7280;
}

html[data-theme="dark"] .abc-drawer__footer {
    background: #374151;
}

html[data-theme="dark"] .abc-foot__ship-ok {
    background: #064E3B;
    border-color: #10B981;
    color: #6EE7B7;
}

html[data-theme="dark"] .abc-foot__ship {
    background: #78350F;
    border-color: #B45309;
}

html[data-theme="dark"] .abc-foot__ship-info { color: #FDE68A; }

html[data-theme="dark"] .abc-foot__pricing {
    background: linear-gradient(135deg, #1A2726 0%, #1C2E2A 100%) !important;
    border-color: rgba(20, 184, 166, 0.2) !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}
html[data-theme="dark"] .abc-foot__row--sub { color: #9CA3AF !important; }
html[data-theme="dark"] .abc-foot__row--discount { color: #6EE7B7 !important; }
html[data-theme="dark"] .abc-foot__row--total { color: #F3F4F6 !important; border-top-color: rgba(20, 184, 166, 0.2) !important; }
html[data-theme="dark"] .abc-foot__row--total span:last-child { color: #14B8A6 !important; }

html[data-theme="dark"] .abc-drawer__close {
    background: #374151;
}

html[data-theme="dark"] .abc-drawer__close:hover {
    background: #4B5563;
}

html[data-theme="dark"] .abc-drawer__item:hover {
    background: #374151;
}

html[data-theme="dark"] .abc-drawer__item--gift {
    background: linear-gradient(135deg, #022C22, #064E3B);
    border-color: #10B981;
    box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.15), 0 2px 8px rgba(0, 0, 0, 0.3);
}

html[data-theme="dark"] .abc-drawer__item--gift::before {
    background: linear-gradient(90deg, #059669, #10B981, #34D399, #10B981, #059669);
}

html[data-theme="dark"] .abc-drawer__item-gift-badge {
    background: linear-gradient(135deg, #065F46, #064E3B);
    color: #6EE7B7;
    border-color: #10B981;
}

html[data-theme="dark"] .abc-drawer__item-price--free {
    color: #6EE7B7 !important;
}

html[data-theme="dark"] .abc-drawer__btn--secondary {
    background: #374151;
    border-color: #4B5563;
}

html[data-theme="dark"] .abc-mini-notice {
    background: #78350F;
    color: #FDE68A;
}

html[data-theme="dark"] .abc-toast {
    background: #374151;
}


/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 479px) {
    .abc-gifts,
    .abc-xsell {
        padding: 12px;
    }
    
    .abc-gifts__title,
    .abc-xsell__title {
        font-size: 12px;
    }
    
    .abc-gifts__dot {
        width: 18px;
        height: 18px;
    }
    
    .abc-xsell__btn {
        padding: 10px 12px;
        font-size: 12px;
    }
    
    .abc-drawer {
        max-width: 100%;
    }
    
    .abc-drawer__header,
    .abc-drawer__item,
    .abc-drawer__footer {
        padding-left: 16px;
        padding-right: 16px;
    }
    
    .abc-drawer__actions {
        flex-direction: column;
    }
    
    .abc-toast {
        left: 16px;
        right: 16px;
        max-width: none;
        bottom: 16px;
    }
}

