/* Legacy compatibility fix for pharmaciefelixfaure-lyon.fr (build e4e33fb HTML, modern screen.css) */

/* 1. Header navigation — make horizontal (was list-item / vertical column) */
#header-container nav > ul,
#header-container .header__sections nav > ul {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 4px;
}
#header-container nav > ul > li {
  display: inline-flex;
  align-items: center;
  list-style: none;
  position: relative;
  padding: 12px 16px;
}
#header-container nav > ul > li > a {
  text-decoration: none;
  color: inherit;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  font-size: 13px;
}
#header-container nav > ul > li:hover > a {
  color: var(--valwin-flow-action-color, #008c7e);
}
#header-container nav > ul > li > a > p {
  margin: 0;
}
#header-container .sub-nav.hide,
#header-container .sub-nav__items.hide,
#header-container nav ul ul {
  display: none;
}
#header-container nav > ul > li:hover .sub-nav,
#header-container nav > ul > li:focus-within .sub-nav {
  display: block;
  position: absolute;
  top: 100%;
  left: 0;
  background: #fff;
  box-shadow: 0 6px 18px rgba(0,0,0,0.12);
  min-width: 220px;
  z-index: 50;
  padding: 8px 0;
  border-top: 2px solid var(--valwin-flow-action-color, #008c7e);
}
#header-container nav > ul > li:hover .sub-nav .nav,
#header-container nav > ul > li:focus-within .sub-nav .nav {
  display: block;
  list-style: none;
  margin: 0;
  padding: 0;
}
#header-container nav > ul > li:hover .sub-nav .nav li,
#header-container nav > ul > li:focus-within .sub-nav .nav li {
  display: block;
  padding: 0;
}
#header-container nav > ul > li:hover .sub-nav .nav li a,
#header-container nav > ul > li:focus-within .sub-nav .nav li a {
  display: block;
  padding: 8px 16px;
  color: #333;
  text-decoration: none;
  white-space: nowrap;
}
#header-container nav > ul > li:hover .sub-nav .nav li a:hover {
  background: #f4f4f4;
  color: var(--valwin-flow-action-color, #008c7e);
}

/* 2. SVG icons — constrain see-more (was 1000x1000 full intrinsic size) */
svg#see-more {
  width: 28px !important;
  height: 28px !important;
  display: inline-block;
}

/* 3. Happening image / carousel — limit height + center */
.happening .happening-image {
  max-height: 480px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f6f6f6;
}
.happening .happening-image img {
  max-width: 100%;
  max-height: 480px;
  width: auto;
  height: auto;
  object-fit: contain;
}
.featured-happenings.carousel,
.featured-happenings .carousel-inner,
.featured-happenings .item {
  max-height: 540px;
  overflow: hidden;
}

/* 4. Tool card images — limit width inside card layout */
.tool-card,
.tools-list .tool {
  max-width: 320px;
  margin: 0 auto;
}
.tool-card .tool-card__img,
.tools-list .tool img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* 5. Pharmacy logo — keep proportions */
header img[alt$="logo"] {
  max-height: 80px;
  width: auto;
}

/* 6. Cookie banner — fix backdrop overlay (was full viewport absolute) */
.cookies-banner-background {
  position: fixed !important;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.45);
  z-index: 9990;
}
.cookies-banner {
  position: fixed !important;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: #fff;
  box-shadow: 0 -4px 18px rgba(0,0,0,0.12);
  max-height: 65vh;
  overflow-y: auto;
}
.cookies-banner-content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 18px 24px;
}

/* 7. Aquitem fidelity card header — constrain decorative images */
.fidelityCardAquitemHeader {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 8px 12px;
  flex-wrap: wrap;
}
.fidelityCardAquitemHeader__left,
.fidelityCardAquitemHeader__right {
  max-height: 56px;
  width: auto;
  height: auto;
}
.fidelityCardAquitemHeader__title {
  font-weight: 600;
}

/* 8. .logos-without-group (footer/regulators) - constrain */
dl.logos-without-group {
  max-width: 90px;
  max-height: 90px;
}
dl.logos-without-group dd img {
  max-width: 100%;
  height: auto;
}

/* 9. Make sure connection link / search-toggle stay aligned in header */
.search-toggle__button { padding: 8px; }
.header__section--first { display: flex; align-items: center; gap: 12px; padding: 8px 16px; }
.header__section--second { display: flex; align-items: center; justify-content: space-between; padding: 12px 24px; gap: 16px; flex-wrap: wrap; }

/* 10. Hide old-style break helpers (xs/sm/md/lg) tied to bootstrap show/hide */
.hide { display: none !important; }

/* 11. Pharmacie de garde calendar — restore 7-column grid layout */
.onduty-calendar { padding: 16px; }
.onduty-calendar .calendar { width: 100%; }
.onduty-calendar .calendar .month {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--valwin-flow-action-color, #008c7e);
  color: #fff;
  padding: 10px 16px;
  border-radius: 4px 4px 0 0;
}
.onduty-calendar .calendar .month .arrow {
  width: auto;
  cursor: pointer;
  padding: 4px 12px;
  flex-shrink: 0;
}
.onduty-calendar .calendar .month .title {
  width: auto;
  font-weight: 600;
  text-transform: capitalize;
}
.onduty-calendar .calendar-inner > .week-days,
.onduty-calendar .calendar-inner .days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  padding: 8px;
}
.onduty-calendar .calendar-inner .week-days > * {
  text-align: center;
  font-weight: 700;
  padding: 6px 0;
  background: #efefef;
}
.onduty-calendar .calendar-inner .days > .day {
  width: auto;
  height: 38px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #e6e6e6;
  border-radius: 3px;
  font-size: 14px;
  background: #fff;
}
.onduty-calendar .calendar-inner .days > .day.non-current {
  opacity: 0.35;
  background: #fafafa;
}
.onduty-calendar .calendar-inner .days > .day p {
  margin: 0;
}
.onduty-calendar .onduty-pharmacy {
  display: block;
  padding: 8px 16px;
  margin-top: 8px;
  background: var(--valwin-flow-action-color, #008c7e);
  color: #fff;
  text-align: center;
  border-radius: 4px;
}

/* 12. Empty happening image (only meta, no img) — collapse */
.happening .happening-image:empty,
.happening .happening-image:not(:has(img)) {
  display: none;
}
.featured-happenings.carousel .happening:not(:has(img)) {
  background: #fbfbfb;
  border: 1px solid #eee;
  padding: 24px;
  border-radius: 6px;
}

/* 13. Sections vertical spacing */
#site-intro .pharmacy-intro {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}
#site-intro .pharmacy-intro.with-happening.with-duty {
  grid-template-columns: 1fr 1fr;
}
@media (max-width: 768px) {
  #site-intro .pharmacy-intro.with-happening.with-duty { grid-template-columns: 1fr; }
}

/* 14. Tools section card grid */
.tools-list, .tools, [class*="tools-grid"] {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
img.tool-card__img {
  max-width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 6px 6px 0 0;
}
