/* ================================================
   XEVON — Premium Men's Fashion Store
   Custom Stylesheet
   ================================================ */

/* ── Base Resets & Root Variables ─────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --brand: #FF6600;
  --brand-dark: #e65c00;
  --brand-light: #ff8533;
  --brand-glow: rgba(255, 102, 0, 0.25);
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.25rem;
  --radius-2xl: 1.5rem;
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--gray-800);
  background: #ffffff;
  line-height: 1.6;
  overflow-x: hidden;
}

/* ── Scrollbar Styling ──────────────────────────── */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--gray-100);
}
::-webkit-scrollbar-thumb {
  background: var(--gray-300);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--gray-400);
}

.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* ── Announcement Bar ───────────────────────────── */
#announcement-bar {
  background: linear-gradient(90deg, var(--brand), var(--brand-dark), var(--brand));
  background-size: 200% 100%;
  animation: gradientShift 8s ease infinite;
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

#announcement-bar .close-btn {
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}
#announcement-bar .close-btn:hover {
  opacity: 1;
  transform: translateY(-50%) scale(1.1);
}

/* ── Marquee Animation ─────────────────────────── */
@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
.animate-marquee {
  animation: marquee 25s linear infinite;
  min-width: 200%;
}

/* ── Header ─────────────────────────────────────── */
#main-header {
  transition: box-shadow 0.3s ease, background-color 0.3s ease;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

#main-header.scrolled {
  box-shadow: var(--shadow-lg);
  background: rgba(255, 255, 255, 0.95);
}

/* Desktop nav link underline effect */
.nav-link {
  position: relative;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid transparent;
  transition: color var(--transition-base), border-color var(--transition-base);
}
.nav-link:hover,
.nav-link.active {
  color: var(--brand);
  border-bottom-color: var(--brand);
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--brand);
  transition: width var(--transition-base);
}
.nav-link:hover::after {
  width: 100%;
}

/* Desktop dropdown */
.nav-dropdown {
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}
.nav-item:hover .nav-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.nav-dropdown a {
  transition: background-color var(--transition-fast), color var(--transition-fast), padding-left var(--transition-base);
}
.nav-dropdown a:hover {
  padding-left: 1.25rem;
}

/* ── Hero Slider ─────────────────────────────────── */
.hero-slide {
  opacity: 0;
  transition: opacity 0.8s ease-in-out, transform 0.8s ease-in-out;
  position: absolute;
  inset: 0;
  transform: scale(1.02);
}
.hero-slide.active {
  opacity: 1;
  transform: scale(1);
}

.hero-dot {
  width: 12px;
  height: 4px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.5);
  transition: all 0.4s ease;
}
.hero-dot.active {
  width: 32px;
  background: #ffffff;
}

/* Hero CTA button shimmer */
.hero-cta {
  position: relative;
  overflow: hidden;
}
.hero-cta::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.6s ease;
}
.hero-cta:hover::before {
  left: 100%;
}

/* ── Category Cards ─────────────────────────────── */
.category-card {
  position: relative;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.category-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 40%, rgba(255, 102, 0, 0.08) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 0;
}
.category-card:hover::before {
  opacity: 1;
}
.category-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}
.category-card > * {
  position: relative;
  z-index: 1;
}
.category-icon {
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.category-card:hover .category-icon {
  transform: scale(1.15) rotate(-5deg);
}

/* ── Promo Banners ──────────────────────────────── */
.promo-banner {
  position: relative;
  overflow: hidden;
}
.promo-banner::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 100%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.08) 0%, transparent 70%);
  transition: opacity 0.4s ease;
}
.promo-banner:hover::after {
  opacity: 0;
}
.promo-banner .promo-emoji {
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
}
.promo-banner:hover .promo-emoji {
  transform: scale(1.2) rotate(10deg);
  opacity: 0.3;
}

/* ── Product Cards ───────────────────────────────── */
.product-card {
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.35s ease;
}
.product-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-xl);
}

.product-card .product-image {
  transition: transform 0.5s ease;
}
.product-card:hover .product-image {
  transform: scale(1.08);
}

.product-card .quick-add-btn {
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}
.product-card .quick-add-btn::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  transform: translate(-50%, -50%);
  transition: width 0.4s ease, height 0.4s ease;
}
.product-card .quick-add-btn:active::after {
  width: 200px;
  height: 200px;
}

.product-card .wishlist-btn {
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.product-card .wishlist-btn:hover {
  transform: scale(1.15);
}
.product-card .wishlist-btn.active {
  animation: heartPulse 0.4s ease;
}

@keyframes heartPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.35); }
  100% { transform: scale(1.15); }
}

/* Product card added-to-cart animation */
.product-card.added .quick-add-btn {
  background-color: #16a34a !important;
}

/* ── Cart Drawer ────────────────────────────────── */
#cart-overlay {
  transition: opacity 0.35s ease;
}
#cart-drawer {
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
#cart-drawer.open {
  transform: translateX(0) !important;
}

/* Cart item remove animation */
.cart-item {
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.cart-item.removing {
  opacity: 0;
  transform: translateX(50px);
}

/* ── Mobile Menu Drawer ─────────────────────────── */
#mobile-menu-overlay {
  transition: opacity 0.3s ease;
}
#mobile-menu {
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Mobile Filter Drawer ────────────────────────── */
#mobile-filter-drawer {
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Mobile Bottom Nav ──────────────────────────── */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  #mobile-nav {
    padding-bottom: env(safe-area-inset-bottom);
  }
}

#mobile-nav a,
#mobile-nav button {
  transition: color var(--transition-fast), transform var(--transition-fast);
}
#mobile-nav a:hover span,
#mobile-nav button:hover span {
  transform: scale(1.05);
}

/* ── Floating Contact Widgets ───────────────────── */
.floating-widget {
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
}
.floating-widget:hover {
  transform: scale(1.12);
  box-shadow: var(--shadow-xl);
}

/* ── Range Slider Custom Styling ─────────────────── */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 5px;
  background: linear-gradient(to right, var(--brand) 0%, var(--gray-200) 0%);
  border-radius: 9999px;
  outline: none;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  background: var(--brand);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 6px var(--brand-glow);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}
input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 2px 12px var(--brand-glow);
}
input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: var(--brand);
  border-radius: 50%;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 6px var(--brand-glow);
}

/* ── Scroll Fade-Up Animation ──────────────────── */
.fade-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1), transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}
.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}
.fade-up:nth-child(2) { transition-delay: 0.1s; }
.fade-up:nth-child(3) { transition-delay: 0.2s; }

/* ── Line Clamp Utility ──────────────────────────── */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Trust / Features Section ───────────────────── */
.feature-icon-wrapper {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.feature-item:hover .feature-icon-wrapper {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px var(--brand-glow);
}

/* ── Footer ─────────────────────────────────────── */
footer a {
  transition: color var(--transition-fast), padding-left var(--transition-base);
}
footer .footer-links a:hover {
  padding-left: 4px;
}

/* ── Color Swatch Selection ─────────────────────── */
.color-swatch {
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  cursor: pointer;
}
.color-swatch:hover {
  transform: scale(1.25);
  box-shadow: 0 0 0 3px var(--brand);
}

/* ── Size Button Toggle ─────────────────────────── */
.size-btn.selected {
  border-color: var(--brand) !important;
  color: var(--brand) !important;
  background-color: rgba(255, 102, 0, 0.05);
}

/* ── Category Pill ──────────────────────────────── */
.category-pill {
  transition: all var(--transition-base);
  cursor: pointer;
  user-select: none;
}

/* ── Loading Spinner ────────────────────────────── */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.animate-spin {
  animation: spin 1s linear infinite;
}

/* ── Skeleton Loading Effect ────────────────────── */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.skeleton {
  background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-200) 50%, var(--gray-100) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

/* ── Responsive Adjustments ─────────────────────── */
@media (max-width: 640px) {
  .hero-cta {
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
  }
}

@media (min-width: 1024px) {
  .product-card:hover {
    transform: translateY(-8px);
  }
}

/* ── Page Transition (on load) ──────────────────── */
@keyframes pageLoad {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
body {
  animation: pageLoad 0.5s ease-out;
}
