/* ============================================================
   FARMACIA SAN LORENZO - style.css
   Vanilla CSS, mobile-first, no frameworks.
   Palette ispirata al logo: blu navy #3F51B5
   ============================================================ */

:root {
  --primary: #3F51B5;
  --primary-dark: #2C3A8A;
  --primary-light: #E8EAF6;
  --text: #2c2c2c;
  --text-light: #5a5a5a;
  --bg: #ffffff;
  --bg-alt: #f5f5f7;
  --border: #e0e0e0;
  --shadow: 0 2px 12px rgba(0,0,0,.08);
  --shadow-lg: 0 6px 24px rgba(0,0,0,.12);
  --radius: 6px;
  --container: 1140px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; transition: color .2s; }
a:hover { color: var(--primary-dark); }

h1, h2, h3, h4 {
  font-weight: 600;
  line-height: 1.25;
  color: var(--primary-dark);
  margin-bottom: .6em;
}
h1 { font-size: clamp(1.7rem, 4vw, 2.6rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: clamp(1.15rem, 2.2vw, 1.4rem); }
p { margin-bottom: 1em; color: var(--text-light); }

/* Container & layout */
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 1rem; }
.row { display: flex; flex-wrap: wrap; margin: 0 -.75rem; }
[class^="col-"], [class*=" col-"] { padding: 0 .75rem; width: 100%; }

@media (min-width: 768px) {
  .col-sm-2 { width: 16.666%; }
  .col-sm-4 { width: 33.333%; }
  .col-sm-6 { width: 50%; }
  .col-sm-8 { width: 66.666%; }
  .col-sm-10 { width: 83.333%; }
  .col-sm-12 { width: 100%; }
  .col-sm-offset-1 { margin-left: 8.333%; }
  .col-sm-offset-2 { margin-left: 16.666%; }
}

.text-center { text-align: center; }
.text-justify { text-align: justify; }
.text-uppercase { text-transform: uppercase; }
.img-responsive { max-width: 100%; height: auto; }
.img-circle { border-radius: 50%; }
.center-block { margin-left: auto; margin-right: auto; }

.mt30 { margin-top: 30px; } .mt40 { margin-top: 40px; }
.mb20 { margin-bottom: 20px; } .mb30 { margin-bottom: 30px; }
.mb40 { margin-bottom: 40px; } .mb60 { margin-bottom: 60px; }
.mb80 { margin-bottom: 80px; }
.pt20 { padding-top: 20px; } .pt50 { padding-top: 50px; } .pt60 { padding-top: 60px; }
.pb50 { padding-bottom: 50px; } .pb60 { padding-bottom: 60px; }

/* ===== Header ===== */
header { position: sticky; top: 0; z-index: 1000; background: rgba(255,255,255,.97); backdrop-filter: blur(8px); box-shadow: var(--shadow); }
.navbar-inner { padding: .8rem 0; }
.navbar-inner .container { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.navbar-brand img { max-height: 60px; width: auto; }
.navbar-toggle {
  background: none; border: 1px solid var(--primary); color: var(--primary);
  width: 42px; height: 42px; border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.navbar-toggle .icon-bar { width: 20px; height: 2px; background: var(--primary); display: block; position: relative; }
.navbar-toggle .icon-bar::before,
.navbar-toggle .icon-bar::after { content: ''; position: absolute; left: 0; width: 20px; height: 2px; background: var(--primary); }
.navbar-toggle .icon-bar::before { top: -6px; }
.navbar-toggle .icon-bar::after  { top: 6px; }
.navbar-collapse { display: none; width: 100%; }
.navbar-collapse.open { display: block; }
.navbar-nav { list-style: none; display: flex; flex-direction: column; gap: 0; padding: 1rem 0 0; }
.navbar-nav li a {
  display: block; padding: .7rem 1rem; color: var(--text); font-weight: 500;
  border-bottom: 1px solid var(--border);
}
.navbar-nav li.active-section a,
.navbar-nav li a:hover { color: var(--primary); }

@media (min-width: 992px) {
  .navbar-toggle { display: none; }
  .navbar-collapse { display: flex !important; width: auto; }
  .navbar-nav { flex-direction: row; padding: 0; gap: .5rem; }
  .navbar-nav li a { border: none; padding: .5rem 1rem; position: relative; }
  .navbar-nav li.active-section a::after,
  .navbar-nav li a:hover::after {
    content: ''; position: absolute; bottom: 0; left: 20%; right: 20%;
    height: 2px; background: var(--primary);
  }
}

/* ===== Hero ===== */
.banner, .banner1, #home-content-container {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  color: #fff; padding: 5rem 0; text-align: center;
}
#home-content-container h1, .banner h1, .banner1 h1 { color: #fff; }
#home-content { color: #fff; letter-spacing: 1px; }

/* ===== Frasi ad effetto ===== */
.fraseadeffetto { background: var(--bg-alt); padding: 3rem 0; text-align: center; }
.fraseadeffetto h1 { font-size: 1.5rem; font-weight: 400; font-style: italic; color: var(--primary-dark); }
.fraseadeffetto2 { background: var(--primary); color: #fff; padding: 3rem 0; text-align: center; }
.fraseadeffetto2 h1 { color: #fff; font-weight: 400; font-size: 1.3rem; }
.fraseadeffetto3 { background: var(--primary-light); padding: 2rem 0; text-align: center; }
.fraseadeffetto3 h2 { color: var(--primary-dark); }
.frasesottoteam { background: var(--bg-alt); padding: 2.5rem 0; text-align: center; }
.frasesottoteam h1 { font-size: 1.2rem; font-weight: 400; font-style: italic; }

/* ===== Title underblock ===== */
.title-underblock { position: relative; padding-bottom: 1rem; margin-bottom: 1.5rem; }
.title-underblock::after {
  content: ''; position: absolute; left: 50%; bottom: 0; transform: translateX(-50%);
  width: 60px; height: 3px; background: var(--primary);
}
.first-color { color: var(--primary); }

/* ===== Buttons ===== */
.btn {
  display: inline-block; padding: .75rem 1.8rem; border: 2px solid var(--primary);
  border-radius: var(--radius); background: var(--primary); color: #fff;
  font-weight: 600; cursor: pointer; transition: all .25s; text-transform: uppercase;
  font-size: .9rem; letter-spacing: .5px;
}
.btn:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.btn-default, .readmore { background: transparent; color: var(--primary); }
.btn-default:hover, .readmore:hover { background: var(--primary); color: #fff; }

/* ===== Whoami ===== */
.whoami { max-width: 360px; margin: 1rem auto 2rem; }

/* ===== Team carousel ===== */
.team-parallax { padding: 4rem 0; background: var(--bg-alt); }
.team-member-carousel {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1.5rem; padding: 1rem 0;
}
.team-member { text-align: center; }
.partner img { width: 140px; height: 140px; object-fit: cover; border-radius: 50%; margin: 0 auto .8rem; box-shadow: var(--shadow); }
.team-member h3 { font-size: 1rem; color: var(--text); }

/* ===== Reparti home ===== */
#portfolio-item-container {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem; max-width: var(--container); margin: 0 auto; padding: 0 1rem;
}
.portfolio-item {
  position: relative; aspect-ratio: 1/1; perspective: 1000px;
  border-radius: var(--radius); overflow: hidden; cursor: pointer;
}
.box3d-wrapper {
  position: relative; width: 100%; height: 100%; transition: transform .6s;
  transform-style: preserve-3d;
}
.portfolio-item:hover .box3d-wrapper { transform: rotateY(180deg); }
.portfolio-item .front,
.portfolio-item .portfolio-meta {
  position: absolute; inset: 0; backface-visibility: hidden;
  display: flex; align-items: center; justify-content: center; padding: 1.5rem;
}
.portfolio-item .front { background: var(--primary); color: #fff; flex-direction: column; text-align: center; }
.portfolio-item .front h3 { color: #fff; font-size: 1.1rem; }
.portfolio-item .portfolio-meta {
  background: var(--primary-dark); color: #fff; transform: rotateY(180deg);
  flex-direction: column; text-align: center; overflow-y: auto;
}
.portfolio-item .portfolio-meta h3,
.portfolio-item .portfolio-meta p { color: #fff; font-size: .9rem; }

/* ===== Servizi page (tutti uguali, left-aligned) ===== */
#servizi-page { padding: 3rem 1rem; }
.servizio {
  background: var(--bg-alt); border-left: 4px solid var(--primary);
  padding: 1.5rem; margin-bottom: 1.5rem; border-radius: var(--radius);
  display: flex; gap: 1.5rem; align-items: flex-start;
  text-align: left;
}
.servizio-icon {
  flex: 0 0 110px; width: 110px; height: 110px;
  background: #fff; border-radius: var(--radius);
  padding: 8px; box-shadow: var(--shadow);
}
.servizio-icon img { width: 100%; height: 100%; object-fit: contain; }
.servizio-body { flex: 1; text-align: left; }
.servizio-body h3 { text-align: left; margin-bottom: .5rem; }
.servizio-body p { text-align: left; }
@media (max-width: 600px) {
  .servizio { flex-direction: column; align-items: center; }
  .servizio-icon { flex: 0 0 auto; width: 100px; height: 100px; }
  .servizio-body { text-align: left; width: 100%; }
}
.page-header { padding: 2rem 0; border-bottom: 1px solid var(--border); }

/* ===== Gallery ===== */
#gallery-wrapper { padding: 2rem 0; background: var(--bg-alt); }
#gallery {
  list-style: none; display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: .8rem; max-width: var(--container); margin: 0 auto; padding: 0 1rem;
}
#gallery li { overflow: hidden; border-radius: var(--radius); cursor: pointer; box-shadow: var(--shadow); }
#gallery li img { width: 100%; height: 220px; object-fit: cover; transition: transform .4s; }
#gallery li:hover img { transform: scale(1.05); }

.lightbox-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.92);
  display: none; align-items: center; justify-content: center; z-index: 9999; padding: 1rem;
}
.lightbox-overlay.open { display: flex; }
.lightbox-overlay img { max-width: 95vw; max-height: 90vh; box-shadow: 0 0 40px rgba(0,0,0,.5); }
.lightbox-close {
  position: absolute; top: 1rem; right: 1rem; background: #fff;
  width: 44px; height: 44px; border-radius: 50%; border: none;
  font-size: 1.5rem; cursor: pointer; color: var(--text);
}

/* ===== Contatti ===== */
.mega-contact { padding: .4rem 0; }
.mega-contact h2 { font-size: 1.05rem; font-weight: 400; color: var(--text); }
.mega-contact h2 strong { color: var(--primary-dark); }
.well {
  background: var(--primary-light); padding: 1.5rem; border-radius: var(--radius);
  margin-bottom: 1rem;
}

/* ===== Orari table ===== */
.table-responsive { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: .8rem; border: 1px solid var(--border); }
.table thead { background: var(--primary); color: #fff; }
.table thead th { color: #fff; }
.table tr.active { background: #fff3cd; }

/* ===== Map ===== */
.map-wrap { position: relative; }
.map-wrap iframe {
  width: 100%; height: 360px; border: 1px solid var(--border); border-radius: var(--radius);
  display: block;
}
.map-actions { margin-top: 1rem; text-align: center; }

/* ============================================================
   FOOTER - sfondo BIANCO, testo scuro
   ============================================================ */
footer { background: #fff; color: var(--text); padding-top: 2.5rem; border-top: 1px solid var(--border); }
.footer-top { padding: 0 0 2rem; text-align: center; }
.footer-top h2 { color: var(--primary-dark); }
.footer-top p { color: var(--text); margin-bottom: .4rem; }
.footer-top a { color: var(--primary); font-weight: 500; }
.footer-top a:hover { color: var(--primary-dark); }
.footer-social { margin-top: 1rem; }
.footer-social a { display: inline-block; margin: 0 .4rem; }
.footer-social img { display: inline-block; }

#footer-bottom {
  background: #fff; padding: 1.5rem 0;
  border-top: 1px solid var(--border);
}
.copyright { font-size: .85rem; color: var(--text-light); text-align: center; }
.copyright a { color: var(--primary); }
.copyright a:hover { color: var(--primary-dark); }
.copyright img { display: inline-block; margin: .75rem auto; }

/* ===== Floating buttons ===== */
#scroll-top, .whatsapp {
  position: fixed; right: 1rem; width: 48px; height: 48px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 1.3rem; box-shadow: var(--shadow-lg); z-index: 998;
  transition: opacity .3s, transform .3s;
}
#scroll-top {
  bottom: 5rem; background: var(--primary); opacity: 0; pointer-events: none;
}
#scroll-top.visible { opacity: 1; pointer-events: auto; }
#scroll-top::before { content: '↑'; font-size: 1.5rem; }
.whatsapp { bottom: 1rem; background: #25D366; }
.whatsapp::before { content: '✆'; }

.boss-loader-overlay { display: none !important; }
small { font-size: .75em; color: var(--text-light); }
