/* ============================================================
   datyelectronic — Global Styles
   Design System: dark graphite · bordeaux red · electric blue
   ============================================================ */

/* ---- Reset / Base ---------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

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

body {
  background-color: #07090D;
  color: #e5e7eb;
  min-height: 100vh;
}

/* ---- Custom Scrollbar ------------------------------------ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #0C0F17; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #722F37, #2563EB);
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover { background: #9E2A3B; }

/* ---- Glass Card ------------------------------------------ */
.glass-card {
  background: rgba(12, 15, 23, 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 4px 32px -8px rgba(0, 0, 0, 0.6);
  transition: box-shadow 0.3s ease, border-color 0.3s ease, transform 0.25s ease;
}

.glass-card:hover {
  box-shadow: 0 8px 48px -8px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(114, 47, 55, 0.25);
}

/* Gradient border on card hover */
.phone-card {
  position: relative;
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.3s ease;
}
.phone-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, transparent 40%, rgba(56, 189, 248, 0));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: destination-out;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}
.phone-card:hover::before {
  background: linear-gradient(135deg, #38BDF8 0%, #722F37 100%);
  opacity: 1;
}
.phone-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 48px -8px rgba(0,0,0,0.7), 0 0 24px -4px rgba(56,189,248,0.15);
}

/* ---- Animations ------------------------------------------ */

/* Fade-in-up — applied via JS or Intersection Observer */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fade-in-up {
  animation: fadeInUp 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Staggered delays for grids */
.fade-in-up:nth-child(1)  { animation-delay: 0.05s; }
.fade-in-up:nth-child(2)  { animation-delay: 0.10s; }
.fade-in-up:nth-child(3)  { animation-delay: 0.15s; }
.fade-in-up:nth-child(4)  { animation-delay: 0.20s; }
.fade-in-up:nth-child(5)  { animation-delay: 0.25s; }
.fade-in-up:nth-child(6)  { animation-delay: 0.30s; }
.fade-in-up:nth-child(7)  { animation-delay: 0.35s; }
.fade-in-up:nth-child(8)  { animation-delay: 0.40s; }

/* Shimmer / Skeleton loading */
@keyframes shimmer {
  0%   { background-position: -800px 0; }
  100% { background-position:  800px 0; }
}

.skeleton {
  background: linear-gradient(90deg,
    #111520 0px,
    #1a2035 40px,
    #111520 80px
  );
  background-size: 800px 100%;
  animation: shimmer 1.4s infinite linear;
  border-radius: 12px;
}

/* Skeleton phone card */
.skeleton-card {
  height: 320px;
  border-radius: 16px;
}

/* Pulse glow for promo */
@keyframes glow-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(114,47,55,0.4); }
  50%       { box-shadow: 0 0 24px 4px rgba(114,47,55,0.25); }
}

.glow-pulse { animation: glow-pulse 2.4s ease-in-out infinite; }

/* Floating entry for hero badges */
@keyframes floatBadge {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-6px); }
}
.float-badge { animation: floatBadge 3s ease-in-out infinite; }

/* Spinning border on CTA */
@keyframes rotateBorder {
  to { transform: rotate(360deg); }
}

/* ---- Hero animated gradient bg -------------------------- */
.hero-gradient {
  background: radial-gradient(ellipse 80% 60% at 50% -10%, rgba(114,47,55,0.35) 0%, transparent 70%),
              radial-gradient(ellipse 60% 40% at 90% 60%, rgba(37,99,235,0.18) 0%, transparent 70%),
              #07090D;
}

.hero-gradient-store {
  background: radial-gradient(ellipse 70% 60% at 20% -10%, rgba(37,99,235,0.25) 0%, transparent 65%),
              radial-gradient(ellipse 50% 40% at 80% 70%, rgba(114,47,55,0.22) 0%, transparent 65%),
              #07090D;
}

/* Grid noise overlay */
.noise-overlay {
  position: relative;
}
.noise-overlay::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  border-radius: inherit;
  z-index: 0;
}

/* ---- Mobile Navigation ----------------------------------- */
#mobile-menu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
  opacity: 0;
}

#mobile-menu.open {
  max-height: 320px;
  opacity: 1;
}

.hamburger-line {
  display: block;
  width: 22px;
  height: 2px;
  background: #e5e7eb;
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
  transform-origin: center;
}

#hamburger-btn.open .hamburger-line:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}
#hamburger-btn.open .hamburger-line:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
#hamburger-btn.open .hamburger-line:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* ---- Tab Buttons ----------------------------------------- */
.tab-btn {
  position: relative;
  transition: color 0.2s ease;
}
.tab-btn::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: #722F37;
  transform: scaleX(0);
  transition: transform 0.25s ease;
}
.tab-btn.active {
  color: #fff;
}
.tab-btn.active::after {
  transform: scaleX(1);
}

/* ---- Star Rating ----------------------------------------- */
.star-btn {
  font-size: 1.5rem;
  color: #4b5563;
  transition: color 0.15s ease, transform 0.15s ease;
}
.star-btn.active,
.star-btn:hover {
  color: #fbbf24;
  transform: scale(1.15);
}

/* ---- Filter Buttons (phones page) ----------------------- */
.cat-btn {
  position: relative;
  overflow: hidden;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}
.cat-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.05);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.cat-btn:hover::after { opacity: 1; }
.cat-btn.active {
  background: #722F37 !important;
  color: #fff !important;
  border-color: transparent !important;
  box-shadow: 0 0 16px -4px rgba(114,47,55,0.6);
}

/* ---- Payment Method Buttons ------------------------------ */
.pay-btn-active {
  border-color: #722F37 !important;
  color: #fff !important;
  background: rgba(114,47,55,0.25) !important;
}

/* ---- Admin Panel Tabs ------------------------------------ */
.admin-tab-btn {
  transition: background 0.2s, color 0.2s;
  border-bottom: 2px solid transparent;
}
.admin-tab-btn.active-admin-tab {
  background: rgba(114,47,55,0.3);
  color: #fff;
  border-bottom-color: #722F37;
}

/* ---- Condition Badge ------------------------------------- */
.condition-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: 0.03em;
}
.condition-nuevo    { background: rgba(16,185,129,0.15); color: #34d399; border: 1px solid rgba(52,211,153,0.3); }
.condition-usado    { background: rgba(245,158,11,0.15); color: #fbbf24; border: 1px solid rgba(251,191,36,0.3); }
.condition-reacond  { background: rgba(37,99,235,0.15);  color: #60a5fa; border: 1px solid rgba(96,165,250,0.3); }

/* ---- Empty State ---------------------------------------- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 64px 24px;
  color: #6b7280;
  text-align: center;
}
.empty-state svg {
  opacity: 0.35;
}

/* ---- Floating Store Pill --------------------------------- */
.store-pill {
  animation: floatBadge 3s ease-in-out infinite;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.store-pill:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 8px 32px -4px rgba(37,99,235,0.45);
}

/* ---- Breadcrumb sticky ---------------------------------- */
.breadcrumb-bar {
  position: sticky;
  top: 80px;
  z-index: 30;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* ---- Promo Banner --------------------------------------- */
.promo-bar {
  background: linear-gradient(90deg, #722F37, #9E2A3B 50%, #722F37);
  background-size: 200% 100%;
  animation: promoBg 4s linear infinite;
}
@keyframes promoBg {
  0%   { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

/* ---- WhatsApp FAB --------------------------------------- */
#floating-whatsapp-btn {
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease;
}
#floating-whatsapp-btn:hover {
  transform: scale(1.14) rotate(-5deg);
  box-shadow: 0 8px 32px rgba(16, 185, 129, 0.45);
}

/* ---- Search Input --------------------------------------- */
.search-input {
  background: rgba(12,15,23,0.9);
  border: 1px solid rgba(255,255,255,0.1);
  color: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.search-input:focus {
  outline: none;
  border-color: rgba(56,189,248,0.5);
  box-shadow: 0 0 0 3px rgba(56,189,248,0.1);
}
.search-input::placeholder { color: #4b5563; }

/* ---- Auth Inputs & High Visibility Login ----------------- */
.auth-input {
  background: #111622 !important;
  border: 2px solid rgba(255, 255, 255, 0.25) !important;
  color: #ffffff !important;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.auth-input:focus {
  outline: none !important;
  border-color: #9E2A3B !important;
  background: #161c2b !important;
  box-shadow: 0 0 0 3px rgba(158, 42, 59, 0.35), inset 0 2px 4px rgba(0, 0, 0, 0.4) !important;
}
.auth-input::placeholder {
  color: #9ca3af !important;
}

/* ---- Section headers ------------------------------------ */
.section-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #9E2A3B;
}

/* ---- Utility -------------------------------------------- */
.text-gradient-br {
  background: linear-gradient(135deg, #fff 30%, #9E2A3B 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-gradient-el {
  background: linear-gradient(135deg, #38BDF8, #2563EB);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.border-gradient {
  border-image: linear-gradient(135deg, #38BDF8, #722F37) 1;
}

/* Smooth image load */
img {
  transition: opacity 0.3s ease;
}
img[loading] { opacity: 0; }
img.loaded   { opacity: 1; }

/* Utilidades propias que el CSS compilado de Tailwind no genera */
.bg-auth-modal{background-color:#0b0e14}
.shadow-auth-glow{box-shadow:0 0 60px rgba(114,47,55,0.45)}
