/* ==========================================================================
   ORGANIC STORE - MODERN E-COMMERCE CORE STYLES (app.css)
   ========================================================================== */

:root {
  --primary-color: #70bb00;
  --primary-hover: #5da000;
  --primary-light: #eaf8d9;
  --secondary-color: #2c3e50;
  --text-dark: #222222;
  --text-muted: #777777;
  --bg-light: #f9fbf8;
  --border-color: #e5e9e2;
  --danger-color: #e74c3c;
  --warning-color: #f39c12;
  --success-color: #27ae60;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-md: 0 6px 20px rgba(0,0,0,0.09);
  --shadow-lg: 0 15px 35px rgba(0,0,0,0.14);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --transition: all 0.25s ease-in-out;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
  color: var(--text-dark);
  background-color: #ffffff;
}

/* User Dropdown in Navbar */
.user-dropdown-container {
  position: relative;
  display: inline-block;
}

.user-profile-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f1f7e8;
  border: 1px solid #d4ecc0;
  padding: 6px 14px;
  border-radius: 25px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95em;
  color: #335500;
  transition: var(--transition);
}

.user-profile-btn:hover {
  background: #e2f2cd;
}

.user-avatar-badge {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary-color);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85em;
  font-weight: bold;
}

.user-dropdown-menu {
  display: none;
  position: absolute;
  right: 0;
  top: 115%;
  background: white;
  min-width: 220px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
  padding: 10px 0;
  z-index: 1000;
  animation: fadeIn 0.2s ease-in-out;
}

.user-dropdown-container:hover .user-dropdown-menu,
.user-dropdown-menu.show-menu {
  display: block;
}

.user-dropdown-header {
  padding: 8px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.user-dropdown-header small {
  color: var(--text-muted);
  font-size: 0.82em;
}

.user-dropdown-menu hr {
  border: none;
  border-top: 1px solid #eee;
  margin: 6px 0;
}

.user-dropdown-menu a, 
.user-dropdown-menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: 0.95em;
  color: var(--text-dark);
  text-decoration: none;
  width: 100%;
  border: none;
  background: none;
  text-align: left;
  cursor: pointer;
  box-sizing: border-box;
  transition: var(--transition);
}

.user-dropdown-menu a:hover, 
.user-dropdown-menu button:hover {
  background-color: var(--primary-light);
  color: var(--primary-hover);
}

.user-dropdown-menu button.logout-btn {
  color: var(--danger-color);
}
.user-dropdown-menu button.logout-btn:hover {
  background-color: #fde8e8;
  color: var(--danger-color);
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.72em;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.badge-admin {
  background: #fee2e2;
  color: #b91c1c;
}
.badge-user {
  background: #dcfce7;
  color: #15803d;
}

.nav-login-link {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 1.05em;
  font-weight: 600;
  color: #333;
  padding: 6px 12px;
  border-radius: 6px;
  transition: var(--transition);
}
.nav-login-link:hover {
  color: var(--primary-color);
  background: #f4faed;
}

/* Toast Notification Styles */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  min-width: 300px;
  max-width: 420px;
  background: white;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
  border-left: 5px solid #ccc;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  transform: translateX(120%);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease;
  opacity: 0;
}

.toast.show {
  transform: translateX(0);
  opacity: 1;
}

.toast-icon {
  font-size: 1.3em;
}

.toast-message {
  flex: 1;
  font-size: 0.95em;
  line-height: 1.4;
}

.toast-close {
  background: none;
  border: none;
  color: #999;
  cursor: pointer;
  font-size: 1em;
  padding: 4px;
}
.toast-close:hover {
  color: #333;
}

.toast-success {
  border-left-color: var(--success-color);
}
.toast-success .toast-icon {
  color: var(--success-color);
}

.toast-error {
  border-left-color: var(--danger-color);
}
.toast-error .toast-icon {
  color: var(--danger-color);
}

.toast-warning {
  border-left-color: var(--warning-color);
}
.toast-warning .toast-icon {
  color: var(--warning-color);
}

.toast-info {
  border-left-color: var(--primary-color);
}
.toast-info .toast-icon {
  color: var(--primary-color);
}

/* Side Cart Drawer */
.cart-drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  display: none;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.cart-drawer-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  display: block;
}

.side-cart-drawer {
  position: fixed;
  top: 0;
  right: -450px;
  width: 100%;
  max-width: 420px;
  height: 100vh;
  background: white;
  box-shadow: -5px 0 25px rgba(0,0,0,0.15);
  z-index: 9999;
  display: none;
  flex-direction: column;
  transition: right 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.side-cart-drawer.open {
  right: 0;
  display: flex;
}

.cart-drawer-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fafdf7;
}

.cart-drawer-header .header-title {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--primary-color);
}

.cart-drawer-header h3 {
  font-size: 1.25em;
  margin: 0;
  color: var(--text-dark);
}

.close-drawer-btn {
  background: none;
  border: none;
  font-size: 1.3em;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  transition: var(--transition);
}

.close-drawer-btn:hover {
  background: #eee;
  color: #111;
}

.cart-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
}

.free-shipping-bar {
  background: #f0f9e8;
  border: 1px solid #d9f0c2;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 18px;
  font-size: 0.88em;
}

.free-shipping-bar .bar-msg {
  margin-bottom: 6px;
  color: #335500;
}

.progress-track {
  width: 100%;
  height: 6px;
  background: #d4ecc0;
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--primary-color);
  transition: width 0.4s ease;
}

.cart-drawer-item {
  display: flex;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid #f0f0f0;
  align-items: center;
}

.cart-drawer-item .item-img {
  width: 65px;
  height: 65px;
  object-fit: contain;
  background: #fcfcfc;
  border-radius: var(--radius-sm);
  border: 1px solid #eee;
}

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

.cart-drawer-item .item-title {
  font-size: 0.95em;
  margin: 0 0 4px;
  font-weight: 600;
  color: #222;
}

.cart-drawer-item .item-unit {
  font-size: 0.8em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.cart-drawer-item .item-price {
  font-weight: bold;
  color: var(--primary-color);
  font-size: 0.95em;
}

.quantity-controller {
  display: inline-flex;
  align-items: center;
  border: 1px solid #ddd;
  border-radius: 4px;
  margin-top: 6px;
  overflow: hidden;
  background: #fff;
}

.quantity-controller .qty-btn {
  background: #f5f5f5;
  border: none;
  padding: 4px 10px;
  cursor: pointer;
  font-weight: bold;
  color: #555;
  transition: var(--transition);
}

.quantity-controller .qty-btn:hover {
  background: #e0e0e0;
}

.quantity-controller .qty-val {
  padding: 4px 10px;
  font-size: 0.9em;
  font-weight: 600;
  min-width: 20px;
  text-align: center;
}

.cart-drawer-item .item-action {
  text-align: right;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-end;
  height: 65px;
}

.item-line-total {
  font-weight: 700;
  font-size: 1.05em;
}

.btn-remove-item {
  background: none;
  border: none;
  color: #bbb;
  cursor: pointer;
  font-size: 1em;
  transition: var(--transition);
}

.btn-remove-item:hover {
  color: var(--danger-color);
}

.cart-drawer-footer {
  padding: 18px 22px;
  border-top: 1px solid var(--border-color);
  background: #fafdf7;
}

.drawer-summary {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.95em;
  color: #555;
}

.summary-total {
  font-size: 1.2em;
  font-weight: bold;
  color: #111;
  border-top: 1px dashed #ccc;
  padding-top: 8px;
  margin-top: 4px;
}

.summary-total .total-amount {
  color: var(--primary-color);
}

.drawer-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-view-cart {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px;
  background: #f0f7e8;
  color: #3f6e02;
  border-radius: var(--radius-sm);
  font-weight: 600;
  text-decoration: none;
  border: 1px solid #d4ecc0;
  transition: var(--transition);
}
.btn-view-cart:hover {
  background: #e2f2cd;
}

.btn-checkout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px;
  background: var(--primary-color);
  color: white;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 1.05em;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(112, 187, 0, 0.35);
  transition: var(--transition);
}
.btn-checkout:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.empty-cart-view {
  text-align: center;
  padding: 40px 20px;
}

.empty-cart-icon {
  font-size: 3.5em;
  color: #b5e478;
  margin-bottom: 15px;
}

.btn-shop-empty {
  display: inline-block;
  margin-top: 15px;
  padding: 10px 24px;
  background: var(--primary-color);
  color: white;
  border-radius: 25px;
  font-weight: 600;
  text-decoration: none;
}

/* Modal Overlay & Quick View */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  display: none;
  transition: all 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  display: block;
}

.quick-view-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  width: 90%;
  max-width: 820px;
  max-height: 90vh;
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 10001;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  display: none;
  overflow-y: auto;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.quick-view-modal.open {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  display: block;
}

.modal-close-btn {
  position: absolute;
  top: 16px;
  right: 18px;
  background: #f5f5f5;
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  cursor: pointer;
  font-size: 1.1em;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #555;
  transition: var(--transition);
  z-index: 10;
}
.modal-close-btn:hover {
  background: #e0e0e0;
  color: #111;
}

.qv-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 25px;
  padding: 30px;
}

.qv-image-box {
  position: relative;
  background: #fbfdf9;
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-color);
}

.qv-main-img {
  max-width: 100%;
  max-height: 340px;
  object-fit: contain;
}

.organic-seal-badge {
  position: absolute;
  top: 15px;
  left: 15px;
  width: 50px;
}

.organic-seal-badge img {
  width: 100%;
}

.qv-details-box {
  display: flex;
  flex-direction: column;
}

.qv-cat-badge {
  color: var(--primary-color);
  font-weight: 700;
  font-size: 0.85em;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.qv-title {
  font-size: 1.8em;
  margin: 6px 0 10px;
  color: #1f2937;
}

.qv-rating-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.stars i {
  color: #f59e0b;
}

.rating-text {
  font-size: 0.85em;
  color: #666;
}

.qv-price-box {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 15px;
}

.qv-current-price {
  font-size: 2em;
  font-weight: 800;
  color: var(--primary-color);
}

.qv-old-price {
  font-size: 1.3em;
  color: #999;
  text-decoration: line-through;
}

.qv-unit {
  font-size: 0.95em;
  color: var(--text-muted);
}

.qv-desc {
  font-size: 0.95em;
  color: #555;
  line-height: 1.6;
  margin-bottom: 18px;
}

.qv-stock-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9em;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 6px;
  margin-bottom: 20px;
  width: fit-content;
}

.qv-stock-status.in-stock {
  background: #ecfdf5;
  color: #047857;
}

.qv-stock-status.out-stock {
  background: #fef2f2;
  color: #b91c1c;
}

.qv-actions-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.qv-qty-selector {
  display: flex;
  align-items: center;
  border: 1.5px solid #ccc;
  border-radius: 6px;
  overflow: hidden;
}

.qv-qty-btn {
  background: #f3f4f6;
  border: none;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: bold;
}

.qv-qty-selector input {
  width: 45px;
  border: none;
  text-align: center;
  font-weight: bold;
  font-size: 1em;
}

.qv-add-btn {
  flex: 1;
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 1.05em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition);
}
.qv-add-btn:hover {
  background: var(--primary-hover);
}

.qv-wish-btn {
  background: #f3f4f6;
  border: none;
  width: 45px;
  height: 45px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1.2em;
  color: #666;
  transition: var(--transition);
}
.qv-wish-btn.active {
  color: var(--danger-color);
  background: #fee2e2;
}

.qv-perks {
  border-top: 1px solid #eee;
  padding-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.88em;
  color: #444;
}

/* Product Cards Grid & Design */
.product-card {
  position: relative;
  background: white;
  border: 1px solid #e5e9e2;
  border-radius: 18px;
  padding: 18px;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 4px 16px rgba(0,0,0,0.03);
}

.product-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(45, 90, 0, 0.09);
  border-color: #bfe58f;
}

.badge-sale {
  position: absolute;
  top: 14px;
  left: 14px;
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
  font-size: 0.76em;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 30px;
  z-index: 2;
  box-shadow: 0 4px 10px rgba(239, 68, 68, 0.3);
}

.badge-bestseller {
  position: absolute;
  top: 14px;
  right: 14px;
  background: var(--primary-gradient);
  color: white;
  font-size: 0.74em;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 30px;
  z-index: 2;
  box-shadow: 0 4px 10px rgba(112, 187, 0, 0.3);
}

.card-img-container {
  position: relative;
  height: 210px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 14px;
  background: radial-gradient(circle, #fbfdf9 0%, #f4f8ee 100%);
  border: 1px solid #f0f4ec;
}

.product-thumb-img {
  max-height: 185px;
  max-width: 100%;
  object-fit: contain;
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.product-card:hover .product-thumb-img {
  transform: scale(1.08);
}

.product-actions-overlay {
  position: absolute;
  bottom: -50px;
  display: flex;
  gap: 10px;
  transition: bottom 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 5;
}

.product-card:hover .product-actions-overlay {
  bottom: 14px;
}

.action-btn {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(6px);
  border: 1px solid #e2e8f0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  box-shadow: 0 6px 16px rgba(0,0,0,0.12);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #334155;
  transition: all 0.25s ease;
}

.action-btn:hover {
  background: var(--primary-gradient);
  color: white;
  transform: scale(1.1);
  box-shadow: 0 8px 20px rgba(112, 187, 0, 0.4);
}

.action-btn.wishlist-btn.active {
  color: #ef4444;
  background: #fef2f2;
}

.product-info-cont {
  margin-top: 14px;
}

.product-cat {
  font-size: 0.78em;
  text-transform: uppercase;
  color: var(--primary-color);
  font-weight: 700;
  letter-spacing: 0.8px;
}

.product-name {
  font-size: 1.1em;
  margin: 6px 0 8px;
  font-weight: 700;
  line-height: 1.35;
}

.product-name a {
  color: #1e293b;
  transition: color 0.2s;
}

.product-name a:hover {
  color: var(--primary-color);
}

.product-rating {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  font-size: 0.85em;
}

.product-price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #f1f5f9;
}

.prices {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.curr-price {
  font-size: 1.3em;
  font-weight: 800;
  color: #166534;
}

.old-price {
  font-size: 0.92em;
  color: #94a3b8;
  text-decoration: line-through;
}

.btn-add-cart {
  background: #f0fdf4;
  border: 1.5px solid #bbf7d0;
  color: #15803d;
  padding: 8px 16px;
  border-radius: 30px;
  font-weight: 700;
  font-size: 0.9em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.25s ease;
  box-shadow: 0 2px 6px rgba(0,0,0,0.02);
}

.btn-add-cart:hover {
  background: var(--primary-gradient);
  color: white;
  border-color: transparent;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(112, 187, 0, 0.35);
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 768px) {
  .qv-grid {
    grid-template-columns: 1fr;
    padding: 20px;
  }
  .quick-view-modal {
    width: 95%;
  }
  .side-cart-drawer {
    max-width: 100%;
  }
}
