/* =============================================
   DESIGN SYSTEM — Premium E-Commerce Theme
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

:root {
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.25rem;
  --shadow-card: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.03);
  --shadow-card-hover: 0 8px 25px -5px rgba(0,0,0,0.08), 0 4px 10px -3px rgba(0,0,0,0.04);
  --shadow-nav: 0 1px 3px rgba(0,0,0,0.03);
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* =============================================
   BASE RESET & TYPOGRAPHY
   ============================================= */

body {
  font-family: var(--font-family);
  -webkit-tap-highlight-color: transparent;
  scroll-behavior: smooth;
  background: #fafbfc !important;
  background-attachment: fixed !important;
  font-size: 14px;
  line-height: 1.5;
  color: #1e293b;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html, body {
  overflow-x: hidden;
  max-width: 100vw;
}

* {
  scroll-behavior: smooth;
}

/* =============================================
   GLASSMORPHISM UTILITIES
   ============================================= */

.glassmorphism {
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
}

.dark-glassmorphism {
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

/* =============================================
   NAVBAR — Clean & Professional
   ============================================= */

header.fixed {
  background: rgba(255, 255, 255, 0.88) !important;
  backdrop-filter: blur(20px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06) !important;
  box-shadow: var(--shadow-nav) !important;
}

/* =============================================
   ANIMATIONS — Subtle & Refined
   ============================================= */

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

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.97); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.animate-fade-in-up {
  animation: fadeInUp 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-scale-in {
  animation: scaleIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-fade-in {
  animation: fadeIn 0.3s ease forwards;
}

/* =============================================
   TYPOGRAPHY — Gradient Headings
   ============================================= */

.gradient-heading {
  background: linear-gradient(135deg, #0f172a 0%, #475569 100%) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  display: inline-block;
}

/* =============================================
   PRODUCT CARDS — Refined & Compact
   ============================================= */

.group.flex.flex-col {
  background: #fff !important;
  border: 1px solid rgba(0, 0, 0, 0.06) !important;
  box-shadow: var(--shadow-card) !important;
  transition: all var(--transition-smooth) !important;
}

.group.flex.flex-col:hover {
  border-color: rgba(var(--brand-rgb), 0.2) !important;
  transform: translateY(-2px) !important;
  box-shadow: var(--shadow-card-hover) !important;
}

/* Product card image container */
.group.flex.flex-col a.block.w-full.aspect-square {
  background: #f8fafc !important;
}

/* Category cards */
#categories .grid a.group {
  background: #fff !important;
  border: 1px solid rgba(0, 0, 0, 0.06) !important;
  box-shadow: var(--shadow-card) !important;
  transition: all var(--transition-smooth) !important;
}

#categories .grid a.group:hover {
  border-color: rgba(var(--brand-rgb), 0.18) !important;
  transform: translateY(-1px) !important;
  box-shadow: var(--shadow-card-hover) !important;
}

/* =============================================
   SCROLLBAR — Minimal
   ============================================= */

::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.12);
  border-radius: 9999px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.2);
}

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

/* =============================================
   SAFE AREAS & MOBILE
   ============================================= */

.pb-safe {
  padding-bottom: calc(env(safe-area-inset-bottom) + 0.5rem);
}

img {
  max-width: 100%;
  height: auto;
}

a, button {
  min-height: 32px;
}

/* Prevent iOS zoom on input focus */
@media (max-width: 640px) {
  .grid.grid-cols-2 > * {
    min-width: 0;
  }

  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="number"],
  input[type="password"],
  input[type="search"],
  select,
  textarea {
    font-size: 16px !important;
  }

  .admin-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* =============================================
   GLOW & PULSE EFFECTS
   ============================================= */

.glow-effect {
  box-shadow: 0 0 20px rgba(var(--brand-rgb), 0.1);
}

.whatsapp-pulse {
  animation: whatsapp-ring 2.5s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes whatsapp-ring {
  0%  { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.5); }
  70% { box-shadow: 0 0 0 8px rgba(37, 211, 102, 0); }
  100%{ box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

/* =============================================
   FOOTER
   ============================================= */

footer ul li a svg {
  transition: transform 0.2s ease;
}

footer ul li a:hover svg {
  transform: translateX(2px);
}

footer h3 span.w-4 {
  transition: width 0.3s ease;
}

footer h3:hover span.w-4 {
  width: 1.25rem;
}

/* =============================================
   CAROUSEL
   ============================================= */

.carousel-container {
  overflow: hidden;
  position: relative;
}

.carousel-slide {
  display: flex;
  transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

/* =============================================
   RESPONSIVE TABLE
   ============================================= */

.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-lg);
}

/* Admin sidebar mobile */
@media (max-width: 767px) {
  #admin-mobile-menu {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 50;
    overflow-y: auto;
    background: #0f172a;
    padding-top: 60px;
  }
}

/* =============================================
   AMBIENT BACKGROUNDS — Subtle
   ============================================= */

.ambient-blob {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  z-index: -1;
  mix-blend-mode: multiply;
  filter: blur(100px);
  opacity: 0.4;
}

/* Sticky bottom bar */
.product-sticky-cta {
  padding-bottom: calc(env(safe-area-inset-bottom) + 0.75rem);
}

/* =============================================
   TRUNCATION UTILITIES
   ============================================= */

.truncate-mobile {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
