/* =====================================================
   GLOBAL VARIABLES & RESET
===================================================== */
:root {
    --kds-bg: #f8fafc;
    --kds-white: #ffffff;
    --kds-primary: #4f46e5;      /* Indigo */
    --kds-primary-hover: #4338ca;
    --kds-text-dark: #0f172a;
    --kds-text-gray: #64748b;
    --kds-border: #e2e8f0;
    --kds-price-gold: #d97706;   
    --kds-green-bg: #dcfce7;
    --kds-green-text: #166534;
    --bz-gold: #d4af37;
    --bz-gold-grad: linear-gradient(135deg, #d4af37 0%, #f3d87e 100%);
    --font-main: 'Outfit', sans-serif;
    
    /* Dodatkowe zmienne z innych fragmentów */
    --kds-accent: #443395;
    --kds-accent-hover: #e04050;
}

*, *::before, *::after { box-sizing: border-box; }

/* =====================================================
   1. GLOBAL MINI CART (SLIDING SIDEBAR)
   ===================================================== */

/* Overlay (Background) */
#bz-mini-cart-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(4px);
    z-index: 99998;
    opacity: 0; visibility: hidden;
    transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}
#bz-mini-cart-overlay.active { opacity: 1; visibility: visible; }

/* Sidebar Container */
#bz-mini-cart {
    position: fixed; top: 0; right: -480px; /* Hidden by default */
    width: 480px; max-width: 100vw; height: 100%;
    background: #fff;
    z-index: 99999;
    box-shadow: -10px 0 40px rgba(0,0,0,0.1);
    transition: right 0.5s cubic-bezier(0.25, 1, 0.5, 1);
    padding: 0 !important; display: block !important;
}
#bz-mini-cart.open { right: 0; } /* Slide in */

/* WooCommerce Inner Container Fix */
#bz-mini-cart .widget_shopping_cart_content {
    height: 100%; display: flex; flex-direction: column;
}

/* Hide Default Widget Elements (Cleanup) */
#bz-mini-cart .widgettitle, 
#bz-mini-cart .widget-title,
#bz-mini-cart h2:not(.m-title),
#bz-mini-cart h3:not(.m-title),
.bz-mini-cart-header,
#bz-mini-cart .close-cart,
#bz-mini-cart .close-side-widget {
    display: none !important;
}

/* =====================================================
   2. MINI CART TEMPLATE STYLES (Modern)
   ===================================================== */

/* Main Wrapper */
.modern-cart-wrapper {
    display: flex; flex-direction: column; flex: 1;
    height: 100%; min-height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #1d1d1f; background: #fff;
}

/* Header */
.modern-cart-header {
    padding: 25px 30px;
    display: flex; justify-content: space-between; align-items: center;
    border-bottom: 1px solid #f5f5f5;
    background: #fff; flex-shrink: 0;
}
.header-left { display: flex; align-items: center; gap: 10px; }
.m-title { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; margin: 0; }
.m-count {
    background: #1d1d1f; color: #fff; font-size: 12px; font-weight: 600;
    padding: 2px 8px; border-radius: 5px;
}
.m-close-btn {
    background: none; border: none; font-size: 28px; line-height: 1;
    color: #888; cursor: pointer; padding: 0; transition: color 0.2s;
}
.m-close-btn:hover { color: #000; }

/* Body (Product List) */
.modern-cart-body {
    flex: 1;
    overflow-y: auto; padding: 0; position: relative;
    height: auto; max-height: none;
}
.modern-cart-body::-webkit-scrollbar { width: 6px; }
.modern-cart-body::-webkit-scrollbar-track { background: #fff; }
.modern-cart-body::-webkit-scrollbar-thumb { background: #e0e0e0; border-radius: 3px; }

ul.woocommerce-mini-cart { margin: 0; padding: 0; list-style: none; }

li.modern-cart-item {
    display: flex; gap: 20px; padding: 25px 30px;
    border-bottom: 1px solid #f5f5f5;
}

.m-item-image img {
    width: 90px; height: 110px; object-fit: cover;
    border-radius: 4px; background: #f9f9f9; display: block;
}

.m-item-details { flex: 1; display: flex; flex-direction: column; min-height: 110px; }

.m-item-top {
    display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 5px;
}
.m-product-name {
    font-size: 15px; font-weight: 600; color: #1d1d1f;
    text-decoration: none; line-height: 1.4; padding-right: 15px;
}
.m-remove {
    color: #ccc; transition: color 0.2s; display: flex; align-items: center;
}
.m-remove:hover { color: #d32f2f; }

.m-item-meta {
    font-size: 13px; color: #666; margin-bottom: auto; line-height: 1.5;
}
.m-item-meta dl.variation { border: none; margin: 0; display: block; }
.m-item-meta dt { font-weight: normal; float: none; display: inline; margin: 0; }
.m-item-meta dd { font-weight: 500; float: none; display: inline; margin: 0 5px 0 0; color: #333; }
.m-item-meta p { margin: 0; }

.m-item-bottom {
    display: flex; justify-content: space-between; align-items: flex-end; margin-top: 10px;
}
.m-qty { font-size: 13px; color: #86868b; }
.m-price { font-size: 16px; font-weight: 700; color: #1d1d1f; }

/* Footer */
.modern-cart-footer {
    padding: 30px; background: #fff;
    border-top: 1px solid #f0f0f0;
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.02);
    margin-top: auto; flex-shrink: 0; z-index: 10;
}

.m-total-row {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 20px; font-size: 16px; color: #1d1d1f;
}
.m-total-row .value { font-size: 20px; font-weight: 700; }

.m-buttons-stack { display: flex; flex-direction: column; gap: 12px; }

.modern-checkout-btn {
    display: flex; justify-content: center; align-items: center;
    width: 100%; height: 50px;
    background: #1d1d1f !important; color: #fff !important;
    border: none; border-radius: 6px;
    font-size: 15px; font-weight: 600; text-transform: none;
    text-decoration: none; cursor: pointer; transition: background 0.2s;
}
.modern-checkout-btn:hover { background: #333 !important; }

.modern-view-cart-link {
    text-align: center; font-size: 14px; color: #666;
    text-decoration: underline; padding: 5px;
}
.modern-view-cart-link:hover { color: #000; }

/* Free Shipping Bar */
.m-free-shipping-wrapper {
    margin: 10px 0 25px 0;
    position: relative;
    text-align: center;
}
.m-fs-bar-container {
    position: relative;
    height: 25px;
    margin-bottom: 12px;
}
.m-fs-bar-bg {
    width: 100%; height: 6px;
    background: #eadcdb;
    border-radius: 3px;
    position: absolute; top: 50%; left: 0;
    transform: translateY(-50%);
    z-index: 1;
}
.m-fs-bar-fill {
    height: 100%;
    background: #b08d55;
    border-radius: 3px;
    transition: width 0.4s ease;
}
.m-fs-percentage-bubble {
    position: absolute; top: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    padding: 0 5px;
    font-size: 14px; font-weight: 700; color: #333;
    z-index: 2; line-height: 1;
    white-space: nowrap;
}
.m-fs-text {
    font-size: 13px; color: #444; line-height: 1.5; margin: 0;
}
.m-fs-text strong { color: #111; font-weight: 700; }
.m-fs-success { color: #2e7d32; font-weight: 700; font-size: 14px; }

/* Empty Cart */
.modern-cart-empty {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    height: 100%; color: #86868b; text-align: center; padding: 40px;
}
.empty-icon { margin-bottom: 20px; }

/* Responsive Mini Cart */
@media (max-width: 500px) {
    #bz-mini-cart { width: 100%; right: -100%; }
    .modern-cart-header, li.modern-cart-item, .modern-cart-footer { padding: 20px; }
    .m-item-image img { width: 70px; height: 90px; }
}

/* =====================================================
   3. LICENSE PLANS & INPUTS (FROM PLUGIN)
   ===================================================== */

/* License Input Box */
.bz-license-data-box { 
    background: var(--kds-white); border: 1px solid var(--kds-border); 
    border-radius: 16px; padding: 25px; margin-bottom: 30px; transition: 0.3s; 
}
.bz-license-data-box:focus-within { border-color: var(--kds-primary); ring: 2px solid #e0e7ff; }
.bz-lic-title { font-size: 14px; font-weight: 700; color: var(--kds-text-dark); margin-bottom: 15px; display: block; text-transform: uppercase; letter-spacing: 0.5px; }
.bz-input-group { position: relative; margin-bottom: 15px; }
.bz-input-group i { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--kds-text-gray); font-size: 20px; }
.bz-input-field { 
    width: 100%; padding: 14px 14px 14px 45px; 
    border: 1px solid var(--kds-border); border-radius: 10px; 
    font-size: 15px; font-family: var(--font-main); color: var(--kds-text-dark); 
    background: #fdfdfd; transition: 0.2s; 
}
.bz-input-field:focus { outline: none; border-color: var(--kds-primary); background: #fff; }
.bz-input-field.bz-input-error { border-color: #ef4444 !important; background: #fef2f2 !important; animation: shake 0.4s; }

@keyframes shake {
  10%, 90% { transform: translate3d(-1px, 0, 0); }
  20%, 80% { transform: translate3d(2px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
  40%, 60% { transform: translate3d(4px, 0, 0); }
}

/* Plan Grid */
.bz-license-section { padding: 60px 0; background: var(--kds-white); border-top: 1px solid var(--kds-border); margin-top: 40px; }
.bz-license-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; margin-top: 40px; }

/* Plan Card */
.bz-lic-card { 
    background: var(--kds-white); padding: 30px; 
    border-radius: 20px; border: 1px solid var(--kds-border); 
    cursor: pointer; transition: 0.3s; position: relative; display: flex; flex-direction: column; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.03);
}
.bz-lic-card:hover { transform: translateY(-6px); border-color: var(--kds-primary); box-shadow: 0 20px 40px -10px rgba(0,0,0,0.08); }
.bz-lic-card.best { 
    border: 2px solid var(--kds-primary); transform: scale(1.02); 
    box-shadow: 0 20px 50px -10px rgba(79, 70, 229, 0.15); z-index: 2; 
}
.bz-lic-card.best::after { 
    content: 'Polecany'; position: absolute; top: -12px; left: 50%; transform: translateX(-50%); 
    background: var(--kds-primary); color: #fff; padding: 4px 12px; border-radius: 20px; 
    font-size: 11px; font-weight: 700; text-transform: uppercase; 
}

/* Plan Card Typography */
.bz-lic-name { font-size: 20px; font-weight: 800; color: var(--kds-text-dark); margin-bottom: 5px; }
.bz-lic-subtitle { font-size: 12px; text-transform: uppercase; color: var(--kds-text-gray); font-weight: 700; margin: 5px 0; letter-spacing: 0.5px; }
.bz-lic-price { font-size: 26px; font-weight: 800; color: var(--kds-primary); margin: 15px 0; }

/* Plan Features */
.bz-lic-features { margin: 15px 0 25px; border-top: 1px solid var(--kds-border); padding-top: 15px; flex-grow: 1; text-align: left; }
.bz-lic-features ul { list-style: none; padding: 0; margin: 0; }
.bz-lic-features li { font-size: 14px; color: var(--kds-text-gray); margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.bz-lic-features li i { color: var(--kds-primary); font-size: 16px; }

/* Gold Button Style */
.bz-gold-btn {
    width: 100%; padding: 14px;
    background: var(--bz-gold-grad);
    color: #fff; border: none; border-radius: 8px;
    font-size: 16px; font-weight: 700; cursor: pointer;
    transition: 0.3s; margin-top: auto;
    box-shadow: 0 5px 15px rgba(212, 175, 55, 0.2);
}
.bz-gold-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 25px rgba(212, 175, 55, 0.35); }

/* =====================================================
   4. TOAST NOTIFICATIONS (POP-UPS)
   ===================================================== */
.bz-toast {
    position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%);
    background: #111; color: #fff;
    padding: 14px 28px; border-radius: 50px;
    z-index: 9999999;
    opacity: 0; transition: 0.4s;
    pointer-events: none; font-weight: 600;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}
.bz-toast.visible { opacity: 1; transform: translateX(-50%) translateY(-10px); }

/* =====================================================
   5. BUTTON EFFECTS (MIRROR SHINE)
   ===================================================== */
.woocommerce:where(body:not(.woocommerce-block-theme-has-button-styles)) a.button.alt, 
.woocommerce:where(body:not(.woocommerce-block-theme-has-button-styles)) button.button.alt,
.bz-primary-btn {
    position: relative; overflow: hidden;
    background: var(--kds-primary); color: #fff;
    border-radius: 12px; padding: 18px 30px; font-weight: 600;
    transition: all 0.3s; box-shadow: 0 10px 20px -5px rgba(79, 70, 229, 0.3);
}

/* Shine Effect */
.woocommerce:where(body:not(.woocommerce-block-theme-has-button-styles)) a.button.alt::after,
.woocommerce:where(body:not(.woocommerce-block-theme-has-button-styles)) button.button.alt::after,
.bz-primary-btn::after {
    content: ""; position: absolute; top: 0; left: -150%;
    width: 100%; height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255,255,255,0.4), transparent);
    transform: skewX(-20deg); transition: none; z-index: 1;
}

@keyframes kds-shine-anim { 0% { left: -150%; } 100% { left: 150%; } }

.woocommerce:where(body:not(.woocommerce-block-theme-has-button-styles)) a.button.alt:hover,
.woocommerce:where(body:not(.woocommerce-block-theme-has-button-styles)) button.button.alt:hover,
.bz-primary-btn:hover {
    background: color-mix(in srgb, var(--kds-primary) 85%, #000);
    transform: translateY(-2px);
}

.woocommerce:where(body:not(.woocommerce-block-theme-has-button-styles)) a.button.alt:hover::after,
.woocommerce:where(body:not(.woocommerce-block-theme-has-button-styles)) button.button.alt:hover::after,
.bz-primary-btn:hover::after {
    animation: kds-shine-anim 0.75s ease-in-out;
}

/* =====================================================
   6. RESPONSIVENESS
   ===================================================== */
@media (max-width: 900px) { 
    .bz-license-grid { grid-template-columns: 1fr !important; } 
    .bz-lic-card.best { transform: scale(1); margin: 15px 0; }
}