/* ════════════════════════════════════════════
   ECUAQUÍMICA — KIOSKO
   Pantalla 55" (1080×1920) + Desktop + Mobile
════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --ecua-green:   #0b6e36;
  --ecua-green2:  #1a9950;
  --ecua-dark:    #0a1a10;
  --bg-card:      #ffffff;
  --text-main:    #0d1f14;
  --text-muted:   #4a5e50;
  --border:       #c8d6c2;
  --radius-card:  36px;
  --radius-btn:   28px;
  --shadow-card:  0 8px 48px rgba(0,0,0,0.15);
  --shadow-btn:   0 6px 28px rgba(11,110,54,0.35);
  --transition:   200ms cubic-bezier(0.34,1.56,0.64,1);
}

html { -webkit-text-size-adjust: none; font-size: 16px; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  color: var(--text-main);
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  background: #eaeaea url('assets/fondo-degradado.png') center center / cover no-repeat fixed;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ════════════════════════════════════════════
   SCREENS
════════════════════════════════════════════ */
.screen {
  position: fixed;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 280ms ease;
  overflow-y: auto;
}
.screen.active { opacity: 1; pointer-events: all; }
.screen.slide-in { animation: slide-up 320ms cubic-bezier(0.25,1,0.5,1) forwards; }
@keyframes slide-up {
  from { opacity:0; transform: translateY(30px); }
  to   { opacity:1; transform: translateY(0); }
}

/* ════════════════════════════════════════════
   MAIN SCREEN — base (mobile-first)
════════════════════════════════════════════ */
#screen-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 16px 160px;
  min-height: 100vh;
}

.main-header {
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 28px 0 20px;
}
.main-logo {
  height: 70px;
  object-fit: contain;
  filter: drop-shadow(0 4px 20px rgba(0,0,0,0.15));
}

/* Grid — columna por defecto */
.catalog-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 700px;
  flex: 1;
}

.catalog-btn {
  width: 100%;
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: transform var(--transition), box-shadow var(--transition);
  -webkit-tap-highlight-color: transparent;
  outline: none;
  aspect-ratio: 16 / 7;
  display: block;
}
.catalog-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 20px;
  pointer-events: none;
}
.catalog-btn:active { transform: scale(0.96); box-shadow: 0 2px 16px rgba(0,0,0,0.18); }
.catalog-btn.bounce { animation: btn-bounce 320ms cubic-bezier(0.34,1.56,0.64,1) forwards; }
@keyframes btn-bounce {
  0%   { transform: scale(1) translateY(0); }
  35%  { transform: scale(0.95) translateY(5px); }
  65%  { transform: scale(1.03) translateY(-3px); }
  100% { transform: scale(1) translateY(0); }
}

/* ── Contact button ── */
.contact-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 72px;
  height: 72px;
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 6px 32px rgba(11,110,54,0.45);
  transition: transform var(--transition), box-shadow var(--transition);
  -webkit-tap-highlight-color: transparent;
  outline: none;
  z-index: 9999;
}
.contact-btn img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.contact-btn:active { transform: scale(0.93); }
.contact-btn.blink { animation: pulse-blink 1.1s ease-in-out 3; }
@keyframes pulse-blink {
  0%   { box-shadow: 0 6px 32px rgba(11,110,54,0.45); transform: scale(1); }
  30%  { box-shadow: 0 0 0 16px rgba(29,153,80,0.2), 0 6px 32px rgba(11,110,54,0.45); transform: scale(1.08); }
  60%  { box-shadow: 0 0 0 32px rgba(29,153,80,0.06), 0 6px 32px rgba(11,110,54,0.45); transform: scale(1.04); }
  100% { box-shadow: 0 6px 32px rgba(11,110,54,0.45); transform: scale(1); }
}

/* ════════════════════════════════════════════
   PDF VIEWER
════════════════════════════════════════════ */
#screen-pdf { background: #111; display: flex; flex-direction: column; }
#pdf-frame { width: 100%; flex: 1; border: none; display: block; height: 100vh; }
.back-btn {
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(0,0,0,0.65);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 50px;
  padding: 10px 20px 10px 14px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: background 180ms, transform var(--transition);
  -webkit-tap-highlight-color: transparent;
  outline: none;
}
.back-btn:active { transform: scale(0.95); background: rgba(0,0,0,0.85); }
.back-btn svg { width: 28px; height: 28px; }

/* ════════════════════════════════════════════
   FORM SCREEN
════════════════════════════════════════════ */
#screen-form {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.4);
  padding: 40px 16px;
}
.form-card {
  background: var(--bg-card);
  border-radius: var(--radius-card);
  box-shadow: 0 24px 96px rgba(0,0,0,0.2);
  padding: 40px 28px 48px;
  width: 100%;
  max-width: 560px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.form-logo { height: 56px; object-fit: contain; margin-bottom: 20px; }
.form-title { font-size: 1.3rem; font-weight: 700; color: var(--ecua-dark); text-align: center; margin-bottom: 6px; }
.form-subtitle { font-size: 0.9rem; color: var(--text-muted); text-align: center; margin-bottom: 28px; line-height: 1.5; }
#lead-form { width: 100%; display: flex; flex-direction: column; gap: 16px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 5px; }
label { font-size: 0.7rem; font-weight: 600; color: var(--ecua-green); letter-spacing: 0.03em; text-transform: uppercase; }
input[type="text"], input[type="email"], input[type="tel"], select {
  width: 100%; height: 48px; border: 2px solid var(--border); border-radius: 12px;
  padding: 0 16px; font-size: 0.95rem; font-family: inherit; color: var(--text-main);
  background: #f8faf7; outline: none;
  transition: border-color 180ms, box-shadow 180ms;
  -webkit-appearance: none; appearance: none;
}
input::placeholder { color: #aab8a2; }
input:focus, select:focus { border-color: var(--ecua-green2); background: #fff; box-shadow: 0 0 0 3px rgba(26,153,80,0.12); }
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6' stroke='%230b6e36' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 40px; cursor: pointer;
}
.field-error { font-size: 0.72rem; color: #c0392b; min-height: 1em; }
input.has-error, select.has-error { border-color: #e74c3c; background: #fff8f8; }
.form-actions { display: flex; gap: 12px; margin-top: 6px; }
.btn-primary {
  flex: 1; height: 52px; border: none;
  background: linear-gradient(135deg, var(--ecua-green2) 0%, var(--ecua-green) 100%);
  color: #fff; font-size: 0.95rem; font-weight: 700; border-radius: var(--radius-btn);
  cursor: pointer; box-shadow: var(--shadow-btn);
  transition: transform var(--transition), box-shadow var(--transition), opacity 180ms;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  -webkit-tap-highlight-color: transparent; outline: none;
}
.btn-primary:active { transform: scale(0.97); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.btn-secondary {
  width: 120px; height: 52px; border: 2px solid var(--border); background: transparent;
  color: var(--text-muted); font-size: 0.88rem; font-weight: 600; border-radius: var(--radius-btn);
  cursor: pointer; transition: background 180ms;
  -webkit-tap-highlight-color: transparent; outline: none;
}
.btn-secondary:active { background: #f0f0f0; }
.loader { width: 18px; height: 18px; border: 3px solid rgba(255,255,255,0.3); border-top-color: #fff; border-radius: 50%; animation: spin 700ms linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ════════════════════════════════════════════
   SUCCESS SCREEN
════════════════════════════════════════════ */
#screen-success {
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.4);
}
.success-card {
  background: var(--bg-card); border-radius: var(--radius-card);
  box-shadow: 0 24px 96px rgba(0,0,0,0.2);
  padding: 56px 40px 64px; width: 90%; max-width: 460px;
  display: flex; flex-direction: column; align-items: center; text-align: center;
}
.success-icon { margin-bottom: 28px; animation: pop-in 500ms cubic-bezier(0.34,1.56,0.64,1) forwards; }
@keyframes pop-in { 0% { transform: scale(0.4); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
.success-title { font-size: 2rem; font-weight: 800; color: var(--ecua-green); margin-bottom: 12px; }
.success-msg { font-size: 1rem; color: var(--text-muted); line-height: 1.7; }

/* ════════════════════════════════════════════
   DESKTOP ≥ 1024px
════════════════════════════════════════════ */
@media (min-width: 1024px) {
  #screen-main { padding: 0 60px 160px; }
  .main-header { padding: 48px 0 36px; }
  .main-logo { height: 110px; }

  /* Grid 2 columnas: izquierda 2 botones apilados, derecha 1 grande */
  .catalog-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 28px;
    max-width: 1100px;
    align-items: stretch;
  }
  .catalog-btn { border-radius: 28px; }
  .catalog-btn img { border-radius: 28px; }
  .catalog-btn:nth-child(1) { grid-column: 1; grid-row: 1; }
  .catalog-btn:nth-child(2) { grid-column: 1; grid-row: 2; }
  .catalog-btn:nth-child(3) {
    grid-column: 2; grid-row: 1 / 3;
    aspect-ratio: unset;
    align-self: stretch;
  }
  .contact-btn { width: 110px; height: 110px; bottom: 44px; right: 44px; }
}

/* ════════════════════════════════════════════
   KIOSK 55" exacto — detectado por tamaño
════════════════════════════════════════════ */
@media (min-width: 1079px) and (max-width: 1081px) and (min-height: 1800px) {
  html { font-size: 28px; }
  body { width: 1080px; height: 1920px; overflow: hidden; background-attachment: scroll; }
  .screen { width: 1080px; height: 1920px; position: absolute; overflow: hidden; }
  #screen-main { padding: 0 56px 280px; min-height: 1920px; }
  .main-header { padding: 72px 0 52px; }
  .main-logo { height: 150px; }

  /* Vuelve a columna vertical */
  .catalog-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 44px;
    max-width: 100%;
    flex: 1;
  }
  .catalog-btn { aspect-ratio: 16 / 7 !important; border-radius: 36px; }
  .catalog-btn img { border-radius: 36px; }
  .catalog-btn:nth-child(3) { grid-column: unset; grid-row: unset; align-self: auto; }

  .contact-btn { width: 150px; height: 150px; bottom: 64px; right: 56px; }

  .back-btn { top: 40px; left: 40px; font-size: 1.1rem; padding: 16px 36px 16px 22px; }
  .form-card { width: 820px; padding: 64px 72px 72px; max-width: 820px; }
  .form-title { font-size: 1.8rem; }
  .form-subtitle { font-size: 1rem; }
  input[type="text"], input[type="email"], input[type="tel"], select { height: 76px; font-size: 1.2rem; }
  label { font-size: 0.85rem; }
  .btn-primary, .btn-secondary { height: 84px; font-size: 1.1rem; }
  .btn-secondary { width: 200px; }
  .success-card { width: 700px; max-width: 700px; padding: 80px 64px; }
  .success-title { font-size: 3rem; }
  .success-msg { font-size: 1.2rem; }
}

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.2); border-radius: 4px; }
