/* ======================
   CSS Reset & Normalize
   ====================== */
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6,
p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em,
img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var,
b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details,
embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary,
time, mark, audio, video {
  margin: 0; padding: 0; border: 0; font: inherit; vertical-align: baseline;
  box-sizing: border-box;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section {
  display: block;
}
body {
  line-height: 1.5; background: #F2E9DC; color: #222;
}
ol, ul {
  list-style: none;
}
a {
  text-decoration: none; color: inherit;
}
img {
  max-width: 100%;
  height: auto;
  display: block;
}
button, input, select, textarea {
  font-family: inherit; font-size: inherit;
  color: inherit;
}

/* ================================
   CSS Custom Properties (Fallback)
   ================================ */
:root {
  --color-primary: #395769;
  --color-secondary: #87A96B;
  --color-accent: #F2E9DC;
  --color-white: #fff;
  --color-black: #181D1A;
  --color-shadow: rgba(57, 87, 105, 0.15);
  --color-shadow-deep: rgba(57, 87, 105, 0.22);
  --radius: 20px;
  --font-display: 'Merriweather', Georgia, 'Times New Roman', Times, serif;
  --font-body: 'Open Sans', Arial, sans-serif;
}

/* ==================
   Typography Styles
   ================== */
body {
  font-family: var(--font-body);
  font-size: 16px;
  background: var(--color-accent);
  color: var(--color-primary);
  min-height: 100vh;
  letter-spacing: 0.01em;
}
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 16px;
}
h1 { font-size: 2.25rem; line-height: 1.15; }
h2 { font-size: 1.5rem; line-height: 1.2; }
h3 { font-size: 1.125rem; line-height: 1.3; }
h4 { font-size: 1rem; }
.subheadline { font-size: 1.25rem; margin-bottom: 24px; color: var(--color-secondary); }
p {
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 16px;
}
strong { color: var(--color-secondary); font-weight: bold; }
ul, ol {
  margin-bottom: 24px;
  padding-left: 20px;
}
ul li, ol li {
  margin-bottom: 10px;
  position: relative;
}
ul li::before {
  content: '';
  display: inline-block;
  background-color: var(--color-secondary);
  width: 10px; height: 10px;
  border-radius: 50%;
  margin-right: 8px;
  vertical-align: middle;
}

/* Creative Artistic Heading Accents */
h1, h2 {
  position: relative;
}
h1::after {
  content: '';
  display: block;
  width: 60px; height: 6px;
  background: var(--color-secondary);
  border-radius: 10px;
  margin-top: 12px;
}
h2::after {
  content: '';
  display: block;
  width: 40px; height: 4px;
  background: var(--color-secondary);
  border-radius: 10px;
  margin-top: 8px;
}

/* ================================
   Layout & Container Styles
   ================================ */
.container {
  max-width: 1200px;
  padding: 0 20px;
  margin: 0 auto;
  width: 100%;
}
.section {
  margin-bottom: 60px;
  padding: 40px 20px;
  background: none;
}
.content-wrapper {
  margin: 0 auto;
  max-width: 900px;
  padding: 0 8px;
}
.text-section {
  margin-bottom: 32px;
}

/* Flex spacing layouts (MANDATORY) */
.card-container, .feature-grid, .service-list-grid, .product-category-grid, .content-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: space-between;
}
.card, .feature-item, .service-item, .product-category {
  margin-bottom: 20px;
  position: relative;
  background: var(--color-white);
  border-radius: var(--radius);
  box-shadow: 0 2px 16px var(--color-shadow);
  padding: 24px 22px 20px 22px;
  flex: 1 1 275px;
  min-width: 260px;
}
.text-image-section {
  display: flex;
  align-items: center;
  gap: 30px;
  flex-wrap: wrap;
}
.testimonial-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  padding: 20px 28px;
  background: var(--color-accent);
  color: var(--color-primary);
  border-radius: var(--radius);
  min-width: 250px;
  box-shadow: 0 2px 16px var(--color-shadow);
  margin-bottom: 20px;
  transition: transform 0.23s cubic-bezier(.4,1.3,.6,0.84), box-shadow 0.25s;
}
.testimonial-card:hover, .card:hover, .feature-item:hover {
  transform: translateY(-3px) scale(1.025) rotate(-0.5deg);
  box-shadow: 0 8px 40px var(--color-shadow-deep);
}
.testimonial-meta {
  font-size: 0.97rem;
  color: var(--color-secondary);
}
.feature-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 15px;
  background: var(--color-white);
}
/* Feature grid override: three cols desktop, single col mobile */
.feature-grid {
  width: 100%;
  justify-content: flex-start;
}
.feature-item img {
  width: 48px; height: 48px;
  margin-bottom: 4px;
}

/* Testimonial Layout */
.testimonial-slider {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  margin-bottom: 16px;
}

/* Service List for servizi/escursioni */
.service-list-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  margin-bottom: 16px;
}
.service-item {
  background: var(--color-white);
  border-radius: var(--radius);
  box-shadow: 0 2px 16px var(--color-shadow);
  padding: 22px 20px 18px 20px;
  margin-bottom: 20px;
  min-width: 240px;
  flex: 1 1 260px;
}

/* Products in negozio */
.product-category-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  margin-bottom: 16px;
}
.product-category {
  background: var(--color-white);
  border-radius: var(--radius);
  box-shadow: 0 2px 16px var(--color-shadow);
  padding: 24px 20px 18px 20px;
  margin-bottom: 20px;
  min-width: 220px;
  flex: 1 1 220px;
}

/* Map placeholder for contatti */
.map-placeholder {
  width: 100%;
  min-height: 120px;
  border-radius: var(--radius);
  background: linear-gradient(105deg, var(--color-secondary) 60%, var(--color-accent) 100%);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 20px;
  margin-bottom: 24px;
}
.address-block {
  font-size: 1rem;
  font-family: var(--font-body);
  font-weight: 600;
}

/* =====================
   Artistic Visual Accents
   ===================== */
section {
  border-radius: 38px 8px 30px 38px/16px 32px 48px 38px;
  background: rgba(135, 169, 107, 0.07);
  box-shadow: 0 2px 16px var(--color-shadow);
}
hr {
  border: none;
  height: 2px;
  background: var(--color-secondary);
  border-radius: 4px;
  margin: 40px 0 24px 0;
}

/* =================================
   Buttons & Interactive Elements
   ================================= */
.btn-primary,
.btn-primary:visited {
  display: inline-block;
  background: linear-gradient(90deg, var(--color-secondary) 60%, var(--color-primary) 120%);
  color: var(--color-accent);
  font-family: var(--font-display);
  font-size: 1.19rem;
  font-weight: bold;
  letter-spacing: 0.04em;
  border: none;
  border-radius: var(--radius);
  padding: 14px 36px;
  margin-top: 20px;
  cursor: pointer;
  box-shadow: 0 2px 10px var(--color-shadow);
  transition: background 0.24s, color 0.24s, transform 0.2s;
  position: relative;
  overflow: hidden;
}
.btn-primary:hover, .btn-primary:focus {
  background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
  color: var(--color-white);
  transform: translateY(-1px) scale(1.05);
}
.btn-secondary {
  display: inline-block;
  background: var(--color-white);
  color: var(--color-primary);
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: bold;
  border-radius: var(--radius);
  padding: 10px 28px;
  border: 2px solid var(--color-primary);
  box-shadow: 0 2px 12px var(--color-shadow);
  margin-top: 10px;
  cursor: pointer;
  transition: background 0.19s, color 0.18s, border 0.2s;
}
.btn-secondary:hover, .btn-secondary:focus {
  background: var(--color-primary);
  color: var(--color-accent);
  border-color: var(--color-secondary);
}

/* =======================
   Header & Navigation Bar
   ======================= */
header {
  width: 100%;
  background: var(--color-white);
  box-shadow: 0 2px 12px var(--color-shadow);
  position: sticky; top: 0; z-index: 110;
  padding: 0 0 0 0;
}
header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 20px 14px 20px;
}
nav {
  display: flex;
  gap: 22px;
  align-items: center;
}
nav a {
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--color-primary);
  font-weight: 600;
  padding: 6px 10px 6px 7px;
  transition: color 0.17s, background 0.17s, border 0.18s;
  border-radius: 6px;
  position: relative;
}
nav a:hover, nav a.active {
  color: var(--color-secondary);
  background: rgba(135, 169, 107, 0.14);
}

header .btn-primary {
  margin: 0 0 0 16px;
  padding: 12px 30px;
  font-size: 1rem;
}

/* ===============
   Footer Styling
   =============== */
footer {
  width: 100%;
  background: var(--color-primary);
  color: var(--color-accent);
  border-top-left-radius: 38px;
  border-top-right-radius: 8px;
  margin-top: 60px;
  font-family: var(--font-body);
}
footer .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 42px 20px 28px 20px;
}
footer nav {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}
footer nav a {
  color: var(--color-accent);
  font-size: 0.95rem;
  transition: color 0.16s;
}
footer nav a:hover {
  text-decoration: underline;
  color: var(--color-secondary);
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1rem;
  font-family: var(--font-display);
}
.footer-brand img {
  width: 36px; height: 36px;
}

/* ================
   Hero Section
   ================ */
.hero {
  min-height: 430px;
  background: linear-gradient(110deg, var(--color-secondary) 10%, var(--color-accent) 100%);
  border-radius: 0 0 38px 38px/0 0 22px 38px;
  padding: 80px 0 56px 0;
  position: relative;
  box-shadow: 0 8px 56px var(--color-shadow);
}
.hero .content-wrapper {
  max-width: 700px;
  margin: 0 auto;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.hero h1 {
  font-size: 2.75rem;
  color: var(--color-primary);
}
.hero .subheadline {
  font-size: 1.3rem; color: var(--color-primary);
}
.hero .btn-primary {
  margin-top: 28px;
}

/* ============
   Galleria Page
   ============ */
.galleria-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
}
.galleria-gallery figure {
  border-radius: var(--radius);
  background: var(--color-white);
  box-shadow: 0 2.5px 18px var(--color-shadow);
  overflow: hidden;
}
.galleria-gallery img {
  border-radius: var(--radius) var(--radius) 0 0;
}

/* ============
   Misc helpers
   ============ */
.text-left   { text-align: left !important; }
.text-center { text-align: center !important; }
.text-right  { text-align: right !important; }

/* Spacing helpers */
.mt-3 { margin-top: 32px !important; }
.mb-3 { margin-bottom: 32px !important; }
.gap-8 { gap: 8px !important; }
.gap-16 { gap: 16px !important; }
.gap-24 { gap: 24px !important; }

/* ===============
   Responsive Design
   =============== */
@media (max-width: 991px) {
  .container { max-width: 90vw; }
  h1 { font-size: 2rem; }
  .hero { padding: 54px 0 34px 0; }
  .feature-item, .service-item, .product-category {
    min-width: 48vw;
  }
}
@media (max-width: 768px) {
  header .container, footer .container {
    flex-direction: column;
    align-items: flex-start;
    padding: 18px 14px;
  }
  nav {
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
  }
  .hero .content-wrapper { padding: 0 0; }
  .feature-grid, .service-list-grid, .product-category-grid {
    flex-direction: column;
    gap: 20px;
  }
  .feature-item, .service-item, .product-category {
    min-width: 96vw;
    flex: 1 1 100%;
  }
  .testimonial-slider {
    flex-direction: column;
    gap: 18px;
  }
  .text-image-section {
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
  }
}
@media (max-width: 550px) {
  .container, .content-wrapper {
    padding: 0 4px;
  }
  .hero { padding: 30px 0 30px 0;
          border-radius: 0 0 22px 26px/0 0 9px 18px; }
  h1 { font-size: 1.45rem; }
  h2 { font-size: 1.08rem; }
}

/* ===============
   Mobile Hamburger Menu
   =============== */
.mobile-menu-toggle {
  display: none;
  background: var(--color-secondary);
  color: var(--color-primary);
  border-radius: 50%;
  border: 0;
  width: 48px; height: 48px;
  font-size: 2rem;
  align-items: center;
  justify-content: center;
  position: absolute;
  right: 22px; top: 18px;
  z-index: 200;
  cursor: pointer;
  transition: background 0.18s;
}
.mobile-menu-toggle:hover, .mobile-menu-toggle:focus {
  background: var(--color-primary);
  color: var(--color-accent);
}
.mobile-menu {
  display: none;
  position: fixed;
  top: 0; right: 0;
  width: 100vw;
  height: 100vh;
  background: linear-gradient(105deg, var(--color-secondary) 90%, var(--color-primary) 100%);
  color: var(--color-accent);
  z-index: 1000;
  transform: translateX(100vw);
  transition: transform 0.35s cubic-bezier(.33,1.35,.55,1), box-shadow 0.25s;
}
.mobile-menu.open {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  padding-top: 44px;
  transform: translateX(0);
  box-shadow: -8px 0 44px var(--color-shadow-deep);
}
.mobile-menu-close {
  background: var(--color-primary);
  color: var(--color-accent);
  border: 0;
  border-radius: 50%;
  width: 48px; height: 48px;
  font-size: 2rem;
  position: absolute;
  top: 14px; right: 18px;
  cursor: pointer;
}
.mobile-nav {
  display: flex;
  flex-direction: column;
  margin: 32px 0 0 24px;
  gap: 16px;
}
.mobile-nav a {
  color: var(--color-primary);
  font-family: var(--font-display);
  font-size: 1.18rem;
  padding: 10px 18px;
  border-radius: 12px;
  background: rgba(255,255,255,0.10);
  transition: background 0.18s, color 0.18s;
  margin-right: 20px;
}
.mobile-nav a:hover {
  color: var(--color-secondary);
  background: var(--color-white);
}
@media (max-width: 991px) {
  nav { display: none; }
  .mobile-menu-toggle {
    display: flex;
  }
  header .btn-primary { display: none; }
}
@media (min-width: 992px) {
  .mobile-menu, .mobile-menu-toggle {
    display: none !important;
  }
}

/* ===============
   Cookie Consent Banner
   =============== */
.cookie-banner {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  width: 100vw;
  background: var(--color-primary);
  color: var(--color-accent);
  z-index: 9999;
  box-shadow: 0 -5px 28px var(--color-shadow-deep);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 12px 18px 18px;
  font-size: 1rem;
  border-radius: 18px 18px 0 0;
  animation: banner-appear 0.38s cubic-bezier(.37,1.25,.72,.97);
}
@keyframes banner-appear {
  from { opacity: 0; transform: translateY(100px); }
  to { opacity: 1; transform: translateY(0); }
}
.cookie-banner__text {
  max-width: 700px;
  font-family: var(--font-body);
}
.cookie-banner__buttons {
  display: flex;
  gap: 12px;
  align-items: center;
}
.cookie-banner .btn-primary,
.cookie-banner .btn-secondary {
  font-size: 1rem;
  padding: 10px 24px;
  margin-top: 0;
}

/* Cookie Modal */
.cookie-modal {
  display: none;
  position: fixed;
  left: 0; right: 0; top: 0; bottom: 0;
  z-index: 13000;
  background: rgba(57, 87, 105, 0.52);
  align-items: center;
  justify-content: center;
  animation: modal-fadein 0.33s cubic-bezier(.34,1.8,.47,.97);
}
@keyframes modal-fadein {
  from { opacity: 0; }
  to { opacity: 1; }
}
.cookie-modal.active {
  display: flex;
}
.cookie-modal__dialog {
  background: var(--color-accent);
  color: var(--color-primary);
  border-radius: 24px;
  max-width: 410px;
  width: 92vw;
  box-shadow: 0 8px 56px var(--color-shadow-deep);
  overflow: hidden;
  padding: 32px 30px 22px 30px;
  animation: pop 0.36s cubic-bezier(.33,1.3,.61,0.87);
}
@keyframes pop {
  0% { transform: scale(0.9); opacity:0.5; }
  80%{ transform: scale(1.02); }
  100%{ transform: scale(1); opacity:1; }
}
.cookie-modal__header {
  font-family: var(--font-display);
  font-size: 1.22rem;
  font-weight: bold;
  margin-bottom: 10px;
}
.cookie-modal__options {
  font-size: 1rem;
  margin-bottom: 24px;
}
.cookie-category {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
  font-size: 1rem;
}
.cookie-category input[type=checkbox] {
  accent-color: var(--color-secondary);
  width: 18px; height: 18px;
}
.cookie-category--essential input[type=checkbox] {
  accent-color: var(--color-primary);
}
.cookie-modal__footer {
  display: flex;
  justify-content: flex-end;
  gap: 14px;
}
.cookie-modal__close {
  position: absolute;
  top: 12px; right: 20px;
  background: var(--color-secondary);
  color: var(--color-primary);
  border: none;
  border-radius: 50%;
  width: 40px; height: 40px;
  font-size: 1.2rem;
  display: flex;
  align-items: center; justify-content: center;
  cursor: pointer;
}
.cookie-modal__close:hover {
  background: var(--color-primary); color: var(--color-accent);
}

@media (max-width: 550px) {
  .cookie-banner {
    flex-direction: column;
    align-items: flex-start;
    padding: 15px 8px 11px 12px;
    gap: 12px;
  }
  .cookie-modal__dialog {
    padding: 16px 10px 12px 10px;
  }
}

/* ===== Scrollbar for desktop ===== */
@media (min-width:800px){
  body{ scrollbar-width:thin; scrollbar-color: var(--color-secondary) var(--color-accent); }
  ::-webkit-scrollbar {width: 10px; background: var(--color-accent);}
  ::-webkit-scrollbar-thumb {background: var(--color-secondary); border-radius: 6px;}
  ::-webkit-scrollbar-thumb:hover {background: var(--color-primary);}
}

/* ===============
   Micro-interactions
   =============== */
.card, .feature-item, .service-item, .product-category {
  transition: box-shadow 0.23s, transform 0.19s, border 0.19s;
}
.card:hover, .feature-item:hover, .service-item:hover, .product-category:hover {
  box-shadow: 0 8px 44px var(--color-shadow-deep);
  transform: translateY(-3px) scale(1.03);
}
a, .btn-primary, .btn-secondary {
  transition: color 0.2s, background 0.2s;
}

/* ===============
   Form Elements
   =============== */
input, textarea, select {
  border: 1.5px solid var(--color-secondary);
  border-radius: 16px;
  background: var(--color-white);
  padding: 10px 14px;
  margin-bottom: 14px;
  font-family: var(--font-body);
  box-shadow: 0 1px 4px var(--color-shadow);
  font-size: 1rem;
  width: 100%;
  outline: none;
  transition: border 0.18s;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--color-primary);
}

/* ===============
   Accessibility
   =============== */
:focus {
  outline: 2.2px dashed var(--color-secondary);
  outline-offset: 2.2px;
}
.btn-primary:focus, .btn-secondary:focus {
  outline: 2.2px solid var(--color-primary); outline-offset: 2px;
}

/* ===============
   Artistic/Creative Touches
   =============== */
.card, .testimonial-card, .feature-item, .service-item, .product-category {
  border-bottom: 5px solid var(--color-secondary);
  border-left: 4px solid var(--color-primary);
  /* Paint brush stroke effect (simplified): */
  background-clip: padding-box;
  position: relative;
}
.card::before, .testimonial-card::before, .feature-item::before, .service-item::before, .product-category::before {
  content: '';
  display: block;
  position: absolute;
  left: 18px; top: -12px;
  width: 35px; height: 6px;
  background: var(--color-secondary);
  border-radius: 8px;
  opacity: 0.25;
}

/* Minimal fade-in on page load */
body { opacity: 0; animation: bodyin 0.5s forwards; }
@keyframes bodyin {
  from { opacity: 0; }
  to { opacity: 1; }
}
