/* Motyl-Pro Theme — Cart Page Styles v1.4.0
 * Własny szablon page-cart.php — pełna kontrola nad HTML.
 * Karty cross-sells używają .pcard z main.css (współdzielone z homepage).
 */

/* ======== PAGE WRAPPER ======== */
.gl-cart-wrap {
  max-width: var(--mw, 1600px);
  margin: 0 auto;
  padding: 0 20px;
}

/* ======== BREADCRUMB ======== */
.gl-cart-breadcrumb {
  padding: 22px 0 0;
  font-size: 12px;
  color: var(--gray-500, #888);
  text-transform: uppercase;
  letter-spacing: .5px;
}
.gl-cart-breadcrumb a {
  color: var(--gray-500, #888);
  text-decoration: none;
  transition: color .18s ease;
}
.gl-cart-breadcrumb a:hover { color: var(--black, #111); }
.gl-cart-breadcrumb .sep { margin: 0 8px; color: var(--gray-300, #d5d5d5); }
.gl-cart-breadcrumb .current { color: var(--black, #111); font-weight: 700; }

/* ======== WC NOTICES (po aktualizacji koszyka) ======== */
.gl-cart-notices {
  margin: 16px 0 0;
}
.gl-cart-notices .woocommerce-message {
  background: #e8f5e9;
  border: 1px solid #a5d6a7;
  border-radius: var(--rlg, 10px);
  padding: 14px 20px;
  font-size: 13.5px;
  font-weight: 600;
  color: #2e7d32;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: gl-notice-in .35s ease;
}
.gl-cart-notices .woocommerce-message::before {
  content: '\2713';
  font-size: 18px;
  font-weight: 800;
  flex-shrink: 0;
}
.gl-cart-notices .woocommerce-message a {
  color: #1b5e20;
  font-weight: 700;
  text-decoration: underline;
}
.gl-cart-notices .woocommerce-error {
  background: #fce4ec;
  border: 1px solid #ef9a9a;
  border-radius: var(--rlg, 10px);
  padding: 14px 20px;
  font-size: 13.5px;
  font-weight: 600;
  color: #c62828;
  list-style: none;
  margin: 0;
  animation: gl-notice-in .35s ease;
}
.gl-cart-notices .woocommerce-error li {
  margin: 0;
}
.gl-cart-notices .woocommerce-info {
  background: #e3f2fd;
  border: 1px solid #90caf9;
  border-radius: var(--rlg, 10px);
  padding: 14px 20px;
  font-size: 13.5px;
  font-weight: 600;
  color: #1565c0;
  animation: gl-notice-in .35s ease;
}
@keyframes gl-notice-in {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ======== PAGE TITLE ======== */
.gl-cart-title {
  font-family: 'Poppins', sans-serif;
  font-size: 28px;
  font-weight: 800;
  color: var(--black, #111);
  margin: 18px 0 0;
  display: none; /* ukryty — breadcrumb wystarczy */
}

/* ======== FREE SHIPPING BAR ======== */
.gl-shipping-bar {
  background: #f0f7f6;
  border: 1px solid #d4e8e4;
  border-radius: var(--rlg, 10px);
  padding: 16px 22px;
  margin: 22px 0 36px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.gl-shipping-bar svg {
  width: 28px; height: 28px; flex-shrink: 0;
  stroke: #000000; fill: none; stroke-width: 1.8;
}
.gl-shipping-info { flex: 1; }
.gl-shipping-text {
  font-size: 13.5px; font-weight: 600; color: #111; margin-bottom: 6px;
}
.gl-shipping-text strong { color: #000000; font-weight: 800; }
.gl-shipping-track {
  width: 100%; height: 6px; background: #d4e8e4; border-radius: 3px; overflow: hidden;
}
.gl-shipping-fill {
  height: 100%; background: #000000; border-radius: 3px;
  transition: width .4s ease;
}
.gl-shipping-bar.done { background: #e8f5e9; border-color: #a5d6a7; }
.gl-shipping-bar.done svg { stroke: #2e7d32; }
.gl-shipping-bar.done .gl-shipping-text { color: #2e7d32; }
.gl-shipping-bar.done .gl-shipping-fill { background: #2e7d32; }


/* ================================================================
   2-COLUMN GRID
   ================================================================ */
.gl-cart-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 40px;
  align-items: start;
}


/* ================================================================
   LEFT COLUMN — Product Cards
   ================================================================ */
.gl-cart-products {
  min-width: 0;
}

/* Column header */
.gl-cart-header {
  display: flex;
  justify-content: space-between;
  padding: 0 0 12px;
  border-bottom: 1px solid var(--gray-200, #e8e8e8);
  margin-bottom: 0;
}
.gl-cart-h-product,
.gl-cart-h-total {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--gray-500, #888);
}

/* Single cart item */
.gl-cart-item {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  padding: 24px 0;
  border-bottom: 1px solid var(--gray-100, #f4f4f4);
  position: relative;
}
.gl-cart-item:last-of-type {
  border-bottom: 1px solid var(--gray-200, #e8e8e8);
}

/* Thumbnail */
.gl-cart-item-img {
  flex: 0 0 90px;
  width: 90px;
  height: 90px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--gray-50, #fafafa);
  border: 1px solid var(--gray-100, #f4f4f4);
}
.gl-cart-item-img a { display: block; width: 100%; height: 100%; }
.gl-cart-item-img img {
  width: 100%; height: 100%; object-fit: contain;
  padding: 6px;
}

/* Details */
.gl-cart-item-details {
  flex: 1;
  min-width: 0;
}
.gl-cart-item-name {
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 3px;
}
.gl-cart-item-name a {
  color: var(--black, #111);
  text-decoration: none;
  transition: color .18s ease;
}
.gl-cart-item-name a:hover {
  color: var(--red, #fb9942);
}
.gl-cart-item-price {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-600, #555);
  margin-bottom: 4px;
}
.gl-cart-item-desc {
  font-size: 12.5px;
  color: var(--gray-400, #aaa);
  line-height: 1.4;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Actions row (qty + remove) */
.gl-cart-item-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* Quantity wrapper */
.gl-qty-wrap {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--gray-300, #d5d5d5);
  border-radius: 6px;
  overflow: hidden;
  height: 34px;
}
.gl-qty-btn {
  width: 32px; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  color: var(--gray-600, #555);
  transition: background .15s ease;
  padding: 0;
}
.gl-qty-btn:hover {
  background: var(--gray-100, #f4f4f4);
}
/* WC quantity input inside our wrapper */
.gl-qty-wrap .quantity { display: contents; }
.gl-qty-wrap .quantity .qty {
  width: 36px;
  text-align: center;
  border: none;
  border-left: 1px solid var(--gray-200, #e8e8e8);
  border-right: 1px solid var(--gray-200, #e8e8e8);
  font-size: 13px;
  font-weight: 700;
  font-family: 'DM Sans', sans-serif;
  -moz-appearance: textfield;
  appearance: textfield;
  padding: 0;
  height: 100%;
  background: transparent;
}
.gl-qty-wrap .quantity .qty::-webkit-outer-spin-button,
.gl-qty-wrap .quantity .qty::-webkit-inner-spin-button {
  -webkit-appearance: none; margin: 0;
}

/* Remove link */
.gl-cart-remove {
  color: var(--gray-300, #d5d5d5);
  font-size: 16px;
  transition: color .18s ease;
}
.gl-cart-remove:hover {
  color: var(--red, #fb9942);
}

/* Subtotal (right aligned) */
.gl-cart-item-total {
  flex: 0 0 auto;
  font-size: 15px;
  font-weight: 700;
  color: var(--black, #111);
  text-align: right;
  white-space: nowrap;
  padding-top: 2px;
}

/* Update cart row */
.gl-cart-update-row {
  display: flex;
  justify-content: flex-end;
  padding: 16px 0;
  gap: 12px;
}
.gl-update-btn {
  background: var(--gray-100, #f4f4f4);
  color: var(--gray-600, #555);
  border: 1px solid var(--gray-200, #e8e8e8);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 8px 18px;
  cursor: pointer;
  transition: all .18s ease;
}
.gl-update-btn:hover {
  background: var(--gray-200, #e8e8e8);
  color: var(--black, #111);
}


/* ================================================================
   RIGHT COLUMN — Sidebar
   ================================================================ */
.gl-cart-sidebar {
  position: sticky;
  top: 100px;
}
.gl-cart-sidebar-box {
  background: #f5f9fd;
  border: 1px solid #e0ecf5;
  border-radius: 14px;
  padding: 28px 24px;
  box-shadow:
    0 4px 16px rgba(0, 60, 120, .06),
    0 14px 48px rgba(0, 60, 120, .045);
}

/* Title */
.gl-sidebar-title {
  font-family: 'Poppins', sans-serif;
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .3px;
  color: var(--black, #111);
  border-bottom: 1px solid #d6e5f0;
  padding-bottom: 14px;
  margin: 0 0 0;
}

/* Kupon (zawsze widoczny) */
.gl-sidebar-coupon {
  border-bottom: 1px solid #d6e5f0;
  padding: 14px 0 18px;
  margin-bottom: 4px;
}
.gl-coupon-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--black, #111);
  margin-bottom: 10px;
}
.gl-coupon-label i {
  color: var(--red, #fb9942);
  font-size: 13px;
}
.gl-coupon-form-sidebar {
  display: flex;
  gap: 8px;
}
.gl-coupon-form-sidebar input[type="text"] {
  flex: 1;
  border: 1px solid #d6e5f0;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 12.5px;
  font-family: 'DM Sans', sans-serif;
  background: #fff;
}
.gl-coupon-form-sidebar button {
  background: var(--black, #111);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s ease;
  white-space: nowrap;
}
.gl-coupon-form-sidebar button:hover {
  background: #333;
}

/* Summary rows */
.gl-sidebar-rows {
  padding: 14px 0;
  border-bottom: 1px solid #d6e5f0;
}
.gl-sidebar-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 13.5px;
  color: var(--gray-600, #555);
  padding: 5px 0;
}
.gl-sidebar-row--coupon span:last-child {
  color: #000000;
  font-weight: 600;
}
.gl-free {
  color: #2e7d32;
  font-weight: 700;
}

/* Total */
.gl-sidebar-total {
  padding: 18px 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.gl-sidebar-total > span:first-child {
  font-size: 13px;
  color: var(--gray-500, #888);
  font-weight: 600;
}
.gl-sidebar-total-price {
  font-family: 'Poppins', sans-serif;
  font-size: 26px;
  font-weight: 800;
  color: var(--black, #111);
}

/* Checkout button */
.gl-btn-checkout {
  display: block;
  width: 100%;
  text-align: center;
  background-color: var(--red, #fb9942);
  color: #fff;
  font-family: 'Poppins', sans-serif;
  font-size: 15px;
  font-weight: 700;
  padding: 16px 24px;
  border-radius: 10px;
  border: none;
  letter-spacing: .3px;
  text-decoration: none;
  transition: background-color .18s ease, transform .12s ease, box-shadow .18s ease;
  box-shadow: 0 4px 14px rgba(251,153,66, .25);
}
.gl-btn-checkout:hover {
  background-color: var(--red-dark, #e07d1f);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(251,153,66, .3);
}

/* Security badges */
.gl-sidebar-badges {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid #d6e5f0;
}
.gl-sidebar-badge {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  color: var(--gray-500, #888);
}
.gl-sidebar-badge svg { flex-shrink: 0; }


/* ================================================================
   EMPTY CART
   ================================================================ */
.gl-cart-empty {
  text-align: center;
  padding: 80px 20px;
}
.gl-cart-empty i {
  font-size: 56px;
  color: var(--gray-300, #d5d5d5);
  margin-bottom: 20px;
}
.gl-cart-empty p {
  font-size: 17px;
  color: var(--gray-500, #888);
  margin-bottom: 24px;
}
.gl-btn-back-shop {
  display: inline-block;
  background: var(--black, #111);
  color: #fff;
  padding: 14px 32px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  transition: background .18s ease;
}
.gl-btn-back-shop:hover {
  background: #333;
  color: #fff;
}


/* ================================================================
   CROSS-SELLS — Full-width .pcard carousel
   ================================================================ */
.gl-cross-sells {
  padding: 48px 0 40px;
  margin-top: 24px;
  border-top: 1px solid var(--gray-200, #e8e8e8);
}

.gl-cross-sells-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}
.gl-cross-sells-title {
  font-family: 'Poppins', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--black, #111);
  margin: 0;
}

/* Carousel arrows (title-row) */
.gl-cross-sells-arrows {
  display: flex;
  gap: 8px;
}
.gl-cs-arr {
  width: 38px; height: 38px;
  border: 1.5px solid var(--gray-300, #d5d5d5);
  border-radius: 50%;
  background: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--black, #111);
  font-size: 12px;
  transition: all .18s ease;
  padding: 0;
}
.gl-cs-arr:hover {
  border-color: var(--black, #111);
  box-shadow: 0 3px 10px rgba(0,0,0,.1);
}

/* Track */
.gl-cross-sells-track {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 8px;
}
.gl-cross-sells-track::-webkit-scrollbar { display: none; }

/* Each .pcard in carousel */
.gl-cross-sells-track .pcard {
  flex: 0 0 calc(20% - 13px);
  min-width: 0;
  scroll-snap-align: start;
}


/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 1199px) {
  .gl-cart-grid {
    grid-template-columns: 1fr 340px;
    gap: 28px;
  }
  .gl-cross-sells-track .pcard {
    flex: 0 0 calc(25% - 12px);
  }
}

@media (max-width: 991px) {
  .gl-cart-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .gl-cart-sidebar {
    position: static;
  }
  .gl-cross-sells-track .pcard {
    flex: 0 0 calc(33.333% - 11px);
  }
}

@media (max-width: 768px) {
  .gl-cart-wrap { padding: 0 12px; }
  .gl-cart-breadcrumb { padding: 14px 0 0; }
  .gl-shipping-bar { margin: 14px 0 24px; padding: 14px 16px; }

  .gl-cart-item-img {
    flex: 0 0 72px;
    width: 72px;
    height: 72px;
  }
  .gl-cart-item-total {
    position: absolute;
    top: 24px;
    right: 0;
    font-size: 14px;
  }
  /* Rezerwujemy miejsce po prawej, by tytuł/cena nie wchodziły pod cenę łączną */
  .gl-cart-item-name,
  .gl-cart-item-price {
    padding-right: 92px;
  }

  .gl-cross-sells-track .pcard {
    flex: 0 0 calc(55% - 8px);
    min-width: calc(55% - 8px);
  }
  .gl-cross-sells-arrows { display: none; }
}

@media (max-width: 480px) {
  .gl-cart-item { gap: 12px; }
  .gl-cart-item-name { font-size: 13px; padding-right: 80px; }
  .gl-cart-item-price { padding-right: 80px; }
  .gl-cart-item-desc { display: none; }

  .gl-cross-sells-track .pcard {
    flex: 0 0 calc(70% - 8px);
    min-width: calc(70% - 8px);
  }
}
