/* =============================================================
   BASE.CSS — Abanico Multiservicios
   Single source of truth for all global styles.
   Load order: base.css → layout.css → components.css
   ============================================================= */

/* ---------------------------------------------------------------
   1. CSS CUSTOM PROPERTIES
   --------------------------------------------------------------- */
:root {
  /* Brand colors */
  --red-primary:   #cc0001;
  --red-dark:      #a80001;
  --red-hover:     #b30000;
  --red-light:     #ff4d4d;   /* dark-mode accents only */

  /* Neutrals */
  --gray-body:     #5b5b5b;
  --gray-dark:     #333333;
  --gray-light:    #f5f5f5;
  --white:         #ffffff;

  /* Dark mode surfaces */
  --dm-bg:         #121212;
  --dm-surface:    #1e1e1e;
  --dm-surface-2:  #2c2c2c;
  --dm-text:       #e0e0e0;
  --dm-text-muted: #aaaaaa;

  /* Typography */
  --font-display:  'Fjalla One', sans-serif;
  --font-body:     'Nunito Sans', sans-serif;

  /* Spacing */
  --navbar-height: 64px;

  /* Transitions */
  --transition-fast:   0.2s ease;
  --transition-std:    0.3s ease;
  --transition-slow:   0.5s ease;
}


/* ---------------------------------------------------------------
   2. BOX SIZING & RESET
   --------------------------------------------------------------- */
html {
  box-sizing: border-box;
  scroll-behavior: smooth;
}
*, *::before, *::after {
  box-sizing: inherit;
}


/* ---------------------------------------------------------------
   3. BASE BODY
   --------------------------------------------------------------- */
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--gray-body);
  background-color: var(--gray-light);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}


/* ---------------------------------------------------------------
   4. TYPOGRAPHY
   --------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.08rem;
  color: var(--gray-dark);
  text-align: center;
  margin-top: 0;
}
h1 { font-size: 2.6rem;  margin-bottom: 1rem; }
h2 { font-size: 2.1rem;  margin-bottom: 0.9rem; }
h3 { font-size: 1.75rem; margin-bottom: 0.8rem; }
h4 { font-size: 1.5rem;  margin-bottom: 0.75rem; }
h5 { font-size: 1.25rem; margin-bottom: 0.6rem; }
h6 { font-size: 1.05rem; margin-bottom: 0.5rem; }

p { margin-top: 0; }

.lead {
  font-size: 1.1rem;
  line-height: 1.7;
}

.text-brown  { color: #8B4513; }
.text-red    { color: var(--red-primary); }
.text-justify { text-align: justify; }


/* ---------------------------------------------------------------
   5. LINKS
   --------------------------------------------------------------- */
a {
  color: var(--gray-body);
  text-decoration: none;
  transition: color var(--transition-std);
}
a:hover {
  color: var(--red-primary);
}


/* ---------------------------------------------------------------
   6. IMAGES
   --------------------------------------------------------------- */
img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}
.round {
  border-radius: 0.35rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}


/* ---------------------------------------------------------------
   7. BUTTONS
   --------------------------------------------------------------- */
.btn-red {
  background-color: var(--red-primary) !important;
  color: var(--white) !important;
  border: 2px solid var(--red-primary) !important;
  transition: background-color var(--transition-std),
              box-shadow var(--transition-std),
              transform var(--transition-fast);
}
.btn-red:hover,
.btn-red:focus {
  background-color: var(--red-dark) !important;
  border-color: var(--red-dark) !important;
  box-shadow: 0 4px 14px rgba(204, 0, 1, 0.3);
  transform: translateY(-1px);
}


/* ---------------------------------------------------------------
   8. BACKGROUND HELPERS
   --------------------------------------------------------------- */
.bg-clear { background: rgba(255, 255, 255, 0.8); }
.bg-gray  { background: rgba(91, 91, 91, 0.8); color: var(--white); }


/* ---------------------------------------------------------------
   9. SECTION DIVIDER
   --------------------------------------------------------------- */
.border-red {
  border: none;
  border-top: 0.15rem solid var(--red-primary);
  max-width: 92%;
  margin: 2.5rem auto;
  opacity: 1;
}

.section-separator {
  height: 5px;
  background-color: var(--red-primary);
  width: 80%;
  margin: 2.5rem auto;
  border-radius: 3px;
  transition: transform var(--transition-std), box-shadow var(--transition-std);
}
.section-separator:hover {
  transform: scaleX(1.04);
  box-shadow: 0 4px 12px rgba(204, 0, 1, 0.25);
}


/* ---------------------------------------------------------------
   10. PAGE HEADER (used on inner pages: about, services, contact)
   --------------------------------------------------------------- */
.page-header {
  padding: calc(var(--navbar-height) + 3rem) 0 3rem;
  text-align: center;
  background: linear-gradient(to bottom, #f0f0f0 0%, var(--white) 100%);
}
.page-header h1 {
  font-size: 3rem;
  color: var(--red-primary);
  margin-bottom: 0.75rem;
}
.page-header .lead {
  font-size: 1.2rem;
  color: var(--gray-body);
  max-width: 700px;
  margin: 0 auto 0.5rem;
}
.page-header .priority {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--red-primary);
  margin: 0.75rem 0;
}
.page-header .description {
  max-width: 760px;
  margin: 1rem auto 0;
  font-size: 1.05rem;
  line-height: 1.7;
  color: #555;
}


/* ---------------------------------------------------------------
   11. ACCORDION (services pages)
   --------------------------------------------------------------- */
.abanico-accordion .accordion-button {
  background: var(--white);
  border: 2px solid var(--red-primary);
  border-radius: 0.75rem !important;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--gray-dark);
  padding: 1.2rem 1.6rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: background-color var(--transition-std), color var(--transition-std);
}
.abanico-accordion .accordion-button:not(.collapsed) {
  background: var(--red-primary);
  color: var(--white);
  box-shadow: 0 4px 16px rgba(204, 0, 1, 0.25);
}
.abanico-accordion .accordion-button::after {
  filter: brightness(0) invert(0.3);
}
.abanico-accordion .accordion-button:not(.collapsed)::after {
  filter: brightness(0) invert(1);
}
.abanico-accordion .accordion-item {
  border: none;
  margin-bottom: 1.2rem;
  border-radius: 0.75rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}
.abanico-accordion .accordion-body {
  background: var(--white);
  border: 2px solid var(--red-primary);
  border-top: none;
  border-radius: 0 0 0.75rem 0.75rem;
  padding: 1.6rem 1.8rem;
}
.abanico-accordion .service-icon {
  font-size: 1.7rem;
  margin-right: 0.75rem;
  color: var(--red-primary);
  vertical-align: middle;
}
.abanico-accordion .service-desc {
  font-size: 1.05rem;
  color: #444;
  line-height: 1.65;
  margin-bottom: 1rem;
}
.abanico-accordion .list-group-item {
  border: none;
  padding: 0.4rem 0 0.4rem 2.5rem;
  position: relative;
  font-size: 1rem;
  color: var(--gray-dark);
  background: transparent;
}
.abanico-accordion .list-group-item::before {
  content: "•";
  color: var(--red-primary);
  font-weight: bold;
  position: absolute;
  left: 1.2rem;
  font-size: 1.3rem;
  line-height: 1.5;
}


/* ---------------------------------------------------------------
   12. CALLOUT BOX (about-us CTA)
   --------------------------------------------------------------- */
.callout-box {
  border: 2px solid var(--red-primary);
  border-radius: 12px;
  padding: 2rem;
  background-color: #fdfbfb;
  transition: box-shadow var(--transition-std);
}
.callout-box:hover {
  box-shadow: 0 6px 20px rgba(204, 0, 1, 0.12);
}
.callout-box h5 {
  color: var(--gray-dark);
  margin-bottom: 0;
}


/* ---------------------------------------------------------------
   13. CONTACT PAGE
   --------------------------------------------------------------- */
.contact-item {
  display: flex;
  align-items: center;
  margin-bottom: 1.6rem;
  font-size: 1.2rem;
}
.contact-item .contact-icon {
  font-size: 1.9rem;
  color: var(--red-primary);
  margin-right: 1rem;
  width: 48px;
  text-align: center;
  flex-shrink: 0;
}
.contact-item .contact-text,
.contact-item .contact-text a {
  font-weight: 600;
  color: var(--gray-dark);
  text-decoration: none;
  transition: color var(--transition-std);
}
.contact-item .contact-text a:hover {
  color: var(--red-primary);
}


/* ---------------------------------------------------------------
   14. DARK MODE
   All dark-mode overrides in one place.
   Triggered by: body.dark-mode (global class toggled by JS)
   --------------------------------------------------------------- */
body.dark-mode {
  background-color: var(--dm-bg);
  color: var(--dm-text);
}

/* Typography */
body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3,
body.dark-mode h4,
body.dark-mode h5,
body.dark-mode h6 {
  color: var(--dm-text);
}
body.dark-mode a {
  color: var(--dm-text-muted);
}
body.dark-mode a:hover {
  color: var(--red-light);
}

/* Page header */
body.dark-mode .page-header {
  background: linear-gradient(to bottom, #1a1a1a 0%, var(--dm-surface) 100%);
}
body.dark-mode .page-header h1 { color: var(--red-light); }
body.dark-mode .page-header .lead,
body.dark-mode .page-header .description { color: var(--dm-text-muted); }

/* Accordion */
body.dark-mode .abanico-accordion .accordion-button {
  background: var(--dm-surface-2);
  color: var(--dm-text);
  border-color: var(--red-primary);
}
body.dark-mode .abanico-accordion .accordion-button:not(.collapsed) {
  background: var(--red-primary);
  color: var(--white);
}
body.dark-mode .abanico-accordion .accordion-body {
  background: var(--dm-surface-2);
  border-color: var(--red-primary);
}
body.dark-mode .abanico-accordion .service-desc { color: #ccc; }
body.dark-mode .abanico-accordion .list-group-item { color: var(--dm-text); }

/* Callout box */
body.dark-mode .callout-box {
  background-color: var(--dm-surface);
  border-color: var(--red-light);
}
body.dark-mode .callout-box h5 { color: var(--dm-text); }

/* Contact */
body.dark-mode .contact-item .contact-text,
body.dark-mode .contact-item .contact-text a {
  color: var(--dm-text);
}
body.dark-mode .contact-item .contact-text a:hover {
  color: var(--red-light);
}

/* Section separator */
body.dark-mode .section-separator { background-color: var(--red-light); }

/* Generic cards/surfaces */
body.dark-mode .card,
body.dark-mode .bg-clear { background: var(--dm-surface-2); color: var(--dm-text); }


/* ---------------------------------------------------------------
   15. RESPONSIVE ADJUSTMENTS
   --------------------------------------------------------------- */
@media (max-width: 768px) {
  h1 { font-size: 2rem; }
  h2 { font-size: 1.7rem; }
  h3 { font-size: 1.5rem; }

  .page-header { padding: calc(var(--navbar-height) + 2rem) 0 2rem; }
  .page-header h1 { font-size: 2.2rem; }

  .abanico-accordion .accordion-button { font-size: 1.05rem; padding: 1rem 1.25rem; }
  .abanico-accordion .service-icon { font-size: 1.4rem; }

  .contact-item { font-size: 1.05rem; }
  .contact-item .contact-icon { font-size: 1.5rem; width: 38px; }
}
