/* ===================================================
   Ideal Óptica da Malveira — Stylesheet
   Mobile-first, accessible, large-text friendly
   =================================================== */

/* --- Design tokens -------------------------------- */
:root {
  --orange:        #C94A08;
  --orange-dark:   #A33A04;
  --orange-light:  #F4752A;
  --orange-bg:     #FFF3EC;
  --text:          #1A1A1A;
  --text-mid:      #3D3D3D;
  --text-muted:    #5A5A5A;
  --bg:            #FFFFFF;
  --bg-alt:        #F7F4F1;
  --border:        #E0D8D2;
  --radius:        10px;
  --shadow:        0 3px 16px rgba(0,0,0,0.09);
  --shadow-sm:     0 1px 6px rgba(0,0,0,0.07);
  --transition:    0.2s ease;
}

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

html {
  scroll-behavior: smooth;
  font-size: 18px;
  overflow-x: clip;
}

body {
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.75;
  -webkit-text-size-adjust: 100%;
  overflow-x: clip; /* clip overflow without breaking position:sticky */
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--orange);
  text-decoration: underline;
}

a:hover,
a:focus {
  color: var(--orange-dark);
}

/* --- Skip to content ------------------------------ */
.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  background: var(--orange);
  color: #fff;
  padding: 0.75rem 1.25rem;
  font-size: 1rem;
  font-weight: 700;
  border-radius: var(--radius);
  z-index: 9999;
  text-decoration: none;
  transition: top var(--transition);
}

.skip-link:focus {
  top: 1rem;
}

/* --- Header / Nav --------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--orange);
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}

.header-inner {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0 1rem;
  max-width: 1100px;
  margin: 0 auto;
  min-height: 52px;
}

.site-name {
  font-size: 1rem;
  font-weight: 800;
  color: #fff;
  white-space: nowrap;
  letter-spacing: 0.01em;
  line-height: 1.2;
  flex-shrink: 0;
}

.site-nav {
  display: none;            /* hidden on mobile — users scroll naturally */
  list-style: none;
  gap: 0;
}

.site-nav a {
  display: flex;
  align-items: center;
  padding: 0.45rem 0.7rem;
  color: #fff;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: 6px;
  white-space: nowrap;
  min-height: 44px;
  transition: background var(--transition);
}

.site-nav a:hover,
.site-nav a:focus {
  background: rgba(255,255,255,0.2);
  color: #fff;
  outline: 3px solid rgba(255,255,255,0.7);
  outline-offset: 2px;
}

/* --- Layout helpers ------------------------------- */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.section {
  padding: 4rem 0;
}

.section--alt {
  background: var(--bg-alt);
}

.section__heading {
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 0.4rem;
  line-height: 1.25;
}

.section__heading-bar {
  width: 60px;
  height: 5px;
  background: var(--orange);
  border-radius: 3px;
  margin-bottom: 2rem;
}

/* --- Hero ----------------------------------------- */
.hero {
  background: linear-gradient(135deg, var(--orange) 0%, var(--orange-dark) 100%);
  color: #fff;
  padding: 3.5rem 1.25rem 0;
  text-align: center;
}

.hero__eyebrow {
  font-size: 0.95rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  opacity: 0.85;
  margin-bottom: 0.75rem;
}

.hero__title {
  font-size: 2.6rem;
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 1rem;
}

.hero__sub {
  font-size: 1.15rem;
  line-height: 1.65;
  opacity: 0.93;
  max-width: 580px;
  margin: 0 auto 2rem;
}

.hero__image {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  object-position: center 40%;
  margin-top: 2rem;
  border-radius: var(--radius) var(--radius) 0 0;
}

/* --- Quem Somos ----------------------------------- */
.about-grid {
  display: grid;
  gap: 2.5rem;
  align-items: center;
}

.about-text p {
  margin-bottom: 1.1rem;
  font-size: 1rem;
  color: var(--text-mid);
}

.about-text p:last-child {
  margin-bottom: 0;
}

.about-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--orange-bg);
  border: 2px solid var(--orange);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  margin-top: 1.25rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--orange-dark);
}

.about-badge svg {
  flex-shrink: 0;
}

.about-image img {
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  width: 100%;
}

/* --- Serviços ------------------------------------- */
.services-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.service-card {
  background: var(--bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.service-card--highlight {
  border: 2px solid var(--orange);
  background: var(--orange-bg);
}

.service-card__icon {
  width: 48px;
  height: 48px;
  background: var(--orange-bg);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.service-card--highlight .service-card__icon {
  background: #fff;
}

.service-card__title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}

.service-card__desc {
  font-size: 0.9rem;
  color: var(--text-mid);
  line-height: 1.6;
}

.badge-free {
  display: inline-block;
  background: var(--orange);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 800;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 0.2rem;
  width: fit-content;
}

/* --- Acordos / Parceiros — Ticker ----------------- */
.ticker-wrapper {
  width: 100%;
  /* Fade edges so cards glide in/out softly */
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 8%, black 92%, transparent 100%);
  mask-image: linear-gradient(to right, transparent 0%, black 8%, black 92%, transparent 100%);
}

.ticker-outer {
  width: 100%;            /* constrain so overflow:hidden actually clips */
  overflow: hidden;
  display: flex;          /* two tracks side by side = seamless loop */
}

.ticker-track {
  display: flex;
  gap: 1rem;
  animation: ticker-scroll 120s linear infinite;
  /* Each track is half the total, so together they cover the full loop */
}

.ticker-outer:hover .ticker-track,
.ticker-outer:focus-within .ticker-track {
  animation-play-state: paused;
}

@keyframes ticker-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-100%); }
}

@media (prefers-reduced-motion: reduce) {
  .ticker-outer {
    overflow: visible;
    flex-wrap: wrap;
  }
  /* Hide the duplicate track — only show the real one as a static grid */
  .ticker-track[aria-hidden="true"] {
    display: none;
  }
  .ticker-track {
    flex-wrap: wrap;
    animation: none;
  }
  .ticker-wrapper {
    -webkit-mask-image: none;
    mask-image: none;
  }
}

.partner-card {
  flex: 0 0 180px;
  height: 100px;
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem;
  text-align: center;
}

.partner-card img {
  max-width: 130px;
  max-height: 60px;
  object-fit: contain;
  margin: 0 auto;
}

.partner-card__name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-mid);
  line-height: 1.3;
}

.ticker-hint {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.75rem;
  font-style: italic;
}

@media (prefers-reduced-motion: reduce) {
  .ticker-hint { display: none; }
}

/* --- Promoções ------------------------------------ */
.promo-images {
  display: grid;
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}

.promo-images img {
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  width: 100%;
}

.promo-cards {
  display: grid;
  gap: 1rem;
}

.promo-card {
  background: var(--bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border-left: 5px solid var(--orange);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.promo-card__price {
  font-size: 2rem;
  font-weight: 900;
  color: var(--orange);
  white-space: nowrap;
  line-height: 1;
}

.promo-card__label {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
}

.promo-disclaimer {
  margin-top: 1.75rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}

/* --- Separator image ------------------------------ */
.image-separator {
  width: 100%;
  max-height: 340px;
  object-fit: cover;
  object-position: center 35%;
  display: block;
}

/* --- Contactos ------------------------------------ */
.contact-section {
  background: var(--bg-alt);
}

.contact-header {
  background: var(--orange);
  padding: 2.5rem 1.25rem;
  text-align: center;
}

.contact-header h2 {
  font-size: 2rem;
  font-weight: 900;
  color: #fff;
}

.contact-header p {
  color: rgba(255,255,255,0.9);
  font-size: 1rem;
  margin-top: 0.4rem;
}

.contact-grid {
  display: grid;
  gap: 2.5rem;
  padding: 3rem 1.25rem;
  max-width: 1100px;
  margin: 0 auto;
}

.contact-card {
  background: var(--bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem 1.75rem;
}

.contact-card__title {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 3px solid var(--orange);
}

.contact-item {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}

.contact-item:last-child {
  margin-bottom: 0;
}

.contact-item__icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  background: var(--orange-bg);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.1rem;
}

.contact-item__label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.15rem;
}

.contact-item__value {
  font-size: 1rem;
  color: var(--text);
  font-weight: 600;
}

.contact-item__value a {
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
}

.contact-item__value a:hover,
.contact-item__value a:focus {
  color: var(--orange);
  text-decoration: underline;
}

.phone-link {
  font-size: 1.35rem !important;
  color: var(--orange) !important;
  font-weight: 800 !important;
}

.hours-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  margin-top: 0.25rem;
}

.hours-table td {
  padding: 0.4rem 0;
  vertical-align: top;
}

.hours-table td:first-child {
  font-weight: 700;
  color: var(--text);
  width: 55%;
}

.hours-table td:last-child {
  color: var(--text-mid);
}

.btn-map {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--orange);
  color: #fff;
  text-decoration: none;
  font-size: 1rem;
  font-weight: 700;
  padding: 0.85rem 1.5rem;
  border-radius: var(--radius);
  margin-top: 1.5rem;
  min-height: 52px;
  transition: background var(--transition);
}

.btn-map:hover,
.btn-map:focus {
  background: var(--orange-dark);
  color: #fff;
  outline: 3px solid var(--orange);
  outline-offset: 3px;
}

.map-frame {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  height: 100%;
  min-height: 320px;
}

.map-frame iframe {
  width: 100% !important;   /* override the width="600" HTML attribute */
  height: 100%;
  min-height: 320px;
  border: 0;
  display: block;
}

/* --- Reclamações badge ---------------------------- */
.reclamacoes-wrap {
  text-align: center;
  padding: 2rem 1.25rem 0;
}

.reclamacoes-wrap a {
  display: inline-block;
}

.reclamacoes-wrap img {
  max-width: 180px;
  margin: 0 auto;
}

/* --- Footer --------------------------------------- */
.site-footer {
  background: #1A1A1A;
  color: #CCCCCC;
  text-align: center;
  padding: 1.75rem 1.25rem;
  font-size: 0.85rem;
  line-height: 1.6;
}

.site-footer p + p {
  margin-top: 0.3rem;
}

/* ===================================================
   Responsive — Tablet and up (≥ 640px)
   =================================================== */
@media (min-width: 640px) {
  .promo-images {
    grid-template-columns: 1fr 1fr;
  }

  .promo-cards {
    grid-template-columns: 1fr 1fr;
  }
}

/* ===================================================
   Responsive — Desktop (≥ 900px)
   =================================================== */
@media (min-width: 900px) {
  html {
    font-size: 18px;
  }

  .site-name {
    font-size: 1.15rem;
  }

  .site-nav {
    display: flex;
  }

  .site-nav a {
    font-size: 0.92rem;
    padding: 0.5rem 0.85rem;
  }

  .hero__title {
    font-size: 3.2rem;
  }

  .about-grid {
    grid-template-columns: 1fr 1fr;
  }

  .services-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .contact-grid {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }

  .section__heading {
    font-size: 2.1rem;
  }
}
