/* ============================================================
   Kadence Float Cart — Front CSS v1.1.0
============================================================ */

/* ---- إخفاء زر السلة الأصلي في الهيدر بالكامل ---- */
.header-cart-button.kadence-svg-iconset {
    display: none !important;
}

/* ---- FAB المستقل — نضيفه بـ JS على الـ body مباشرة ---- */
#kfc-fab {
    position: fixed;
    z-index: 9990;
    bottom: 24px;
    right: 24px;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: var(--kfc-accent, #111827);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(0,0,0,.3);
    cursor: pointer;
    border: none;
    outline: none;
    transition: transform .2s, box-shadow .2s;
    font-family: inherit;
}

#kfc-fab.kfc-pos-left {
    right: auto;
    left: 24px;
}

#kfc-fab:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 28px rgba(0,0,0,.4);
}

#kfc-fab svg {
    width: 24px;
    height: 24px;
    stroke: #fff;
    fill: none;
}

/* Badge */
#kfc-fab-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    background: #ef4444;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    border-radius: 10px;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    line-height: 1;
    pointer-events: none;
    border: 2px solid #fff;
    font-family: 'Cairo', sans-serif;
}
#kfc-fab-badge.visible {
    display: flex;
}

/* ---- BACKDROP ---- */
#kfc-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 9991;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}
#kfc-backdrop.active { display: block; }

/* ---- DRAWER ---- */
#kfc-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 380px;
    max-width: 96vw;
    z-index: 9992;
    background: #fff;
    border-radius: var(--kfc-radius, 20px) 0 0 var(--kfc-radius, 20px);
    box-shadow: -8px 0 40px rgba(0,0,0,.15);
    transform: translateX(105%);
    transition: transform .35s cubic-bezier(.4,0,.2,1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-family: 'Cairo','Tajawal',sans-serif;
    direction: rtl;
}
#kfc-drawer[data-pos="bottom-left"] {
    right: auto;
    left: 0;
    border-radius: 0 var(--kfc-radius, 20px) var(--kfc-radius, 20px) 0;
    transform: translateX(-105%);
}
#kfc-drawer.open { transform: translateX(0) !important; }

/* ---- HEADER ---- */
.kfc-hdr {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    background: var(--kfc-accent, #111827);
    color: #fff;
    flex-shrink: 0;
}
.kfc-hdr-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 700;
}
.kfc-hdr-count {
    background: rgba(255,255,255,.2);
    border-radius: 20px;
    padding: 2px 9px;
    font-size: 13px;
    font-weight: 600;
}
.kfc-close {
    background: rgba(255,255,255,.15);
    border: none;
    color: #fff;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .2s;
}
.kfc-close:hover { background: rgba(255,255,255,.25); }

/* ---- SHIPPING BAR ---- */
.kfc-ship-bar {
    padding: 10px 16px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}
.kfc-ship-text { font-size: 12px; color: #475569; margin-bottom: 6px; }
.kfc-ship-track { background: #e2e8f0; border-radius: 6px; height: 6px; overflow: hidden; }
.kfc-ship-fill  { height: 100%; background: var(--kfc-accent, #111827); border-radius: 6px; transition: width .4s; }

/* ---- ITEMS ---- */
.kfc-items {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    scroll-behavior: smooth;
}
.kfc-items::-webkit-scrollbar { width: 4px; }
.kfc-items::-webkit-scrollbar-track { background: transparent; }
.kfc-items::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }

/* ---- SINGLE ITEM ---- */
.kfc-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 12px;
    border-radius: 12px;
    background: #f8fafc;
    margin-bottom: 8px;
    transition: opacity .25s, transform .25s;
    position: relative;
}
.kfc-item.removing { opacity: 0; transform: translateX(20px); }

.kfc-item-img {
    width: 64px;
    height: 64px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    background: #e2e8f0;
}
.kfc-item-body { flex: 1; min-width: 0; }
.kfc-item-name {
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
    text-decoration: none;
    display: block;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.kfc-item-name:hover { color: var(--kfc-accent, #111827); }

.kfc-item-price-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}
.kfc-price-main      { font-size: 15px; font-weight: 700; color: var(--kfc-accent, #111827); }
.kfc-price-converted { font-size: 15px; font-weight: 700; color: var(--kfc-accent, #111827); }
.kfc-price-original  { font-size: 11px; color: #94a3b8; text-decoration: line-through; }
.kfc-price-regular   { font-size: 11px; color: #94a3b8; text-decoration: line-through; }
.kfc-sale-badge      { background: #ef4444; color: #fff; font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 5px; }

/* QTY */
.kfc-qty {
    display: inline-flex;
    align-items: center;
    background: #fff;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
}
.kfc-qty-btn {
    width: 30px; height: 28px;
    background: none; border: none;
    cursor: pointer; font-size: 16px; color: #475569;
    display: flex; align-items: center; justify-content: center;
    transition: background .15s;
}
.kfc-qty-btn:hover { background: #f1f5f9; }
.kfc-qty-num {
    min-width: 28px; text-align: center;
    font-size: 13px; font-weight: 600; color: #1e293b;
    border-right: 1.5px solid #e2e8f0;
    border-left: 1.5px solid #e2e8f0;
    height: 28px; line-height: 28px;
}

/* Delete — أحمر دايماً */
.kfc-item-del {
    background: #fee2e2;
    border: none;
    color: #ef4444;
    cursor: pointer;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
    font-size: 14px;
    font-weight: 700;
    transition: background .15s, transform .15s;
    line-height: 1;
}
.kfc-item-del:hover { background: #fca5a5; transform: scale(1.1); }

/* ---- EMPTY STATE ---- */
.kfc-empty { text-align: center; padding: 48px 20px; }
.kfc-empty-icon  { font-size: 48px; margin-bottom: 12px; }
.kfc-empty-title { font-size: 16px; font-weight: 700; color: #1e293b; margin: 0 0 6px; }
.kfc-empty-sub   { font-size: 13px; color: #64748b; margin: 0 0 20px; }
.kfc-empty-shop  {
    display: inline-block; padding: 10px 24px;
    background: var(--kfc-accent, #111827); color: #fff;
    border-radius: 8px; text-decoration: none;
    font-size: 14px; font-weight: 600;
}

/* ---- LOADING ---- */
.kfc-loading { display: flex; justify-content: center; padding: 40px; }
.kfc-spinner {
    width: 30px; height: 30px;
    border: 3px solid #e2e8f0;
    border-top-color: var(--kfc-accent, #111827);
    border-radius: 50%;
    animation: kfc-spin .7s linear infinite;
}
@keyframes kfc-spin { to { transform: rotate(360deg); } }

/* ---- FOOTER ---- */
.kfc-footer {
    border-top: 1px solid #e2e8f0;
    padding: 16px;
    background: #fff;
    flex-shrink: 0;
}
.kfc-subtotal-row {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 14px;
}
.kfc-subtotal-label { font-size: 14px; color: #475569; font-weight: 500; }
.kfc-subtotal-val   { font-size: 18px; font-weight: 700; color: #1e293b; text-align: left; }
.kfc-subtotal-val .kfc-price-converted { font-size: 18px; display: block; }
.kfc-subtotal-val .kfc-price-original  { font-size: 12px; display: block; text-decoration: none; color: #94a3b8; }

.kfc-btn-checkout {
    display: block; background: var(--kfc-accent, #111827); color: #fff;
    text-align: center; padding: 13px; border-radius: 10px;
    text-decoration: none; font-size: 15px; font-weight: 700;
    margin-bottom: 8px; transition: opacity .2s;
}
.kfc-btn-checkout:hover { opacity: .88; color: #fff; }
/* kfc-btn-cart removed */

/* ---- TOAST ---- */
.kfc-toast {
    position: fixed; bottom: 100px; right: 20px;
    background: #1e293b; color: #fff; padding: 12px 18px;
    border-radius: 10px; font-size: 14px;
    display: flex; align-items: center; gap: 8px;
    z-index: 99999; box-shadow: 0 4px 20px rgba(0,0,0,.2);
    animation: kfc-toast-in .3s ease;
    direction: rtl; font-family: 'Cairo','Tajawal',sans-serif;
}
.kfc-toast.out { animation: kfc-toast-out .3s ease forwards; }
@keyframes kfc-toast-in  { from { opacity:0; transform:translateY(10px); } to { opacity:1; transform:none; } }
@keyframes kfc-toast-out { to   { opacity:0; transform:translateY(10px); } }

/* ---- RESPONSIVE ---- */
@media (max-width: 480px) {
    #kfc-drawer { width: 100vw; max-width: 100vw; border-radius: 0; }
    #kfc-fab { bottom: 16px; right: 16px; }
    #kfc-fab.kfc-pos-left { right: auto; left: 16px; }
}
