/* ============================
   PrintLume Components CSS
   - Cart Drawer
   - Cookie Banner
   - Breadcrumbs
   ============================ */

/* ============================
   CART DRAWER
   ============================ */
.cart-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.60);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: opacity .35s ease, visibility .35s ease;
}

.cart-drawer-overlay.active {
  opacity: 1;
  visibility: visible;
}

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(420px, 92vw);
  height: 100vh;
  z-index: 2001;
  background: var(--bg-2);
  border-left: 1px solid var(--line);
  box-shadow: -20px 0 80px rgba(0,0,0,0.40);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform .4s var(--ease);
  overflow: hidden;
}

.cart-drawer.active {
  transform: translateX(0);
}

.cart-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

.cart-drawer-header h3 {
  margin: 0;
  font-size: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: "Outfit", "Space Grotesk", sans-serif;
}

.cart-drawer-header h3 .cart-drawer-count {
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}

.cart-drawer-close {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: border-color .25s ease, background .25s ease;
}

.cart-drawer-close:hover {
  border-color: rgba(0,212,170,0.30);
  background: var(--primary-faint);
  color: var(--primary);
}

.cart-drawer-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

.cart-drawer-body.is-loading {
  position: relative;
}

.cart-drawer-body.is-loading::before {
  content: "";
  position: absolute;
  top: 22px;
  right: 22px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 2px solid rgba(255,255,255,0.18);
  border-top-color: var(--primary);
  animation: printlume-spin .8s linear infinite;
  z-index: 3;
}

.cart-drawer-body.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(9,10,13,0.28);
  -webkit-backdrop-filter: blur(1px);
  backdrop-filter: blur(1px);
  z-index: 2;
}

.cart-drawer.is-busy .cart-drawer-item-remove,
.cart-drawer.is-busy .cart-drawer-coupon-btn,
.cart-drawer.is-busy .cart-drawer-checkout,
.cart-drawer.is-busy .cart-drawer-view {
  pointer-events: none;
  opacity: 0.72;
}

/* Empty state */
.cart-drawer-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  text-align: center;
  min-height: 300px;
}

.cart-drawer-empty-icon {
  width: 80px;
  height: 80px;
  display: grid;
  place-items: center;
  border-radius: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  margin-bottom: 20px;
  color: var(--muted);
}

.cart-drawer-empty p {
  color: var(--muted);
  margin: 0 0 20px;
  font-size: 15px;
}

/* Items list */
.cart-drawer-items {
  padding: 12px 24px;
}

.cart-drawer-item {
  display: grid;
  grid-template-columns: 64px 1fr 32px;
  gap: 14px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--line-light);
  transition: opacity .3s ease;
}

.cart-drawer-item:last-child {
  border-bottom: none;
}

.cart-drawer-item-thumb {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  flex-shrink: 0;
}

.cart-drawer-item-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cart-drawer-item-name {
  display: block;
  font-weight: 700;
  font-size: 14px;
  color: var(--text) !important;
  margin-bottom: 4px;
  line-height: 1.4;
}

.cart-drawer-item-name:hover {
  color: var(--primary) !important;
}

.cart-drawer-item-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

/* Quantity controls in drawer */
.cart-drawer-qty-wrap {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 2px;
}
.cart-drawer-qty-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  border-radius: 8px;
  transition: all .2s ease;
  font-size: 10px;
  padding: 0;
}
.cart-drawer-qty-btn:hover {
  color: var(--primary);
  background: var(--primary-faint);
}
.cart-drawer-qty-val {
  min-width: 26px;
  text-align: center;
  font-weight: 700;
  font-size: 13px;
  color: var(--text);
  font-family: "Outfit", sans-serif;
  user-select: none;
}

/* Item removal animation */
.cart-drawer-item.removing {
  animation: plCartItemOut .35s var(--ease) forwards;
}
@keyframes plCartItemOut {
  to {
    opacity: 0;
    transform: translateX(40px);
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    margin: 0;
    overflow: hidden;
  }
}

/* Cart badge bounce */
@keyframes plBadgeBounce {
  0% { transform: scale(1); }
  30% { transform: scale(1.45); }
  50% { transform: scale(0.9); }
  70% { transform: scale(1.15); }
  100% { transform: scale(1); }
}
.nav-cart-count.bounce {
  animation: plBadgeBounce .5s var(--ease);
}

.cart-drawer-item-price {
  color: var(--primary-text);
  font-weight: 700;
  font-family: "Outfit", sans-serif;
}

.cart-drawer-item-remove {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: transparent;
  color: var(--muted) !important;
  transition: color .25s ease, background .25s ease;
  cursor: pointer;
}

.cart-drawer-item-remove:hover {
  color: var(--danger) !important;
  background: rgba(255,180,167,0.10);
}

/* Footer */
.cart-drawer-footer {
  padding: 20px 24px;
  border-top: 1px solid var(--line);
  flex-shrink: 0;
  background: var(--bg);
}

.cart-drawer-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  font-size: 16px;
}

.cart-drawer-total span {
  color: var(--text-secondary);
}

.cart-drawer-total strong {
  font-family: "Outfit", sans-serif;
  font-size: 22px;
  color: var(--primary-text);
}

.cart-drawer-coupon {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.cart-drawer-coupon-input {
  flex: 1;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
}

.cart-drawer-coupon-input:focus {
  border-color: rgba(0,212,170,0.40);
}

.cart-drawer-coupon .pill {
  min-height: 44px;
  padding: 0 16px;
  font-size: 13px;
}

.cart-drawer-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.cart-drawer-actions .pill {
  width: 100%;
  text-align: center;
  justify-content: center;
}

.cart-drawer-shipping-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  font-size: 12px;
  color: var(--muted);
}

/* Free shipping bar */
.cart-drawer-free-shipping {
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line-light);
}

.cart-drawer-fs-text {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.cart-drawer-fs-text .woocommerce-Price-amount {
  color: var(--primary);
  font-weight: 700;
}

.cart-drawer-fs-bar {
  height: 4px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.cart-drawer-fs-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--primary), var(--primary-2, #00e6b8));
  transition: width .4s var(--ease);
}

/* Notice */
.cart-drawer-notice {
  padding: 12px 24px;
  font-size: 13px;
  font-weight: 600;
  animation: fadeInUp .3s ease;
}

.cart-drawer-notice--success {
  background: rgba(0,212,170,0.08);
  color: var(--primary-text);
  border-bottom: 1px solid rgba(0,212,170,0.14);
}

.cart-drawer-notice--error {
  background: rgba(255,180,167,0.08);
  color: var(--danger);
  border-bottom: 1px solid rgba(255,180,167,0.14);
}

@keyframes printlume-spin {
  to { transform: rotate(360deg); }
}


/* ============================
   COOKIE BANNER
   ============================ */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1500;
  transform: translateY(100%);
  transition: transform .5s var(--ease);
  pointer-events: none;
}

.cookie-banner.visible {
  transform: translateY(0);
  pointer-events: auto;
}

.cookie-banner-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 16px 16px;
}

.cookie-banner-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 24px;
  border-radius: 22px;
  background: rgba(15,18,24,0.95);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border: 1px solid var(--line);
  box-shadow: 0 -10px 60px rgba(0,0,0,0.30);
  margin: 0 auto 16px;
  max-width: calc(var(--maxw) - 32px);
}

.cookie-banner-content {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.cookie-banner-content p {
  margin: 0;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.cookie-policy-link {
  color: var(--primary) !important;
  text-decoration: underline !important;
  text-underline-offset: 3px;
  margin-left: 4px;
}

.cookie-banner-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.cookie-banner-actions .pill {
  min-height: 42px;
  padding: 0 16px;
  font-size: 13px;
}

@media (max-width: 760px) {
  .cookie-banner-inner {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }

  .cookie-banner-content {
    flex-direction: column;
  }

  .cookie-banner-actions {
    justify-content: center;
  }
}


/* ============================
   BREADCRUMBS
   ============================ */
.breadcrumbs {
  padding: 16px 0;
  position: relative;
  z-index: 2;
}

.breadcrumb-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
  font-size: 13px;
}

.breadcrumb-list li {
  display: flex;
  align-items: center;
  gap: 0;
}

.breadcrumb-list a {
  color: var(--muted);
  transition: color .25s ease;
  padding: 4px 0;
}

.breadcrumb-list a:hover {
  color: var(--primary);
}

.breadcrumb-sep {
  color: rgba(255,255,255,0.20);
  margin: 0 10px;
  font-size: 14px;
}

.breadcrumb-current {
  color: var(--text-secondary);
  font-weight: 600;
}


/* ============================
   LOADING SKELETON
   ============================ */
.skeleton {
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface-strong) 50%, var(--surface) 75%);
  background-size: 200% 100%;
  animation: skeleton-pulse 1.5s ease-in-out infinite;
  border-radius: 12px;
}

@keyframes skeleton-pulse {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}


/* ============================
   TOAST NOTIFICATIONS
   ============================ */
.toast-container {
  position: fixed;
  top: 100px;
  right: 20px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  padding: 14px 20px 14px 48px;
  border-radius: 16px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  font-size: 14px;
  color: var(--text);
  animation: toastIn .4s var(--ease);
  max-width: 360px;
  position: relative;
  overflow: hidden;
}

.toast::before {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  background-size: contain;
  background-repeat: no-repeat;
}

.toast::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: var(--line);
  border-radius: 0 0 16px 16px;
  animation: toastProgress var(--toast-duration, 3.5s) linear forwards;
}

@keyframes toastProgress {
  from { width: 100%; }
  to { width: 0; }
}

.toast.success {
  border-color: rgba(0,212,170,0.30);
}

.toast.success::before {
  content: "";
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2300d4aa' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M9 12l2 2 4-4'/%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3C/svg%3E");
}

.toast.success::after {
  background: linear-gradient(90deg, var(--primary), var(--primary-2));
}

.toast.error {
  border-color: rgba(255,180,167,0.30);
}

.toast.error::before {
  content: "";
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23ffb4a7' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M15 9l-6 6M9 9l6 6'/%3E%3C/svg%3E");
}

.toast.error::after {
  background: linear-gradient(90deg, #ffb4a7, #ff6b81);
}

.toast.removing {
  animation: toastOut .3s ease forwards;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(20px); }
}


/* ============================
   BACK TO TOP BUTTON
   ============================ */
.back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1010;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  color: var(--text);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: all .35s var(--ease);
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  border-color: rgba(0,212,170,0.30);
  background: var(--primary-faint);
  color: var(--primary);
  transform: translateY(-2px);
}
