/* =========================================================
   BadaniaLab — cart-drawer.css
   Koszyk wysuwany z prawej + mobile fixes
   ========================================================= */

/* OVERLAY */
.cart-drawer-overlay {
  position: fixed; inset: 0;
  background: rgba(15,42,61,.45);
  z-index: 400;
  opacity: 0; visibility: hidden;
  transition: opacity .3s ease, visibility .3s ease;
  backdrop-filter: blur(2px);
}
.cart-drawer-overlay.open { opacity: 1; visibility: visible; }

/* DRAWER */
.cart-drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 100%; max-width: 420px;
  background: #fff;
  z-index: 401;
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform .35s cubic-bezier(.4,0,.2,1);
  box-shadow: -8px 0 48px rgba(0,0,0,.15);
}
.cart-drawer.open { transform: translateX(0); }

/* HEAD */
.cd-head {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border,#e3e8ed);
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
}
.cd-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1rem; font-weight: 800; color: var(--body-text,#1a2530);
  display: flex; align-items: center; gap: 8px;
}
.cd-title svg { width: 18px; height: 18px; color: var(--teal,#1a8b7a); }
.cd-count {
  background: var(--teal-light,#e6f4f1);
  color: var(--teal-dark,#14695d);
  padding: 2px 9px; border-radius: 999px;
  font-size: .72rem; font-weight: 700;
  border: 1px solid var(--teal-mid,#d0ece8);
}
.cd-close {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--bg-alt,#f7f9fb);
  border: 1px solid var(--border,#e3e8ed);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  color: var(--muted,#5a6a78); transition: all .2s;
}
.cd-close:hover { background: var(--border,#e3e8ed); color: var(--body-text,#1a2530); }
.cd-close svg { width: 14px; height: 14px; }

/* BODY */
.cd-body {
  flex: 1; overflow-y: auto; padding: 0;
  overscroll-behavior: contain;
}
.cd-body::-webkit-scrollbar { width: 4px; }
.cd-body::-webkit-scrollbar-thumb { background: var(--border,#e3e8ed); border-radius: 2px; }

/* EMPTY */
.cd-empty {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 48px 24px; text-align: center; height: 100%;
}
.cd-empty-icon {
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--bg-alt,#f7f9fb);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px; color: var(--muted2,#8a9aaa);
}
.cd-empty-icon svg { width: 28px; height: 28px; }
.cd-empty h3 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: .95rem; font-weight: 800; color: var(--body-text,#1a2530); margin-bottom: 6px;
}
.cd-empty p { font-size: .82rem; color: var(--muted,#5a6a78); margin-bottom: 20px; }
.cd-browse-btn {
  padding: 10px 20px; border-radius: 999px;
  background: var(--teal,#1a8b7a); color: white;
  font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 700; font-size: .875rem;
  text-decoration: none; transition: background .2s;
}
.cd-browse-btn:hover { background: var(--teal-dark,#14695d); }

/* ITEMS */
.cd-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 20px; border-bottom: 1px solid var(--border,#e3e8ed);
  transition: background .2s; position: relative;
}
.cd-item:hover { background: var(--bg-alt,#f7f9fb); }
.cd-item-icon {
  width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.cd-item-icon svg { width: 18px; height: 18px; }
.cd-item-info { flex: 1; min-width: 0; }
.cd-item-name {
  font-size: .875rem; font-weight: 600; color: var(--body-text,#1a2530);
  text-decoration: none; display: block; margin-bottom: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cd-item-name:hover { color: var(--teal-dark,#14695d); }
.cd-item-sub { font-size: .72rem; color: var(--muted,#5a6a78); margin-bottom: 8px; }
.cd-item-qty { display: flex; align-items: center; justify-content: space-between; }
.qty-control {
  display: flex; align-items: center; gap: 0;
  border: 1px solid var(--border,#e3e8ed); border-radius: 8px; overflow: hidden;
}
.qty-btn {
  width: 28px; height: 28px;
  background: var(--bg-alt,#f7f9fb); border: none; cursor: pointer;
  font-size: 1rem; color: var(--body-text,#1a2530); display: flex;
  align-items: center; justify-content: center; transition: background .2s;
  font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 700;
}
.qty-btn:hover { background: var(--teal-light,#e6f4f1); color: var(--teal-dark,#14695d); }
.qty-val {
  min-width: 28px; text-align: center; font-size: .875rem; font-weight: 700;
  color: var(--body-text,#1a2530); padding: 0 4px;
}
.cd-item-line {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: .95rem; font-weight: 800; color: var(--body-text,#1a2530);
}
.cd-remove {
  width: 26px; height: 26px; border-radius: 50%;
  background: none; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted2,#8a9aaa); transition: all .2s; flex-shrink: 0;
  text-decoration: none;
}
.cd-remove:hover { background: #fef2f2; color: #dc2626; }
.cd-remove svg { width: 11px; height: 11px; }

/* FOOTER */
.cd-foot {
  border-top: 1px solid var(--border,#e3e8ed);
  padding: 16px 20px; flex-shrink: 0; background: #fff;
}
.cd-summary { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.cd-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: .82rem; color: var(--muted,#5a6a78);
}
.cd-row span:last-child { font-weight: 600; color: var(--body-text,#1a2530); }
.cd-total {
  display: flex; justify-content: space-between; align-items: baseline;
  padding-top: 10px; border-top: 1px solid var(--border,#e3e8ed); margin-bottom: 14px;
}
.cd-total > span:first-child {
  font-family: 'Plus Jakarta Sans', sans-serif; font-size: .875rem; font-weight: 800;
}
.cd-total-price {
  font-family: 'Plus Jakarta Sans', sans-serif; font-size: 1.5rem; font-weight: 800;
  color: var(--body-text,#1a2530);
}
.cd-checkout-btn {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  width: 100%; padding: 15px; border-radius: 12px;
  background: var(--teal,#1a8b7a); color: white;
  font-family: 'Plus Jakarta Sans', sans-serif; font-size: 1rem; font-weight: 800;
  border: none; cursor: pointer; transition: all .2s;
  text-decoration: none; margin-bottom: 8px;
}
.cd-checkout-btn:hover {
  background: var(--teal-dark,#14695d);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(26,139,122,.3);
}
.cd-checkout-btn svg { width: 17px; height: 17px; }
.cd-cart-link {
  display: block; text-align: center; font-size: .8rem; font-weight: 600;
  color: var(--muted,#5a6a78); text-decoration: none; padding: 4px;
  transition: color .2s;
}
.cd-cart-link:hover { color: var(--teal-dark,#14695d); }

/* MOBILE */
@media(max-width: 480px) {
  .cart-drawer { max-width: 100%; }
}

/* =========================================================
   MOBILE GLOBAL FIXES
   ========================================================= */

/* Brak horizontal scroll */
html, body { overflow-x: hidden; max-width: 100%; }
* { box-sizing: border-box; }

/* Hero section mobile */
@media(max-width: 768px) {
  .hero-section, [class*="hero"] { padding: 48px 20px 40px!important; }
  .hero-title, h1.page-title { font-size: clamp(1.8rem, 7vw, 2.8rem)!important; }
  .hero-stats { flex-direction: column!important; gap: 16px!important; }
  .hero-actions { flex-direction: column!important; align-items: stretch!important; gap: 10px!important; }
  .hero-actions a, .hero-actions button { width: 100%!important; justify-content: center!important; }
}

/* Karty produktów mobile */
@media(max-width: 768px) {
  .products-grid { grid-template-columns: repeat(2,1fr)!important; }
  .product-card { padding: 16px!important; }
}
@media(max-width: 480px) {
  .products-grid { grid-template-columns: 1fr!important; }
}

/* Featured card mobile (strona główna) */
@media(max-width: 768px) {
  .featured-card { grid-template-columns: 1fr!important; }
  .featured-thumb { min-height: 160px!important; }
  .articles-grid { grid-template-columns: repeat(2,1fr)!important; }
}
@media(max-width: 480px) {
  .articles-grid { grid-template-columns: 1fr!important; }
}

/* Menu mobile */
@media(max-width: 900px) {
  .main-nav { display: none!important; }
  .hamburger { display: flex!important; }
  .mobile-menu.open { max-height: 600px!important; }
}

/* Koszyk mobile sticky */
@media(max-width: 640px) {
  .mobile-sticky-cart { display: block!important; }
}

/* Checkout mobile */
@media(max-width: 640px) {
  #customer_details { flex-direction: column!important; }
  .col-1, .col-2 { width: 100%!important; float: none!important; }
  #order_review { float: none!important; width: 100%!important; padding-left: 0!important; }
  .woocommerce-checkout-review-order-table { font-size: .85rem!important; }
}

/* Stopka mobile */
@media(max-width: 640px) {
  .footer-top { grid-template-columns: 1fr!important; gap: 28px!important; }
  .footer-bottom { flex-direction: column!important; align-items: flex-start!important; gap: 10px!important; }
}

/* Koszyk strona mobile */
@media(max-width: 640px) {
  .woocommerce-cart table.cart td { padding: 10px 8px!important; }
  .woocommerce-cart .cart_totals { float: none!important; width: 100%!important; }
  .woocommerce-cart .cross-sells { display: none!important; }
}
