/* =============================================================
   ZHURI NATURALS — cart.css
   Styling for the shopping cart UI (button, badge, modal, toast).
   All classes use cart-* prefix to avoid collisions with the
   shop's existing .shop-* classes and Styles.css.
   ============================================================= */


/* ─── Add to Cart button on product cards ─── */
.cart-add-btn {
  background: #111;
  color: #fff;
  border: none;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: .72em;
  font-weight: 700;
  letter-spacing: .04em;
  cursor: pointer;
  transition: background .2s, transform .1s;
  font-family: 'Lato', sans-serif;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.cart-add-btn:hover {
  background: #2bbbac;
}
.cart-add-btn:active {
  transform: scale(.96);
}
.cart-add-btn .fa {
  font-size: 1em;
}


/* ─── Cart icon in navbar with badge ─── */
.cart-icon-btn {
  position: relative;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 1.2em;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 6px;
  transition: background .2s;
  margin-left: 8px;
}
.cart-icon-btn:hover {
  background: rgba(255,255,255,.12);
}

.cart-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 18px;
  height: 18px;
  background: #2bbbac;
  color: #fff;
  font-size: .65em;
  font-weight: 800;
  border-radius: 10px;
  padding: 0 5px;
  display: none;            /* hidden by default; JS toggles to flex when count > 0 */
  align-items: center;
  justify-content: center;
  letter-spacing: 0;
}


/* ─── Cart modal overlay ─── */
.cart-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 1000;
  padding: 20px 16px;
  overflow-y: auto;
  align-items: flex-start;
  justify-content: center;
}

.cart-modal-card {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 600px;
  margin: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  overflow: hidden;
  animation: cartIn .25s ease;
}

@keyframes cartIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}


/* ─── Cart header ─── */
.cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid #ececec;
  background: #111;
  color: #fff;
}
.cart-header h3 {
  margin: 0;
  font-size: 1.1em;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #2bbbac;
}
.cart-close {
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.2);
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1.1em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s;
}
.cart-close:hover {
  background: rgba(255,255,255,.2);
}


/* ─── Empty state ─── */
.cart-empty {
  padding: 60px 24px;
  text-align: center;
  color: #888;
}
.cart-empty-icon {
  font-size: 3em;
  color: #ddd;
  margin-bottom: 12px;
}
.cart-empty p {
  margin: 0;
  font-size: .9em;
  text-align: center;
}


/* ─── Cart body ─── */
.cart-body {
  padding: 16px 24px;
  overflow-y: auto;
  flex: 1;
}


/* ─── Individual cart line item ─── */
.cart-item {
  display: grid;
  grid-template-columns: 70px 1fr auto;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid #f0f0f0;
  align-items: center;
}
.cart-item:last-child {
  border-bottom: none;
}

.cart-item-img {
  width: 70px;
  height: 70px;
  object-fit: contain;
  background: #f8f8f5;
  border-radius: 8px;
  padding: 4px;
}

.cart-item-info {
  min-width: 0;
}

.cart-item-name {
  font-size: .85em;
  font-weight: 700;
  color: #111;
  margin-bottom: 4px;
  line-height: 1.3;
}

.cart-item-price {
  font-size: .75em;
  color: #888;
  margin-bottom: 8px;
}

.cart-item-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.cart-qty-btn {
  width: 26px;
  height: 26px;
  border: 1px solid #ddd;
  background: #fff;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1em;
  font-weight: 700;
  color: #444;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, border-color .15s;
}
.cart-qty-btn:hover {
  background: #f4f4f0;
  border-color: #2bbbac;
}

.cart-qty {
  font-size: .85em;
  font-weight: 700;
  color: #111;
  min-width: 24px;
  text-align: center;
}

.cart-remove {
  margin-left: 8px;
  background: transparent;
  border: none;
  color: #c00;
  font-size: 1.2em;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  opacity: .6;
  transition: opacity .15s;
}
.cart-remove:hover {
  opacity: 1;
}

.cart-item-total {
  font-size: .9em;
  font-weight: 800;
  color: #111;
  white-space: nowrap;
}


/* ─── Cart footer (total + checkout) ─── */
.cart-footer {
  display: none;            /* shown by JS when cart has items */
  flex-direction: column;
  gap: 12px;
  padding: 18px 24px 22px;
  border-top: 1px solid #ececec;
  background: #fafaf8;
}

.cart-total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.cart-total-label {
  font-size: .8em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: #555;
}
.cart-total-amount {
  font-size: 1.3em;
  font-weight: 800;
  color: #111;
}

.cart-checkout-btn {
  background: #25D366;        /* WhatsApp green */
  color: #fff;
  border: none;
  padding: 14px;
  border-radius: 10px;
  font-size: .9em;
  font-weight: 700;
  letter-spacing: .04em;
  cursor: pointer;
  text-transform: uppercase;
  transition: background .2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.cart-checkout-btn:hover {
  background: #1DA851;
}
.cart-checkout-btn .fa {
  font-size: 1.3em;
}

.cart-clear-link {
  text-align: center;
  font-size: .75em;
  color: #888;
  background: transparent;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  padding: 4px;
}
.cart-clear-link:hover {
  color: #c00;
}


/* ─── Toast notification ─── */
.cart-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: #111;
  color: #fff;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: .85em;
  font-weight: 600;
  box-shadow: 0 6px 20px rgba(0,0,0,.25);
  z-index: 1100;
  opacity: 0;
  transition: transform .3s ease, opacity .3s ease;
  pointer-events: none;
}
.cart-toast--visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}


/* ─── Mobile tweaks ─── */
@media (max-width: 480px) {
  .cart-item {
    grid-template-columns: 60px 1fr;
    grid-template-areas:
      "img info"
      "img total";
    gap: 10px;
  }
  .cart-item-img { grid-area: img; }
  .cart-item-info { grid-area: info; }
  .cart-item-total {
    grid-area: total;
    text-align: left;
    font-size: .85em;
  }

  .cart-modal-card {
    max-height: 95vh;
  }
}
