/* ==========================================================================
   PEETHMART® BRAND COMPONENTS
   Cart Drawer, Quick View Modal, B2B Forms, Toast System
   ========================================================================== */

/* Backdrop overlay */
.pm-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(43, 24, 16, 0.65);
  backdrop-filter: blur(5px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.pm-modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

/* ==========================================================================
   SLIDING CART DRAWER (QUICKCOMMERCE STYLE)
   ========================================================================== */
.cart-drawer-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(43, 24, 16, 0.55);
  backdrop-filter: blur(4px);
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.cart-drawer-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.cart-drawer-panel {
  position: fixed;
  top: 0;
  right: -440px;
  bottom: 0;
  width: 100%;
  max-width: 420px;
  background: #ffffff;
  box-shadow: -8px 0 24px rgba(65, 41, 24, 0.2);
  z-index: 1001;
  display: flex;
  flex-direction: column;
  transition: right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.cart-drawer-panel.active {
  right: 0;
}

.cart-drawer-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--pm-light-grey);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #ffffff;
}

.cart-header-title-box h3 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--pm-deep-brown);
}

.cart-header-title-box p {
  font-size: 0.78rem;
  color: var(--pm-orange);
  font-weight: 700;
}

.cart-close-btn {
  background: var(--pm-off-white);
  border: 1px solid var(--pm-warm-sand);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  color: var(--pm-deep-brown);
  transition: background var(--transition-fast);
}

.cart-close-btn:hover {
  background: var(--pm-grain-beige);
}

/* Free Delivery Threshold Bar */
.cart-free-shipping-bar {
  background: var(--pm-grain-beige);
  border-bottom: 1px solid var(--pm-warm-sand);
  padding: 10px 20px;
}

.free-ship-label {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--pm-deep-brown);
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
}

.ship-progress-track {
  width: 100%;
  height: 6px;
  background: #ffffff;
  border-radius: var(--pm-radius-full);
  overflow: hidden;
  border: 1px solid var(--pm-warm-sand);
}

.ship-progress-fill {
  height: 100%;
  background: var(--pm-orange);
  border-radius: var(--pm-radius-full);
  width: 0%;
  transition: width 0.3s ease;
}

/* Cart Items Scrollable Container */
.cart-items-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.cart-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  color: var(--pm-stone-grey);
  padding: 30px;
}

.cart-empty-state .icon {
  font-size: 3.5rem;
  margin-bottom: 12px;
}

.cart-empty-state h4 {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--pm-deep-brown);
  margin-bottom: 4px;
}

.cart-empty-state p {
  font-size: 0.85rem;
  margin-bottom: 20px;
  color: var(--pm-muted-text);
}

.btn-start-shopping {
  background: var(--pm-orange);
  color: #fff;
  border: none;
  padding: 10px 22px;
  border-radius: var(--pm-radius-full);
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(238, 126, 36, 0.3);
}

/* Individual Cart Item Card */
.cart-item-card {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--pm-light-grey);
  border-radius: var(--pm-radius-md);
  background: var(--pm-off-white);
}

.cart-item-icon {
  width: 48px;
  height: 48px;
  background: #ffffff;
  border-radius: var(--pm-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  border: 1px solid var(--pm-warm-sand);
}

.cart-item-details h5 {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--pm-deep-brown);
  line-height: 1.25;
}

.cart-item-variant {
  font-size: 0.74rem;
  color: var(--pm-muted-text);
  font-weight: 600;
}

.cart-item-price-each {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--pm-deep-brown);
}

.cart-item-stepper-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.cart-subtotal-price {
  font-size: 0.92rem;
  font-weight: 900;
  color: var(--pm-deep-brown);
}

/* Promo Code Box */
.cart-promo-section {
  padding: 12px 20px;
  background: #ffffff;
  border-top: 1px solid var(--pm-light-grey);
}

.promo-input-row {
  display: flex;
  gap: 8px;
}

.promo-input {
  flex: 1;
  padding: 8px 12px;
  border: 1.5px dashed var(--pm-stone-grey);
  border-radius: var(--pm-radius-sm);
  font-size: 0.84rem;
  font-weight: 700;
  text-transform: uppercase;
  outline: none;
}

.promo-input:focus {
  border-color: var(--pm-orange);
}

.promo-apply-btn {
  background: var(--pm-deep-brown);
  color: #ffffff;
  border: none;
  padding: 8px 16px;
  border-radius: var(--pm-radius-sm);
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
}

.promo-hint {
  font-size: 0.72rem;
  color: var(--pm-muted-text);
  margin-top: 6px;
}

.promo-applied-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--pm-grain-beige);
  color: var(--pm-deep-brown);
  font-size: 0.78rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: var(--pm-radius-sm);
  margin-top: 6px;
}

/* Bill Details in Drawer */
.cart-bill-details {
  padding: 14px 20px;
  background: var(--pm-off-white);
  border-top: 1px solid var(--pm-light-grey);
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.84rem;
}

.bill-row {
  display: flex;
  justify-content: space-between;
  color: var(--pm-muted-text);
}

.bill-row.discount-row {
  color: var(--pm-orange);
  font-weight: 700;
}

.bill-row.grand-total {
  font-size: 1.05rem;
  font-weight: 900;
  color: var(--pm-deep-brown);
  border-top: 1px dashed var(--pm-warm-sand);
  padding-top: 8px;
  margin-top: 4px;
}

/* Cart Drawer Footer CTA */
.cart-drawer-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--pm-light-grey);
  background: #ffffff;
}

.btn-proceed-checkout {
  width: 100%;
  background: var(--pm-orange);
  color: #ffffff;
  border: none;
  padding: 13px 20px;
  border-radius: var(--pm-radius-md);
  font-weight: 800;
  font-size: 0.98rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 4px 14px rgba(238, 126, 36, 0.35);
  transition: background var(--transition-fast);
}

.btn-proceed-checkout:hover {
  background: var(--pm-earth-clay);
}

/* ==========================================================================
   QUICK VIEW PRODUCT MODAL
   ========================================================================== */
.quick-view-modal {
  background: #ffffff;
  width: 90%;
  max-width: 740px;
  border-radius: var(--pm-radius-lg);
  box-shadow: var(--pm-shadow-xl);
  overflow: hidden;
  position: relative;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  animation: modalPopIn 0.25s ease;
  border: 1.5px solid var(--pm-warm-sand);
}

@keyframes modalPopIn {
  from { transform: scale(0.94); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-close-icon {
  position: absolute;
  top: 16px;
  right: 16px;
  background: var(--pm-off-white);
  border: 1px solid var(--pm-warm-sand);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  z-index: 10;
  color: var(--pm-deep-brown);
}

.modal-close-icon:hover {
  background: var(--pm-grain-beige);
}

.quick-view-body {
  padding: 24px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 24px;
}

.qv-media-col {
  background: var(--pm-grain-beige);
  border-radius: var(--pm-radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  border: 1px solid var(--pm-warm-sand);
}

.qv-large-icon {
  font-size: 5rem;
  margin-bottom: 12px;
}

.qv-content-col h3 {
  font-family: var(--font-heading);
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--pm-deep-brown);
  line-height: 1.25;
  margin-bottom: 8px;
}

.qv-desc {
  font-size: 0.9rem;
  color: var(--pm-muted-text);
  line-height: 1.55;
  margin-bottom: 16px;
}

.nutrition-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
  margin-bottom: 16px;
  background: var(--pm-off-white);
  border-radius: var(--pm-radius-sm);
  overflow: hidden;
}

.nutrition-table th, .nutrition-table td {
  padding: 6px 10px;
  border: 1px solid var(--pm-light-grey);
  text-align: left;
}

.nutrition-table th {
  background: var(--pm-grain-beige);
  font-weight: 700;
  color: var(--pm-deep-brown);
}

.qv-highlight-box {
  background: var(--pm-grain-beige);
  border-left: 4px solid var(--pm-orange);
  padding: 10px 14px;
  border-radius: 0 var(--pm-radius-sm) var(--pm-radius-sm) 0;
  font-size: 0.82rem;
  color: var(--pm-deep-brown);
  margin-bottom: 16px;
}

.qv-highlight-box strong {
  display: block;
  font-size: 0.85rem;
  margin-bottom: 2px;
}

/* ==========================================================================
   TOAST NOTIFICATION ENGINE
   ========================================================================== */
.pm-toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.pm-toast {
  background: var(--pm-deep-brown);
  color: #ffffff;
  padding: 12px 18px;
  border-radius: var(--pm-radius-md);
  font-size: 0.88rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 10px 25px rgba(65, 41, 24, 0.3);
  pointer-events: auto;
  animation: toastSlideUp 0.25s ease;
  max-width: 360px;
}

.pm-toast.toast-success {
  border-left: 4px solid var(--pm-orange);
}

.pm-toast.toast-warning {
  border-left: 4px solid var(--pm-harvest-yellow);
}

.pm-toast.toast-info {
  border-left: 4px solid var(--pm-sky-blue);
}

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

@media (max-width: 650px) {
  .quick-view-body {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .cart-drawer-panel {
    max-width: 100%;
  }
}

/* ==========================================================================
   TEMPORARY DEMO / UNDER CONSTRUCTION POPUP & BADGE
   ========================================================================== */
.demo-modal-box {
  background: #ffffff;
  width: 90%;
  max-width: 520px;
  border-radius: var(--pm-radius-lg);
  box-shadow: 0 20px 40px rgba(65, 41, 24, 0.35);
  border: 2px solid var(--pm-orange);
  overflow: hidden;
  position: relative;
  animation: modalPopIn 0.28s ease;
  z-index: 10001;
}

.demo-modal-header {
  background: var(--pm-grain-beige);
  border-bottom: 1.5px solid var(--pm-warm-sand);
  padding: 20px 24px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.demo-modal-header h3 {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  color: var(--pm-deep-brown);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.demo-modal-body {
  padding: 22px 24px 16px;
  font-size: 0.9rem;
  color: var(--pm-dark-text);
  line-height: 1.6;
}

.demo-highlight-banner {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-left: 4px solid var(--pm-harvest-yellow);
  padding: 12px 14px;
  border-radius: var(--pm-radius-sm);
  margin-bottom: 16px;
  font-size: 0.84rem;
  color: #92400e;
}

.demo-modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  padding: 16px 24px 20px;
  background: var(--pm-off-white);
  border-top: 1px solid var(--pm-warm-sand);
}

.demo-btn-primary {
  background: var(--pm-orange);
  color: #ffffff;
  border: none;
  padding: 10px 22px;
  border-radius: var(--pm-radius-full);
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  transition: var(--transition-fast);
}

.demo-btn-primary:hover {
  background: var(--pm-earth-clay);
}

.demo-btn-secondary {
  color: var(--pm-deep-brown);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
}

.demo-floating-badge {
  position: fixed;
  bottom: 20px;
  left: 20px;
  background: #fef3c7;
  color: #92400e;
  border: 1.5px solid #f59e0b;
  padding: 7px 16px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 800;
  cursor: pointer;
  z-index: 9998;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.14);
  transition: transform 0.2s ease, background 0.2s ease;
}

.demo-floating-badge:hover {
  transform: scale(1.05);
  background: #fde68a;
}
