/* ============================================================
   Fashion & Home — Custom Styles
   Stack: HTML5 + Tailwind CSS CDN v3 + Vanilla JS
   ============================================================ */

/* ---- CSS Variables ---------------------------------------- */
:root {
  --primary-color: #1a1a1a;
  --accent-color: #d97706;
  --bg-color: #f9fafb;
  --text-color: #111827;
  --secondary-bg: #ffffff;
}

/* ---- Base -------------------------------------------------- */
body {
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: 'Outfit', sans-serif;
}

/* ---- Utility overrides for CSS variables ------------------- */
.bg-industrial-black {
  background-color: var(--primary-color) !important;
}

.text-accent-orange {
  color: var(--accent-color) !important;
}

.bg-accent-orange {
  background-color: var(--accent-color) !important;
}

.hover\:bg-accent-orange:hover {
  background-color: var(--accent-color) !important;
}

.hover\:text-accent-orange:hover {
  color: var(--accent-color) !important;
}

/* ---- Fade-in Animation ------------------------------------- */
.fade-in {
  animation: fadeIn 0.45s ease-in-out forwards;
}

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

/* ---- Page transition --------------------------------------- */
#app {
  transition: opacity 0.2s ease;
}

/* ---- Custom Scrollbar -------------------------------------- */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: #aaa;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #666;
}

/* ---- Loader Spinner --------------------------------------- */
.loader {
  border: 3px solid #e5e7eb;
  border-radius: 50%;
  border-top: 3px solid var(--accent-color);
  width: 32px;
  height: 32px;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}

@keyframes spin {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ---- Skeleton Loading ------------------------------------- */
.skeleton {
  background: linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
  border-radius: 4px;
}

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-card {
  background: #fff;
  border: 1px solid #f3f4f6;
}

/* ---- Product Image Container (4:5 aspect ratio) ----------- */
.product-image-container {
  position: relative;
  width: 100%;
  padding-bottom: 125%; /* 4:5 ratio */
  overflow: hidden;
  background-color: #f3f4f6;
}

.product-image-container img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease, opacity 0.3s ease;
}

.product-image-container:hover img {
  transform: scale(1.04);
}

/* ---- Toast Notifications ---------------------------------- */
#toast-container {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  padding: 0.75rem 1.25rem;
  border-radius: 6px;
  color: #fff;
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
  animation: toastIn 0.3s ease forwards;
  max-width: 340px;
  min-width: 220px;
}

.toast.toast-success {
  background-color: #1a1a1a;
  border-left: 4px solid var(--accent-color);
}

.toast.toast-error {
  background-color: #dc2626;
}

.toast.toast-info {
  background-color: #374151;
}

.toast.toast-out {
  animation: toastOut 0.3s ease forwards;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(110%); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(110%); }
}

/* ---- Mobile Menu ------------------------------------------ */
.mobile-menu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
}

.mobile-menu.open {
  max-height: 360px;
}

/* ---- Cart Dropdown hover fix ------------------------------ */
.cart-dropdown-wrapper {
  position: relative;
}

.cart-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  padding-top: 12px;
  width: 320px;
  z-index: 50;
}

.cart-dropdown-wrapper:hover .cart-dropdown {
  display: block;
}

/* ---- Smooth section transitions --------------------------- */
section {
  transition: background-color 0.3s ease;
}

/* ---- Hero scroll indicator -------------------------------- */
@keyframes bounceDown {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(8px); }
}

.scroll-indicator {
  animation: bounceDown 1.6s ease-in-out infinite;
}

/* ---- Aspect ratio helpers --------------------------------- */
.aspect-square {
  aspect-ratio: 1 / 1;
}

.aspect-4-5 {
  aspect-ratio: 4 / 5;
}

/* ---- Trust badge row -------------------------------------- */
.trust-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
}

/* ---- Form focus styles ------------------------------------ */
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(26, 26, 26, 0.12);
}

/* ---- Button transitions ----------------------------------- */
button,
a {
  transition: all 0.2s ease;
}

/* ---- Admin sidebar active tab ----------------------------- */
.admin-tab-active {
  background-color: rgba(217, 119, 6, 0.15);
  color: #d97706;
  border-right: 3px solid #d97706;
}

/* ---- Modal overlay ---------------------------------------- */
.modal-backdrop {
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(2px);
}

/* ---- Image placeholder (no image) ------------------------- */
.img-placeholder {
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #d1d5db;
}
