/* ==========================================================================
   NANDNEE GLOBAL SHOPPING CART STYLES
   Used across all pages: index, about, products, blog, contact, checkout
   ========================================================================== */

:root {
  --cart-accent: #0284C7;
  --cart-accent-hover: #0369A1;
  --cart-gold: #F5C542;
  --cart-gold-hover: #EAB308;
  --cart-bg: #FCF7E9;
  --cart-surface: #FFFFFF;
  --cart-border: #E7DDC0;
  --cart-text: #0F172A;
  --cart-muted: #64748B;
  --cart-subtle: #94A3B8;
  --cart-ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* Floating Cart Trigger Button (Desktop & Tablet) */
.cart-floater {
  position: fixed;
  right: 1.5rem;
  bottom: 5.5rem;
  z-index: 1050;
  width: 58px;
  height: 58px;
  border-radius: 9999px;
  background: #F5C542;
  color: #0284C7;
  border: 2px solid #FFFFFF;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 30px -6px rgba(2, 132, 199, 0.42), 0 4px 12px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  transition: transform 0.25s var(--cart-ease), box-shadow 0.25s ease, background 0.2s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.cart-floater:hover {
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 16px 36px -6px rgba(2, 132, 199, 0.52), 0 6px 16px rgba(0, 0, 0, 0.12);
  background: #FBD75B;
}

.cart-floater:active {
  transform: translateY(0) scale(0.96);
}

.cart-floater svg {
  width: 26px;
  height: 26px;
  transition: transform 0.2s ease;
}

.cart-floater:hover svg {
  transform: scale(1.08);
}

/* Badge Counter on Floating Button */
.cart-floater-count {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 9999px;
  background: #0284C7;
  color: #FFFFFF;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #FFFFFF;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.35);
  opacity: 0;
  transform: scale(0.4);
  transition: opacity 0.22s ease, transform 0.25s var(--cart-ease);
  pointer-events: none;
}

.cart-floater-count.is-visible {
  opacity: 1;
  transform: scale(1);
}

.cart-floater.is-bump,
.cart-floater-count.bump {
  animation: cartBump 0.4s var(--cart-ease);
}

@keyframes cartBump {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.22); }
  70%  { transform: scale(0.95); }
  100% { transform: scale(1); }
}

/* Backdrop Overlay */
.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
}

.cart-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

/* Cart Slide-Over Drawer */
.cart-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 440px;
  max-width: 94vw;
  background: var(--cart-bg, #FCF7E9);
  z-index: 1300;
  box-shadow: -18px 0 45px rgba(15, 23, 42, 0.25);
  transform: translateX(100%);
  transition: transform 0.32s var(--cart-ease);
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--cart-border, #E7DDC0);
  font-family: inherit;
}

.cart-panel.is-open {
  transform: translateX(0);
}

/* Cart Header */
.cart-panel-head {
  padding: 1.25rem 1.4rem;
  background: #0284C7;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(2, 132, 199, 0.25);
}

.cart-panel-title {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: #FFFFFF;
}

.cart-panel-title svg {
  color: #F5C542;
  flex-shrink: 0;
}

.cart-panel-sub {
  font-size: 0.76rem;
  color: rgba(255, 255, 255, 0.85);
  margin-top: 0.2rem;
  letter-spacing: 0.02em;
  font-weight: 500;
}

.cart-panel-close {
  width: 36px;
  height: 36px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.16);
  color: #FFFFFF;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
}

.cart-panel-close:hover {
  background: rgba(255, 255, 255, 0.28);
  transform: scale(1.06);
}

/* Cart Body (Scrollable Items Area) */
.cart-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 1rem 1.25rem 1.5rem;
  scrollbar-width: thin;
  scrollbar-color: #CBD5E1 transparent;
}

.cart-body::-webkit-scrollbar {
  width: 6px;
}
.cart-body::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: 999px;
}

/* Empty State */
.cart-empty {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3.5rem 1.5rem;
  color: var(--cart-muted, #64748B);
}

.cart-empty-icon {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: #F2E9CD;
  color: #0284C7;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.cart-empty-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--cart-text, #0F172A);
  margin-bottom: 0.4rem;
}

.cart-empty-hint {
  font-size: 0.84rem;
  color: var(--cart-muted, #64748B);
  max-width: 280px;
  line-height: 1.45;
  margin-bottom: 1.25rem;
}

.cart-empty-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.25rem;
  background: #0284C7;
  color: #FFFFFF;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.2s ease, transform 0.15s ease;
}

.cart-empty-btn:hover {
  background: #0369A1;
  transform: translateY(-1px);
}

/* Cart Line Item */
.cart-line {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 0.2rem 0.85rem;
  padding: 0.95rem 0;
  border-bottom: 1px solid var(--cart-border, #E7DDC0);
  align-items: start;
}

.cart-line:last-child {
  border-bottom: 0;
}

.cart-line-thumb {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: #FFFFFF;
  color: #0284C7;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--cart-border, #E7DDC0);
  overflow: hidden;
  flex-shrink: 0;
}

.cart-line-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cart-line-main {
  min-width: 0;
}

.cart-line-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}

.cart-line-name {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--cart-text, #0F172A);
  line-height: 1.3;
  margin-bottom: 0.15rem;
  overflow-wrap: anywhere;
}

.cart-line-total {
  font-size: 1rem;
  font-weight: 800;
  color: #0284C7;
  white-space: nowrap;
  flex-shrink: 0;
}

.cart-line-meta {
  font-size: 0.74rem;
  color: var(--cart-muted, #64748B);
  line-height: 1.35;
  margin-top: 0.15rem;
}

.cart-line-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.6rem;
}

.cart-qty {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: #FFFFFF;
  padding: 0.15rem;
  border: 1px solid var(--cart-border, #E7DDC0);
  border-radius: 8px;
}

.cart-qty-btn {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  color: #0F172A;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1;
  padding: 0;
  transition: all 0.15s ease;
}

.cart-qty-btn:hover {
  background: #0284C7;
  color: #FFFFFF;
  border-color: #0284C7;
}

.cart-qty-val {
  min-width: 2.8rem;
  text-align: center;
  font-weight: 700;
  font-size: 0.88rem;
  color: #0F172A;
}

.cart-qty-val small {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--cart-muted, #64748B);
  margin-left: 0.15rem;
}

.cart-line-tags {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}

.cart-line-pcs {
  display: inline-block;
  white-space: nowrap;
  font-size: 0.7rem;
  background: #E0F2FE;
  color: #0369A1;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-weight: 700;
}

.cart-line-remove {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.7rem;
  color: #EF4444;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 0.25rem 0.35rem;
  font-weight: 600;
  border-radius: 4px;
  transition: background 0.15s ease, color 0.15s ease;
}

.cart-line-remove:hover {
  background: #FEE2E2;
  color: #B91C1C;
}

/* Cart Footer & Checkout Action */
.cart-foot {
  padding: 1.25rem 1.4rem;
  border-top: 1px solid var(--cart-border, #E7DDC0);
  background: #FFFFFF;
  flex-shrink: 0;
}

.cart-foot-subtotal,
.cart-foot-gst {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--cart-muted, #64748B);
  margin-bottom: 0.35rem;
}

.cart-foot-total {
  display: flex;
  justify-content: space-between;
  padding-top: 0.6rem;
  margin-top: 0.5rem;
  border-top: 1px dashed var(--cart-border, #E7DDC0);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--cart-text, #0F172A);
  margin-bottom: 0.4rem;
}

.cart-foot-total span:last-child {
  color: #0284C7;
}

.cart-foot-note {
  font-size: 0.72rem;
  color: var(--cart-subtle, #94A3B8);
  line-height: 1.35;
  margin-bottom: 0.85rem;
}

.cart-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.95rem 1.25rem;
  border-radius: 10px;
  background: #0284C7;
  color: #FFFFFF;
  font-weight: 800;
  font-size: 0.92rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  text-decoration: none;
  border: 0;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.35);
  transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.cart-cta:hover {
  background: #0369A1;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(2, 132, 199, 0.45);
}

.cart-cta:active {
  transform: translateY(0);
}

.cart-clear-link {
  display: block;
  text-align: center;
  margin-top: 0.6rem;
  font-size: 0.75rem;
  color: var(--cart-muted, #64748B);
  background: none;
  border: 0;
  cursor: pointer;
  text-decoration: underline;
  width: 100%;
}

.cart-clear-link:hover {
  color: #EF4444;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  /* On mobile, bottom-nav handles cart trigger, but cart-panel slides in full-width */
  .cart-panel {
    width: 100%;
    max-width: 100%;
    border-left: 0;
  }

  .cart-line {
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 0.15rem 0.75rem;
    padding: 0.85rem 0;
  }

  .cart-line-name {
    font-size: 0.88rem;
  }

  .cart-line-total {
    font-size: 0.95rem;
  }

  .cart-line-remove span {
    display: none;
  }

  .cart-line-remove {
    width: 28px;
    height: 28px;
    justify-content: center;
    border-radius: 6px;
    border: 1px solid #FECACA;
  }
}
