/* ===========================
   micasacontenedor.es — Global CSS
   Warm / Natural Design System
   =========================== */

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

/* TOKENS */
:root {
  --cream:       #FAF7F2;
  --cream-2:     #F3EDE3;
  --warm-white:  #FEFCF8;
  --dark:        #1C1A14;
  --dark-2:      #2A2720;
  --dark-3:      #322E27;
  --forest:      #2F5F3F;
  --forest-lt:   #3D7A52;
  --forest-pale: rgba(47,95,63,.08);
  --copper:      #C47D2D;
  --copper-dk:   #A36820;
  --copper-pale: rgba(196,125,45,.1);
  --text:        #1E1A0F;
  --earth:       #5C4F35;
  --muted:       #9B8C6E;
  --sand:        #E2D8C8;
  --sand-lt:     #EDE7DB;
  --white:       #ffffff;

  --font-display: 'Playfair Display', Georgia, serif;
  --font-body:    'Inter', system-ui, sans-serif;

  --radius:    12px;
  --radius-lg: 20px;
  --radius-xl: 32px;

  --shadow:    0 4px 24px rgba(30,26,15,.08);
  --shadow-lg: 0 16px 56px rgba(30,26,15,.14);
  --transition: all .25s ease;

  --max-w: 1160px;
  --inner-pad: clamp(20px, 5vw, 48px);
}

html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--cream);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; }

/* INNER CONTAINER */
.inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--inner-pad);
}

/* ===== HEADER ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--dark);
  border-bottom: 1px solid rgba(255,255,255,.06);
  backdrop-filter: blur(10px);
}
.site-header .inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 68px;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}
.logo-icon {
  width: 38px;
  height: 24px;
  border: 2.5px solid var(--copper);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}
.logo-icon::before,
.logo-icon::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  width: 1.5px;
  background: var(--copper);
  opacity: .55;
}
.logo-icon::before { left: 30%; }
.logo-icon::after { left: 60%; }
.logo-text {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--warm-white);
  white-space: nowrap;
}
.logo-text em {
  color: var(--copper);
  font-style: normal;
}
.logo-text small {
  font-family: var(--font-body);
  font-size: .7rem;
  font-weight: 400;
  color: var(--muted);
}

/* Nav */
.header-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
}
.header-nav a {
  text-decoration: none;
  font-size: .875rem;
  font-weight: 500;
  color: rgba(255,255,255,.7);
  transition: var(--transition);
}
.header-nav a:hover { color: var(--copper); }

/* CTA button */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 11px 22px;
  background: var(--copper);
  color: #fff;
  font-family: var(--font-body);
  font-size: .875rem;
  font-weight: 700;
  text-decoration: none;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}
.btn:hover { background: var(--copper-dk); transform: translateY(-1px); }
.btn--forest {
  background: var(--forest);
}
.btn--forest:hover { background: var(--forest-lt); }
.btn--outline {
  background: transparent;
  border: 2px solid var(--copper);
  color: var(--copper);
}
.btn--outline:hover { background: var(--copper); color: #fff; }
.btn--lg { padding: 16px 32px; font-size: 1rem; }

/* Mobile hamburger placeholder */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px;
}
.hamburger span {
  width: 24px; height: 2px;
  background: var(--warm-white);
  border-radius: 2px;
  transition: var(--transition);
}
@media (max-width: 768px) {
  .hamburger { display: flex; }
  .header-nav { display: none; }
  .header-cta { display: none; }
}
/* Mobile nav open state */
@media (max-width: 768px) {
  .site-header.menu-open .header-nav {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    background: var(--dark);
    padding: 20px 24px 28px;
    gap: 4px;
    border-top: 1px solid rgba(255,255,255,.08);
    z-index: 999;
    box-shadow: 0 8px 32px rgba(0,0,0,.35);
  }
  .site-header.menu-open .header-nav a {
    font-size: 1rem;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,.07);
    color: rgba(255,255,255,.8);
  }
  .site-header.menu-open .header-cta {
    display: flex;
    padding: 16px 24px 0;
  }
  .site-header { position: relative; }
  .hamburger.is-active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .hamburger.is-active span:nth-child(2) { opacity: 0; }
  .hamburger.is-active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}


/* ===== BREADCRUMB ===== */
.breadcrumb {
  background: var(--cream-2);
  border-bottom: 1px solid var(--sand);
  padding: 10px 0;
}
.breadcrumb ol {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
  flex-wrap: wrap;
}
.breadcrumb li {
  font-size: .8rem;
  color: var(--muted);
}
.breadcrumb li:not(:last-child)::after {
  content: '›';
  margin-left: 8px;
}
.breadcrumb a {
  color: var(--forest);
  text-decoration: none;
}
.breadcrumb a:hover { text-decoration: underline; }

/* ===== SECTIONS ===== */
section, .section {
  padding: clamp(56px, 8vw, 100px) 0;
}
.section--cream { background: var(--cream); }
.section--cream-2 { background: var(--cream-2); }
.section--dark { background: var(--dark); color: var(--warm-white); }
.section--dark-2 { background: var(--dark-2); color: var(--warm-white); }
.section--forest { background: var(--forest); color: var(--warm-white); }

.section-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--forest);
  background: var(--forest-pale);
  border: 1px solid rgba(47,95,63,.2);
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 16px;
}
.section-label--light {
  color: var(--copper);
  background: var(--copper-pale);
  border-color: rgba(196,125,45,.2);
}

h1,h2,h3,h4,h5 {
  font-family: var(--font-display);
  line-height: 1.25;
  font-weight: 700;
}
.section-title {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  color: var(--text);
  margin-bottom: 16px;
}
.section-title--light { color: var(--warm-white); }
.section-lead {
  font-size: 1.1rem;
  color: var(--earth);
  max-width: 640px;
  margin-bottom: 48px;
}
.section-lead--light { color: rgba(255,255,255,.75); }

/* ===== CARDS ===== */
.card {
  background: var(--warm-white);
  border: 1px solid var(--sand);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: var(--transition);
}
.card:hover {
  box-shadow: var(--shadow);
  border-color: var(--sand-lt);
  transform: translateY(-2px);
}

/* ===== TABLES ===== */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 24px 0; border-radius: var(--radius); }
.table-wrap .data-table { margin: 0; }
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
  margin: 24px 0;
}
.data-table th {
  background: var(--forest);
  color: var(--warm-white);
  font-family: var(--font-body);
  font-weight: 600;
  text-align: left;
  padding: 12px 16px;
  font-size: .82rem;
}
.data-table td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--sand);
  vertical-align: top;
}
.data-table tr:nth-child(even) td { background: var(--cream-2); }
.data-table tr:last-child td { border-bottom: none; }

/* ===== HIGHLIGHT & WARN BOXES ===== */
.highlight-box {
  background: var(--forest-pale);
  border: 1px solid rgba(47,95,63,.18);
  border-left: 4px solid var(--forest);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin: 24px 0;
}
.highlight-box h3 { color: var(--forest); margin-bottom: 8px; font-size: 1rem; }
.warn-box {
  background: rgba(196,125,45,.08);
  border: 1px solid rgba(196,125,45,.2);
  border-left: 4px solid var(--copper);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin: 24px 0;
}
.warn-box h3 { color: var(--copper-dk); margin-bottom: 8px; font-size: 1rem; }

/* ===== AD SLOTS ===== */
.ad-slot {
  width: 100%;
  min-height: 90px;
  background: rgba(0,0,0,.03);
  border: 1px dashed var(--sand);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: .75rem;
  letter-spacing: .05em;
  text-transform: uppercase;
  margin: 32px auto;
}
.ad-slot--medium { min-height: 280px; max-width: 336px; }
.ad-slot--leaderboard { max-width: 728px; }

/* ===== LEAD FORM ===== */
.lead-form {
  background: var(--dark);
  border-radius: var(--radius-xl);
  padding: clamp(40px, 6vw, 72px);
}
.lead-form h2 { color: var(--warm-white); font-size: clamp(1.5rem,3vw,2rem); margin-bottom: 12px; }
.lead-form p { color: rgba(255,255,255,.65); margin-bottom: 36px; font-size: 1rem; }
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.form-field.full { grid-column: 1 / -1; }
.form-field label {
  font-size: .8rem;
  font-weight: 600;
  color: rgba(255,255,255,.55);
  letter-spacing: .04em;
  text-transform: uppercase;
}
.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--radius);
  color: var(--warm-white);
  font-family: var(--font-body);
  font-size: .92rem;
  outline: none;
  transition: var(--transition);
}
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  border-color: var(--copper);
  background: rgba(255,255,255,.1);
}
.form-field select option { background: var(--dark-2); color: var(--warm-white); }
.form-field textarea { resize: vertical; min-height: 90px; }
.form-privacy {
  font-size: .75rem;
  color: rgba(255,255,255,.4);
  margin-top: 16px;
  line-height: 1.6;
}
.form-privacy a { color: rgba(255,255,255,.6); }

/* ===== FOOTER ===== */
.site-footer {
  background: var(--dark);
  padding: 64px 0 32px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 48px;
}
@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
}
@media (max-width: 540px) {
  .footer-grid { grid-template-columns: 1fr; }
}
.footer-brand p {
  font-size: .9rem;
  color: rgba(255,255,255,.5);
  margin-top: 16px;
  line-height: 1.7;
  max-width: 280px;
}
.footer-col h4 {
  font-family: var(--font-body);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(255,255,255,.4);
  margin-bottom: 16px;
}
.footer-links { display: flex; flex-direction: column; gap: 10px; }
.footer-links a {
  font-size: .875rem;
  color: rgba(255,255,255,.6);
  text-decoration: none;
  transition: var(--transition);
}
.footer-links a:hover { color: var(--copper); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.08);
  padding-top: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}
.footer-bottom p {
  font-size: .8rem;
  color: rgba(255,255,255,.35);
}
.footer-legal { display: flex; gap: 20px; flex-wrap: wrap; }
.footer-legal a {
  font-size: .8rem;
  color: rgba(255,255,255,.35);
  text-decoration: none;
  transition: var(--transition);
}
.footer-legal a:hover { color: rgba(255,255,255,.65); }

/* ===== COOKIE BANNER ===== */
#cookie-banner {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 9999;
  background: var(--dark-2);
  border-top: 1px solid rgba(255,255,255,.1);
  padding: 20px var(--inner-pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  box-shadow: 0 -8px 40px rgba(0,0,0,.4);
}
#cookie-banner p {
  font-size: .85rem;
  color: rgba(255,255,255,.7);
  flex: 1;
  min-width: 280px;
}
#cookie-banner a { color: var(--copper); }
.cookie-btns { display: flex; gap: 12px; flex-wrap: wrap; }
.cookie-btn {
  padding: 9px 20px;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: .82rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: var(--transition);
}
.cookie-btn--accept { background: var(--copper); color: #fff; }
.cookie-btn--accept:hover { background: var(--copper-dk); }
.cookie-btn--decline { background: transparent; color: rgba(255,255,255,.55); border: 1px solid rgba(255,255,255,.2); }
.cookie-btn--decline:hover { background: rgba(255,255,255,.08); color: rgba(255,255,255,.8); }
.cookie-btn--config { background: transparent; color: rgba(255,255,255,.45); text-decoration: underline; font-size: .78rem; }

/* ===== COOKIE CONFIG MODAL ===== */
#cookie-config {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0,0,0,.65);
  align-items: center;
  justify-content: center;
  padding: 20px;
}
#cookie-config.open { display: flex; }
.config-panel {
  background: var(--dark-2);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--radius-lg);
  padding: 36px;
  max-width: 520px;
  width: 100%;
}
.config-panel h3 { color: var(--warm-white); margin-bottom: 8px; }
.config-panel > p { font-size: .85rem; color: rgba(255,255,255,.55); margin-bottom: 24px; }
.cookie-toggle {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.cookie-toggle:last-of-type { border-bottom: none; margin-bottom: 24px; }
.cookie-toggle-info h4 { color: var(--warm-white); font-size: .9rem; margin-bottom: 4px; }
.cookie-toggle-info p { font-size: .78rem; color: rgba(255,255,255,.45); }
.toggle-switch { position: relative; width: 42px; height: 24px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-track {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: rgba(255,255,255,.15);
  border-radius: 12px;
  transition: var(--transition);
}
.toggle-track::after {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  left: 3px; top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: var(--transition);
}
.toggle-switch input:checked + .toggle-track { background: var(--copper); }
.toggle-switch input:checked + .toggle-track::after { transform: translateX(18px); }
.toggle-switch input:disabled + .toggle-track { opacity: .5; cursor: default; }

/* ===== RESPONSIVE UTILS ===== */
@media (max-width: 768px) {
  section, .section { padding: clamp(40px,6vw,64px) 0; }
}

/* ===== FLOATING MOBILE CTA ===== */
.floating-cta {
  display: none;
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 800;
  box-shadow: var(--shadow-lg);
}
@media (max-width: 640px) {
  .floating-cta { display: block; }
}
