/* =====================================================================
   ZECERO – Koszyk Boczny  |  zecero-cart.css
   ===================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600;700&family=Montserrat:wght@400;500;600;700&display=swap');

/* ─── VARIABLES (Dostosowane do Zecero) ─── */
:root {
    --zec-accent:   #a68a56;
    --zec-accent-h: #8c7345;
    --zec-dark:     #050505;
    --zec-mid:      #333333;
    --zec-text:     #050505;
    --zec-muted:    #666666;
    --zec-border:   #ededed;
    --zec-bg:       #f9f9f9;
    --zec-white:    #ffffff;
    --zec-red:      #c0392b;
    --zec-w:        400px;
    --zec-radius:   0px; /* Zecero ma kanciaste formy */
    --zec-z:        99990;
    --zec-font-b:   'Montserrat', sans-serif;
    --zec-font-h:   'Playfair Display', serif;
}

/* ─── RESET ─── */
.zec-drawer *,
.zec-drawer *::before,
.zec-drawer *::after { box-sizing: border-box; }
.zec-drawer { font-family: var(--zec-font-b); }
.zec-drawer a { text-decoration: none; color: inherit; }
.zec-drawer button {
    appearance: none; -webkit-appearance: none;
    background-image: none; text-shadow: none;
    cursor: pointer;
}

/* ─── OVERLAY ─── */
.zec-overlay {
    display: none;
    position: fixed; inset: 0;
    z-index: calc(var(--zec-z) - 1);
    background: rgba(5,5,5,.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity .3s ease;
}
.zec-overlay.visible { display: block; }
.zec-overlay.open    { opacity: 1; }

/* ─── DRAWER ─── */
.zec-drawer {
    position: fixed;
    top: 0; right: 0; bottom: 0;
    width: var(--zec-w);
    max-width: 100vw;
    z-index: var(--zec-z);
    background: var(--zec-white);
    box-shadow: -4px 0 32px rgba(5,5,5,.1);
    display: flex; flex-direction: column;
    transform: translateX(100%);
    transition: transform .35s cubic-bezier(.32,.72,0,1);
    will-change: transform;
}
.zec-drawer.open { transform: translateX(0); }

/* ─── HEADER ─── */
.zec-hdr {
    display: flex; align-items: center; justify-content: space-between;
    padding: 24px 24px 20px;
    border-bottom: 1px solid var(--zec-border);
    flex-shrink: 0;
    background: var(--zec-white);
}

.zec-hdr-left { display: flex; align-items: center; gap: 10px; }

.zec-hdr-icon {
    display: flex; align-items: center; color: var(--zec-dark);
    width: 24px; height: 24px; flex-shrink: 0;
}
.zec-hdr-icon svg { width: 24px; height: 24px; pointer-events: none; }

.zec-hdr-title {
    font-family: var(--zec-font-h);
    font-weight: 700; font-size: 18px; color: var(--zec-dark);
    letter-spacing: 0.5px;
}

.zec-count-badge {
    min-width: 24px; height: 24px;
    display: flex; align-items: center; justify-content: center;
    background: var(--zec-accent); color: #fff;
    border-radius: 12px;
    font-family: var(--zec-font-b);
    font-weight: 700; font-size: 12px;
    padding: 0 6px;
    margin-left: 5px;
}

/* Close button */
.zec-close {
    width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    background: var(--zec-bg) !important; 
    border: none !important; border-radius: 50%;
    color: var(--zec-dark) !important;
    transition: background .15s, color .15s, transform .15s;
    flex-shrink: 0;
    padding: 0 !important;
}
.zec-close:hover { 
    background: var(--zec-accent) !important; 
    color: var(--zec-white) !important; 
    transform: rotate(90deg);
}
.zec-close svg { width: 20px; height: 20px; pointer-events: none; }

/* ─── ITEMS SCROLL AREA ─── */
.zec-items {
    flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: 10px 0;
    scrollbar-width: thin;
    scrollbar-color: var(--zec-border) transparent;
}
.zec-items::-webkit-scrollbar { width: 4px; }
.zec-items::-webkit-scrollbar-thumb { background: var(--zec-accent); }

/* ─── SINGLE ITEM ─── */
.zec-item {
    display: flex; gap: 15px; align-items: flex-start;
    padding: 20px 24px;
    border-bottom: 1px solid var(--zec-border);
    position: relative;
    transition: background .15s;
}
.zec-item:hover { background: var(--zec-bg); }
.zec-item:last-child { border-bottom: none; }

/* Thumbnail */
.zec-item-img-w {
    width: 85px; height: 85px; flex-shrink: 0;
    border-radius: var(--zec-radius); overflow: hidden;
    border: 1px solid var(--zec-border); background: var(--zec-bg);
}
.zec-item-img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Body */
.zec-item-body { flex: 1; min-width: 0; }

.zec-item-name {
    display: block;
    font-family: var(--zec-font-b);
    font-size: 14px; font-weight: 600; color: var(--zec-dark);
    line-height: 1.4; margin-bottom: 6px;
    display: -webkit-box; -webkit-line-clamp: 2;
    -webkit-box-orient: vertical; overflow: hidden;
    transition: color .2s;
}
.zec-item-name:hover { color: var(--zec-accent); }

.zec-item-meta {
    display: block;
    font-family: var(--zec-font-b);
    font-size: 12px; color: var(--zec-muted);
    margin-bottom: 8px; line-height: 1.4;
}

/* Qty + price row */
.zec-item-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; }

/* Qty stepper */
.zec-qty-ctrl {
    display: flex; align-items: center; gap: 0;
    border: 1px solid var(--zec-border) !important; 
    border-radius: var(--zec-radius) !important;
    overflow: hidden;
    background-color: var(--zec-white) !important;
}

.zec-qm, .zec-qp {
    width: 30px; height: 30px;
    background-color: var(--zec-bg) !important; 
    border: none !important;
    font-size: 18px !important; font-weight: 400 !important; 
    color: var(--zec-dark) !important;
    display: flex; align-items: center; justify-content: center;
    line-height: 1; transition: background .15s, color .15s;
    padding: 0 !important; margin: 0 !important;
}
.zec-qm:hover, .zec-qp:hover { 
    background-color: var(--zec-accent) !important; 
    color: var(--zec-white) !important; 
}

.zec-qty-num {
    min-width: 32px; padding: 0 6px; height: 30px;
    display: flex; align-items: center; justify-content: center;
    font-family: var(--zec-font-b); font-size: 13px; font-weight: 600;
    color: var(--zec-dark) !important;
    background-color: var(--zec-white) !important; 
    border-left: 1px solid var(--zec-border) !important; 
    border-right: 1px solid var(--zec-border) !important;
    user-select: none;
}

.zec-item-price {
    font-family: var(--zec-font-b);
    font-weight: 700; font-size: 15px; color: var(--zec-accent);
    white-space: nowrap;
}

/* Remove button */
.zec-rm {
    position: absolute; top: 16px; right: 20px;
    width: 28px; height: 28px;
    background-color: transparent !important; 
    border: none !important;
    color: var(--zec-muted) !important;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50% !important; transition: background .15s, color .15s;
    padding: 0 !important; flex-shrink: 0;
}
.zec-rm:hover { 
    background-color: #FFE8E8 !important; 
    color: var(--zec-red) !important; 
}
.zec-rm svg { width: 14px; height: 14px; pointer-events: none; }

/* ─── EMPTY STATE ─── */
.zec-empty {
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 20px; padding: 60px 24px;
    text-align: center; height: 100%;
}
.zec-empty svg { width: 80px; height: 80px; opacity: .8; }
.zec-empty p {
    font-family: var(--zec-font-b);
    font-size: 16px; font-weight: 500; color: var(--zec-muted); margin: 0;
}
.zec-shop-link {
    font-family: var(--zec-font-b);
    font-size: 14px; font-weight: 600; color: var(--zec-accent);
    text-transform: uppercase; letter-spacing: 1px;
    border-bottom: 1px solid var(--zec-accent);
    padding-bottom: 2px;
}
.zec-shop-link:hover { color: var(--zec-accent-h); border-color: var(--zec-accent-h); }

/* ─── LOADING SKELETON ─── */
.zec-item.is-loading { opacity: .5; pointer-events: none; filter: grayscale(100%); }

/* ─── FOOTER ─── */
.zec-footer {
    flex-shrink: 0;
    border-top: 1px solid var(--zec-border);
    padding: 24px 24px 20px;
    background: var(--zec-white);
    padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
}

.zec-subtotal-row {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 20px;
}
.zec-subtotal-lbl {
    font-family: var(--zec-font-b); font-size: 15px; font-weight: 500; color: var(--zec-muted);
}
.zec-subtotal-val {
    font-family: var(--zec-font-b); font-weight: 700; font-size: 20px; color: var(--zec-dark);
}

/* Checkout CTA */
.zec-checkout-btn {
    display: flex; align-items: center; justify-content: center;
    width: 100%; height: 56px;
    background-color: var(--zec-dark) !important; 
    color: var(--zec-white) !important;
    border-radius: var(--zec-radius) !important;
    border: none !important;
    font-family: var(--zec-font-b) !important; 
    font-weight: 700 !important; font-size: 15px !important;
    text-transform: uppercase; letter-spacing: 1px;
    text-decoration: none !important;
    transition: background .2s, transform .1s;
    margin-bottom: 15px !important;
    padding: 0 !important;
}
.zec-checkout-btn:hover { 
    background-color: var(--zec-accent) !important; 
}
.zec-checkout-btn:active { transform: scale(.98); }

/* View cart link */
.zec-cart-link {
    display: block; text-align: center;
    font-family: var(--zec-font-b); font-size: 13px; font-weight: 600;
    color: var(--zec-muted) !important;
    text-decoration: underline !important;
    transition: color .15s;
}
.zec-cart-link:hover { color: var(--zec-dark) !important; }

/* ─── MOBILE ─── */
@media (max-width: 480px) {
    :root { --zec-w: 100vw; }
    .zec-hdr { padding: 18px 20px; }
    .zec-item { padding: 15px 20px; }
    .zec-footer { padding: 20px; }
}

/* ─── ANIMATIONS ─── */
@keyframes zec-fade-in {
    from { opacity: 0; transform: translateX(12px); }
    to   { opacity: 1; transform: translateX(0); }
}
.zec-item { animation: zec-fade-in .2s ease both; }
.zec-item:nth-child(1) { animation-delay: .04s; }
.zec-item:nth-child(2) { animation-delay: .07s; }
.zec-item:nth-child(3) { animation-delay: .10s; }
.zec-item:nth-child(4) { animation-delay: .13s; }

/* ─── UPSELLS / RECOMMENDATIONS ─── */
.zec-upsells {
    background: #fdfdfd;
    border-top: 1px solid var(--zec-border);
    padding: 20px 24px;
    margin-top: 10px;
}

.zec-upsells-title {
    font-family: var(--zec-font-h);
    font-size: 15px;
    font-weight: 700;
    color: var(--zec-dark);
    margin: 0 0 15px 0;
}

.zec-upsells-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.zec-upsell-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--zec-white);
    border: 1px solid var(--zec-border);
    padding: 10px;
    border-radius: var(--zec-radius);
    transition: box-shadow .2s, border-color .2s;
}
.zec-upsell-item:hover {
    border-color: #e0e0e0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
}

.zec-upsell-img {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    background: var(--zec-bg);
    border-radius: var(--zec-radius);
    overflow: hidden;
}
.zec-upsell-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.zec-upsell-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.zec-upsell-name {
    font-family: var(--zec-font-b);
    font-size: 12px;
    font-weight: 600;
    color: var(--zec-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 3px;
    transition: color .2s;
}
.zec-upsell-name:hover {
    color: var(--zec-accent);
}

.zec-upsell-price {
    font-family: var(--zec-font-b);
    font-size: 13px;
    font-weight: 700;
    color: var(--zec-accent);
}
.zec-upsell-price del {
    color: var(--zec-muted);
    font-weight: 400;
    font-size: 11px;
    margin-right: 4px;
}

/* Przycisk dodawania + */
.zec-upsell-add-btn {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    background: var(--zec-bg);
    border: 1px solid var(--zec-border);
    color: var(--zec-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all .2s;
    cursor: pointer;
    text-decoration: none !important;
}
.zec-upsell-add-btn:hover {
    background: var(--zec-accent);
    color: var(--zec-white);
    border-color: var(--zec-accent);
    transform: scale(1.05);
}
.zec-upsell-add-btn:active {
    transform: scale(0.95);
}