/* ============================================================
   HOMEPAGE CART — FAB, Drawer, Customization Sheet, Toast
   ============================================================ */

/* --- Floating Action Button --- */
/* Positioned above the Instagram badge (56px at bottom:28px) */
.hp-cart-fab {
  position: fixed;
  bottom: 100px;
  right: 28px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--terracotta);
  color: #fff;
  border: none;
  cursor: pointer;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  box-shadow: 0 4px 16px rgba(196, 107, 74, 0.4);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hp-cart-fab.visible {
  display: flex;
}

.hp-cart-fab:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 24px rgba(196, 107, 74, 0.5);
}

.hp-cart-fab-count {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 100px;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.hp-cart-fab-total {
  position: absolute;
  bottom: -18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  font-weight: 600;
  color: var(--terracotta);
  white-space: nowrap;
  background: var(--bg-card);
  padding: 2px 8px;
  border-radius: 100px;
  border: 1px solid var(--border-subtle);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

/* --- Overlay (shared by drawer + sheet) --- */
.hp-cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 1001;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.hp-cart-overlay.open {
  opacity: 1;
  visibility: visible;
}

/* --- Cart Drawer --- */
.hp-cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 400px;
  max-width: 100vw;
  height: 100vh;
  background: var(--bg-primary);
  z-index: 1002;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  display: flex;
  flex-direction: column;
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.12);
}

.hp-cart-drawer.open {
  transform: translateX(0);
}

.hp-cart-drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.hp-cart-drawer-header h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.hp-cart-drawer-close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}

.hp-cart-drawer-close:hover {
  color: var(--text-primary);
}

.hp-cart-drawer-items {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px;
}

.hp-cart-drawer-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-secondary);
  font-size: 14px;
}

/* --- Cart Item in Drawer --- */
.hp-cart-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.hp-cart-item:last-child {
  border-bottom: none;
}

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

.hp-cart-item-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.hp-cart-item-addons {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.hp-cart-item-unit {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.hp-cart-item-qty {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.hp-cart-item-qty button {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--border-subtle);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  padding: 0;
}

.hp-cart-item-qty button:hover {
  background: var(--terracotta);
  color: #fff;
  border-color: var(--terracotta);
}

.hp-cart-item-qty span {
  min-width: 18px;
  text-align: center;
  font-weight: 600;
  font-size: 13px;
  color: var(--text-primary);
}

.hp-cart-item-total {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
  min-width: 55px;
  text-align: right;
  flex-shrink: 0;
}

.hp-cart-item-remove {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 16px;
  cursor: pointer;
  padding: 2px;
  opacity: 0.5;
  transition: opacity 0.2s, color 0.2s;
  flex-shrink: 0;
}

.hp-cart-item-remove:hover {
  opacity: 1;
  color: #ef4444;
}

/* --- Cart Drawer Footer (Total + Checkout) --- */
.hp-cart-drawer-footer {
  border-top: 2px solid var(--text-primary);
  padding: 16px 24px 24px;
  flex-shrink: 0;
}

.hp-cart-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.hp-cart-total-label {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.hp-cart-total-amount {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 700;
  color: var(--terracotta);
}

.hp-cart-form-group {
  margin-bottom: 10px;
}

.hp-cart-form-group label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.hp-cart-form-group input,
.hp-cart-form-group textarea {
  width: 100%;
  padding: 8px 12px;
  font-size: 13px;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  box-sizing: border-box;
}

.hp-cart-form-group textarea {
  resize: vertical;
  min-height: 50px;
}

.hp-cart-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.hp-cart-submit {
  width: 100%;
  padding: 12px;
  font-size: 14px;
  font-weight: 600;
  background: var(--terracotta);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-family: var(--font-sans);
  transition: background 0.2s ease;
  margin-top: 4px;
}

.hp-cart-submit:hover {
  background: var(--brown);
}

.hp-cart-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.hp-cart-msg {
  font-size: 12px;
  color: #ef4444;
  margin-top: 6px;
}

/* --- Customization Modal --- */
.hp-customize-sheet {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.92);
  width: calc(100% - 32px);
  max-width: 440px;
  max-height: 85vh;
  overflow-y: auto;
  background: var(--bg-primary);
  border-radius: var(--radius-xl);
  z-index: 1003;
  padding: 28px;
  box-sizing: border-box;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.18), 0 0 0 1px var(--border-subtle);
  opacity: 0;
  visibility: hidden;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s ease, visibility 0.3s ease;
}

.hp-customize-sheet.open {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
  visibility: visible;
}

.hp-customize-sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 1002;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.hp-customize-sheet-overlay.open {
  opacity: 1;
  visibility: visible;
}

.hp-customize-handle {
  display: none;
}

.hp-customize-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
}

.hp-customize-header h4 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 2px 0;
}

.hp-customize-header .hp-customize-base-price {
  font-size: 14px;
  color: var(--text-secondary);
}

.hp-customize-close {
  background: none;
  border: none;
  font-size: 22px;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.hp-customize-section-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.hp-customize-addons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.hp-customize-addon {
  padding: 8px 14px;
  border-radius: 100px;
  border: 1.5px solid var(--border-medium);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.hp-customize-addon:hover {
  border-color: var(--terracotta);
}

.hp-customize-addon.active {
  background: rgba(196, 107, 74, 0.1);
  border-color: var(--terracotta);
  color: var(--terracotta);
  font-weight: 600;
}

.hp-customize-addon-price {
  opacity: 0.7;
  font-size: 11px;
}

.hp-customize-qty-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.hp-customize-qty-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

.hp-customize-qty {
  display: flex;
  align-items: center;
  gap: 12px;
}

.hp-customize-qty button {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1.5px solid var(--border-medium);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  padding: 0;
}

.hp-customize-qty button:hover {
  background: var(--terracotta);
  color: #fff;
  border-color: var(--terracotta);
}

.hp-customize-qty span {
  min-width: 24px;
  text-align: center;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.hp-customize-footer {
  display: flex;
  gap: 12px;
  align-items: center;
}

.hp-customize-total {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 700;
  color: var(--terracotta);
  white-space: nowrap;
}

.hp-customize-submit {
  flex: 1;
  padding: 14px;
  font-size: 14px;
  font-weight: 600;
  background: var(--terracotta);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-family: var(--font-sans);
  transition: background 0.2s ease;
}

.hp-customize-submit:hover {
  background: var(--brown);
}

/* --- Toast --- */
.hp-toast {
  position: fixed;
  bottom: 174px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--brown-dark);
  color: #fff;
  padding: 10px 20px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 500;
  z-index: 1010;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.hp-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* --- Menu card cursor on homepage --- */
.menu-section .menu-card[data-item] {
  cursor: pointer;
}

.menu-section .menu-card[data-item]:active {
  transform: scale(0.98);
}

/* --- Vastram card cursor on homepage --- */
.vastram-section .vastram-card[data-item] {
  cursor: pointer;
}

/* ============================================================
   DARK MODE
   ============================================================ */
[data-theme="dark"] .hp-cart-drawer {
  background: var(--bg-primary);
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .hp-customize-sheet {
  background: var(--bg-primary);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5), 0 0 0 1px var(--border-medium);
}

[data-theme="dark"] .hp-cart-fab-total {
  background: var(--bg-card);
}

[data-theme="dark"] .hp-cart-item-qty button,
[data-theme="dark"] .hp-customize-qty button {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .hp-cart-form-group input,
[data-theme="dark"] .hp-cart-form-group textarea {
  background: var(--bg-card);
  border-color: var(--border-medium);
}

[data-theme="dark"] .hp-customize-addon {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border-medium);
}

[data-theme="dark"] .hp-toast {
  background: #f5f0eb;
  color: #1a1a1a;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 640px) {
  .hp-cart-fab {
    bottom: 90px;
    right: 20px;
    width: 52px;
    height: 52px;
    font-size: 22px;
  }

  .hp-cart-drawer {
    width: 100vw;
  }

  .hp-cart-drawer-header {
    padding: 16px 20px;
  }

  .hp-cart-drawer-items {
    padding: 12px 20px;
  }

  .hp-cart-drawer-footer {
    padding: 12px 20px 20px;
  }

  .hp-cart-form-row {
    grid-template-columns: 1fr;
  }

  .hp-customize-sheet {
    width: calc(100% - 24px);
    padding: 20px;
    border-radius: var(--radius-lg);
  }

  .hp-toast {
    bottom: 160px;
    font-size: 12px;
  }
}
