/* ==========================================================================
   VERDÉ — Components Stylesheet
   Modals, Drawers, Toasts, Form Controls & Interactive Overlays
   ========================================================================== */

/* Overlay Backdrop */
.modal-backdrop,
.drawer-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(16, 37, 24, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 1000;
}

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

/* ==========================================================================
   Cart Drawer (Slide-over from right)
   ========================================================================== */

.cart-drawer {
  position: fixed;
  top: 0;
  right: -420px;
  width: min(400px, 90vw);
  height: 100vh;
  background-color: #ffffff;
  z-index: 1001;
  box-shadow: -8px 0 30px rgba(0, 0, 0, 0.12);
  display: flex;
  flex-direction: column;
  transition: right 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.cart-drawer.open {
  right: 0;
}

.cart-header {
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--color-border);
}

.cart-title {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 700;
  color: var(--color-primary);
}

.btn-close {
  background: none;
  border: none;
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  transition:
    background-color 0.2s,
    color 0.2s;
}

.btn-close:hover {
  background-color: var(--color-bg-subtle);
  color: var(--color-primary);
}

.cart-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.cart-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  color: var(--color-text-muted);
  gap: 12px;
}

.cart-item {
  display: flex;
  gap: 16px;
  align-items: center;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--color-border);
}

.cart-item-img {
  width: 68px;
  height: 68px;
  border-radius: 8px;
  object-fit: cover;
  background-color: #f0f2ef;
}

.cart-item-details {
  flex: 1;
}

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

.cart-item-meta {
  font-size: 12px;
  color: var(--color-muted-olive);
  margin-bottom: 8px;
}

.cart-item-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cart-item-price {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-primary);
}

.qty-control {
  display: flex;
  align-items: center;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  overflow: hidden;
}

.qty-btn {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--color-text-main);
  background-color: var(--color-bg-subtle);
  transition: background-color 0.2s;
}

.qty-btn:hover {
  background-color: #e5e7eb;
}

.qty-val {
  width: 28px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
}

.cart-item-remove {
  color: #9ca3af;
  margin-left: 8px;
  transition: color 0.2s;
}

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

.cart-footer {
  padding: 24px;
  border-top: 1px solid var(--color-border);
  background-color: #fafbfa;
}

.cart-subtotal-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  font-size: 15px;
}

.cart-subtotal-val {
  font-weight: 700;
  font-size: 17px;
  color: var(--color-primary);
}

.btn-checkout {
  width: 100%;
  background-color: var(--color-primary);
  color: #ffffff;
  padding: 14px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-radius: var(--radius-sm);
  transition:
    background-color 0.2s,
    transform 0.1s;
}

.btn-checkout:hover {
  background-color: var(--color-primary-hover);
}

/* ==========================================================================
   Sign In & Register Modal
   ========================================================================== */

.modal-container {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -46%) scale(0.96);
  width: min(440px, 92vw);
  background-color: #ffffff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-dropdown);
  z-index: 1002;
  opacity: 0;
  pointer-events: none;
  transition:
    transform 0.25s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.25s ease;
  overflow: hidden;
}

.modal-container.open {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.modal-header {
  padding: 24px 28px 16px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.auth-tabs {
  display: flex;
  gap: 16px;
  border-bottom: 2px solid var(--color-border);
  width: 100%;
}

.auth-tab {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 600;
  color: var(--color-text-muted);
  padding-bottom: 8px;
  position: relative;
  cursor: pointer;
}

.auth-tab.active {
  color: var(--color-primary);
}

.auth-tab.active::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--color-primary);
}

.modal-body {
  padding: 24px 28px 32px 28px;
}

.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
  outline: none;
}

.form-input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(16, 37, 24, 0.08);
}

.form-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
  font-size: 12.5px;
}

.form-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--color-text-muted);
  cursor: pointer;
}

.form-forgot {
  color: var(--color-accent);
  text-decoration: none;
}

.form-forgot:hover {
  text-decoration: underline;
}

.btn-submit {
  width: 100%;
  background-color: var(--color-primary);
  color: #ffffff;
  padding: 13px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-radius: var(--radius-sm);
  transition: background-color 0.2s;
}

.btn-submit:hover {
  background-color: var(--color-primary-hover);
}

/* ==========================================================================
   Search Overlay Modal
   ========================================================================== */

.search-modal {
  position: fixed;
  top: 15%;
  left: 50%;
  transform: translate(-50%, -20px);
  width: min(560px, 92vw);
  background-color: #ffffff;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-dropdown);
  z-index: 1002;
  opacity: 0;
  pointer-events: none;
  transition:
    transform 0.25s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.25s ease;
  overflow: hidden;
}

.search-modal.open {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0);
}

.search-box-wrapper {
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid var(--color-border);
}

.search-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 16px;
  font-family: inherit;
  color: var(--color-text-main);
}

.search-suggestions {
  padding: 20px 24px;
}

.search-sugg-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-muted-olive);
  margin-bottom: 12px;
}

.sugg-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sugg-chip {
  padding: 6px 14px;
  background-color: var(--color-bg-subtle);
  border-radius: 20px;
  font-size: 13px;
  color: var(--color-text-main);
  cursor: pointer;
  transition:
    background-color 0.2s,
    color 0.2s;
}

.sugg-chip:hover {
  background-color: var(--color-primary);
  color: #ffffff;
}

/* ==========================================================================
   Mobile Navigation Drawer
   ========================================================================== */

.mobile-nav-drawer {
  position: fixed;
  top: 0;
  left: -280px;
  width: 270px;
  height: 100vh;
  background-color: #ffffff;
  z-index: 1001;
  box-shadow: 8px 0 24px rgba(0, 0, 0, 0.1);
  padding: 24px;
  display: flex;
  flex-direction: column;
  transition: left 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.mobile-nav-drawer.open {
  left: 0;
}

.mobile-nav-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 32px;
}

.mobile-nav-link {
  font-size: 17px;
  font-weight: 600;
  color: var(--color-primary);
  display: block;
}

/* ==========================================================================
   Toast Notifications
   ========================================================================== */

.toast-container {
  position: fixed;
  bottom: 28px;
  right: 28px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 1050;
  pointer-events: none;
}

.toast-message {
  background-color: var(--color-primary);
  color: #ffffff;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0;
  transform: translateY(16px);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: auto;
}

.toast-message.show {
  opacity: 1;
  transform: translateY(0);
}

/* Profile picture / generic profile icon */
.profile-avatar {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  overflow: hidden;
  text-decoration: none;
}

/* Logged-in user's profile picture */
.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

/* Generic profile icon when no picture exists */
.profile-avatar svg {
  width: 26px;
  height: 26px;
}
