/* =====================================================================
   WAIYA WEB - style.css
   Estilo visual: Windows 11 Fluent Design
   - Bordes redondeados
   - Sombras suaves
   - Botones con hover / focus
   - Tipografía Segoe UI
   ===================================================================== */

/* ---------- 1. Variables de marca (paleta WAIYA) ---------- */
:root {
  --waiya-red: #E4032E;        /* Rojo del logo (rombos) */
  --waiya-red-dark: #B8021F;   /* Rojo hover / acentos */
  --waiya-blue: #0C2D57;       /* Azul oscuro del texto WAIYA */
  --waiya-blue-dark: #081C38;
  --waiya-gray-light: #F3F3F3; /* Gris claro estilo Windows 11 */
  --waiya-gray-mid: #E1E1E1;
  --waiya-gray-border: #D0D0D0;
  --waiya-white: #FFFFFF;
  --waiya-black-soft: #201F1E; /* Negro suave para texto (Fluent neutral) */

  /* Fluent Design tokens */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.08), 0 1px 1px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.10), 0 1.5px 4px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 28px rgba(0, 0, 0, 0.14), 0 2px 6px rgba(0, 0, 0, 0.08);
  --transition-fast: 120ms ease;
  --transition-mid: 200ms ease;
}

/* ---------- 2. Reset básico ---------- */
* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Segoe UI", "Segoe UI Variable", -apple-system, BlinkMacSystemFont,
               Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--waiya-gray-light);
  color: var(--waiya-black-soft);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3 {
  color: var(--waiya-blue);
  margin: 0 0 8px 0;
  font-weight: 600;
}

p {
  line-height: 1.5;
  color: #4b4a48;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ---------- 3. Barra superior / Marca ---------- */
.topbar {
  background-color: var(--waiya-white);
  border-bottom: 1px solid var(--waiya-gray-border);
  padding: 12px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo {
  display: block;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.brand-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--waiya-blue);
  letter-spacing: 1px;
}

.brand-subtitle {
  font-size: 10px;
  font-weight: 600;
  color: var(--waiya-black-soft);
  letter-spacing: 1.5px;
}

.topnav {
  display: flex;
  gap: 4px;
  background-color: var(--waiya-gray-light);
  padding: 4px;
  border-radius: var(--radius-md);
}

.nav-link {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  color: var(--waiya-black-soft);
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.nav-link:hover {
  background-color: var(--waiya-gray-mid);
}

.nav-link.active {
  background-color: var(--waiya-blue);
  color: var(--waiya-white);
}

/* ---------- 4. Layout de página ---------- */
.page {
  flex: 1;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 24px 48px;
}

.page-footer {
  text-align: center;
  padding: 16px;
  font-size: 12px;
  color: #7a7975;
}

/* ---------- 5. Tarjetas Fluent ---------- */
.fluent-card {
  background-color: var(--waiya-white);
  border: 1px solid var(--waiya-gray-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 28px;
  transition: box-shadow var(--transition-mid), transform var(--transition-mid);
}

/* ---------- 6. Página de inicio ---------- */
.hero-card {
  margin-bottom: 28px;
  background: linear-gradient(135deg, var(--waiya-white) 60%, var(--waiya-gray-light) 100%);
}

.hero-subtitle {
  max-width: 640px;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.module-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
}

.module-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
  border-color: var(--waiya-red);
}

.module-icon {
  font-size: 28px;
}

.module-cta {
  margin-top: 10px;
  font-weight: 600;
  color: var(--waiya-red);
  font-size: 14px;
}

/* ---------- 7. Tarjeta de formulario ---------- */
.form-card {
  max-width: 760px;
  margin: 0 auto;
}

.form-card-wide {
  max-width: 960px;
}

.form-card-header {
  margin-bottom: 20px;
  border-bottom: 1px solid var(--waiya-gray-border);
  padding-bottom: 16px;
}

.form-card-header p {
  margin: 0;
  font-size: 14px;
}

/* ---------- 8. Campos de formulario (estilo UserForm) ---------- */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px 20px;
  margin-bottom: 8px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-wide {
  grid-column: 1 / -1;
}

label {
  font-size: 13px;
  font-weight: 600;
  color: var(--waiya-black-soft);
}

.required {
  color: var(--waiya-red);
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="date"],
select,
textarea {
  font-family: inherit;
  font-size: 14px;
  padding: 10px 12px;
  border: 1px solid var(--waiya-gray-border);
  border-radius: var(--radius-sm);
  background-color: var(--waiya-gray-light);
  color: var(--waiya-black-soft);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background-color var(--transition-fast);
  width: 100%;
}

textarea {
  resize: vertical;
  min-height: 70px;
}

input:hover, select:hover, textarea:hover {
  border-color: #b7b6b3;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  background-color: var(--waiya-white);
  border-color: var(--waiya-blue);
  box-shadow: 0 0 0 3px rgba(12, 45, 87, 0.15);
}

input.invalid, select.invalid, textarea.invalid {
  border-color: var(--waiya-red);
  background-color: #fff3f4;
}

input.invalid:focus, select.invalid:focus, textarea.invalid:focus {
  box-shadow: 0 0 0 3px rgba(228, 3, 46, 0.15);
}

.error-message {
  font-size: 12px;
  color: var(--waiya-red);
  min-height: 14px;
  display: block;
}

/* ---------- 9. Botones (Windows 11 Fluent) ---------- */
.btn {
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 22px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color var(--transition-fast), border-color var(--transition-fast),
              transform var(--transition-fast), box-shadow var(--transition-fast);
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background-color: var(--waiya-red);
  color: var(--waiya-white);
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background-color: var(--waiya-red-dark);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background-color: var(--waiya-white);
  color: var(--waiya-blue);
  border-color: var(--waiya-gray-border);
}

.btn-secondary:hover {
  background-color: var(--waiya-gray-light);
  border-color: var(--waiya-blue);
}

.btn-small {
  padding: 6px 14px;
  font-size: 13px;
}

.btn-remove-item {
  background-color: transparent;
  border: none;
  color: var(--waiya-red);
  font-size: 15px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  width: 28px;
  height: 28px;
  transition: background-color var(--transition-fast);
}

.btn-remove-item:hover {
  background-color: #fde7e9;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--waiya-gray-border);
}

/* ---------- 10. Feedback / mensajes ---------- */
.form-feedback {
  margin-top: 14px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  display: none;
}

.form-feedback.success {
  display: block;
  background-color: #e6f7ec;
  color: #1c7a3d;
  border: 1px solid #b9e6c6;
}

.form-feedback.error {
  display: block;
  background-color: #fdeced;
  color: var(--waiya-red-dark);
  border: 1px solid #f5c2c8;
}

.form-feedback.loading {
  display: block;
  background-color: var(--waiya-gray-light);
  color: var(--waiya-black-soft);
  border: 1px solid var(--waiya-gray-border);
}

/* ---------- 11. Tabla de productos (Cotizaciones) ---------- */
.items-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 18px;
  margin-bottom: 10px;
}

.items-header h2 {
  font-size: 16px;
}

.table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--waiya-gray-border);
  border-radius: var(--radius-md);
}

.items-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.items-table thead {
  background-color: var(--waiya-gray-light);
}

.items-table th {
  text-align: left;
  padding: 10px 12px;
  color: var(--waiya-blue);
  font-weight: 600;
  font-size: 13px;
}

.items-table td {
  padding: 8px 10px;
  border-top: 1px solid var(--waiya-gray-border);
}

.items-table input {
  padding: 8px 10px;
  font-size: 13px;
}

.item-subtotal {
  font-weight: 600;
  white-space: nowrap;
}

/* ---------- 12. Totales ---------- */
.totals-box {
  margin-top: 16px;
  margin-left: auto;
  max-width: 320px;
  background-color: var(--waiya-gray-light);
  border-radius: var(--radius-md);
  padding: 14px 18px;
}

.totals-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  padding: 4px 0;
}

.totals-final {
  border-top: 1px solid var(--waiya-gray-border);
  margin-top: 6px;
  padding-top: 10px;
  font-size: 16px;
  font-weight: 700;
  color: var(--waiya-blue);
}

/* ---------- 13. Responsivo ---------- */
@media (max-width: 640px) {
  .form-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    padding: 12px 16px;
  }

  .page {
    padding: 20px 14px 32px;
  }

  .totals-box {
    max-width: 100%;
  }
}
