/* Variables */
:root {
  --font-base: 'Nunito', sans-serif;
  --color-bg-light: #F8F5F8;
  --color-bg-dark: #F2EBF1;
  --color-text: #37352F;
  --color-accent: #843B78;
  --color-accent-light: #A45B8D;
  --color-btn-bg: #5C2954;
  --color-btn-text: #FFFFFF;
  --spacing: 1rem;
  --spacingHalfed: calc(var(--spacing) / 2);
  --radius: 8px;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.12);
  --touch-size: 2.5rem;
  --duration: .3s;
  --duration-short: .2s;
  --duration-medium: .4s;
  --duration-flash: .8s;
  --delay-flash: .1s;
  --btn-hover-bg: #652E1F;
  --whatsapp-bg: #25D366;
  --whatsapp-bg-hover: #1DA851;
  --flash-bg: rgba(132,59,120,0.2);
  --scrollbar-track-bg: var(--color-bg-dark);
  --scrollbar-thumb-bg: var(--color-accent);
  --scrollbar-thumb-border: 2px solid var(--color-bg-dark);
  --product-shadow-inset: inset 0 4px 6px -4px rgba(0,0,0,0.1);
  --product-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Base Element Styles */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 100%; line-height: 1.5; scroll-behavior: smooth; }
body {
  margin: 0; padding: 0;
  font-family: var(--font-base);
  background: var(--color-bg-light);
  color: var(--color-text);
}
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
img { max-width: 100%; height: auto; display: block; }
.skip-link {
  position: absolute; top: -40px; left: 0;
  background: var(--color-accent);
  color: var(--color-btn-text);
  padding: .5rem; z-index: 100;
  transition: top .3s;
}
.skip-link:focus { top: 0; }
h1, h2, h3, h4 { margin: var(--spacing) 0 .5rem; font-weight: 700; }
h1 { font-size: clamp(1.75rem,5vw,3rem); margin-bottom: var(--spacing); }
h2 { font-size: clamp(1.5rem,4vw,2rem); color: var(--color-accent); }
h3 { font-size: clamp(1.125rem,3vw,1.25rem); }
h4 { font-size: clamp(1rem,2.5vw,1rem); color: var(--color-accent); }
p { margin: 0 0 var(--spacing); }

/* Disable text selection on all devices */
*, *::before, *::after {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* Header */
header {
  background: var(--color-bg-light);
  padding: calc(var(--spacing)) var(--spacingHalfed);
  text-align: center;
  box-shadow: var(--shadow);
  border-bottom: 2.5px solid var(--color-accent);
  position: sticky; top: 0; z-index: 10;
}
header h1 {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}
header h1 .logo {
  width: auto;
  height: 1.5em;
  scale: 1.5;
  margin-right: var(--spacingHalfed);
  opacity: 0;
  animation: logoSlideIn 1s ease-out forwards;
  will-change: transform, opacity;
  position: absolute;
  left: var(--spacing);
}
@keyframes logoSlideIn {
  0% {
    transform: translateX(-50%) scale(0.5);
    opacity: 0;
  }
  60% {
    transform: translateX(20%) scale(1.2);
    opacity: 1;
  }
  100% {
    transform: translateX(0) scale(1);
    opacity: 1;
  }
}
@media (min-width: 601px) {
  header h1 .logo {
    position: static;
    left: auto;
    scale: 1.5;
  }
}

/* Navigation */
nav {
  position: relative;
}
nav > ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--spacing);
  margin-top: var(--spacing);
  align-items: stretch; /* changed from center to stretch */
  height: 48px; /* set a fixed height for vertical alignment */
}
nav > ul, nav > ul > li {
  align-items: center;
}
nav > ul > li {
  display: flex;
  align-items: center;
  height: 100%; /* make li take full height of ul */
}
nav > ul li a {
  padding: .5rem 1rem; border-radius: var(--radius);
  font-weight: 600; letter-spacing: .5px;
  transition: background var(--duration), transform var(--duration-short);
}
nav > ul li a:hover, nav > ul li a:focus {
  background: var(--color-accent); color: var(--color-btn-text);
  transform: translateY(-2px);
  outline: 3px solid var(--color-text);
}
.menu-toggle {
  display: none;
  position: absolute; top: var(--spacing); right: var(--spacing);
  width: var(--touch-size); height: var(--touch-size);
  background: none; border: none; cursor: pointer;
  flex-direction: column; justify-content: space-around;
  align-items: center; z-index: 11;
  padding: 0.5rem;
  right: var(--spacingHalfed);
  margin-top: 0;
}
.menu-toggle span {
  display: block; width: 24px; height: 3px;
  background: var(--color-text); border-radius: 2px;
  transition: transform var(--duration) ease, opacity var(--duration) ease;
}
.menu-toggle:hover span:nth-child(1) {
  transform: translateY(0);
}

/* Buttons */
button, .btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: var(--touch-size); padding: 0 1.5rem; border: none;
  border-radius: var(--radius); background: var(--color-btn-bg);
  color: var(--color-btn-text); box-shadow: var(--shadow);
  text-transform: uppercase; font-size: .9rem; letter-spacing:.5px;
  cursor: pointer; transition: background var(--duration), transform var(--duration-short), box-shadow var(--duration);
  margin-top: var(--spacing);
}
button:hover, button:focus, .btn:hover, .btn:focus {
  background: var(--btn-hover-bg); transform: translateY(-2px);
  box-shadow: var(--shadow-hover); outline: 3px solid var(--color-accent);
}
.btn-order { margin-top: calc(var(--spacing)*2); }
.btn-whatsapp {
  display: inline-flex; align-items: center; justify-content: center;
  gap: .5rem;
  background: var(--whatsapp-bg); color: #FFF; padding: .75rem 1.5rem;
  border-radius: var(--radius); box-shadow: var(--shadow);
  font-weight: 600; text-decoration: none;
  transition: background .3s, transform .2s;
}
.btn-whatsapp:hover, .btn-whatsapp:focus {
  background: var(--whatsapp-bg-hover); transform: translateY(-2px); outline: none;
}

/* Sections */
section {
  max-width:80%; margin:0 auto;
  padding: calc(var(--spacing)*3) var(--spacing);
  text-align: center;
}
section:nth-child(even) { background: var(--color-bg-dark); }
section + section { border-top:4px solid var(--color-accent); }

/* Products */
.products {
  display:grid;
  grid-template-columns: repeat(auto-fit,minmax(240px,1fr));
  gap: var(--spacing);
  margin-top: calc(var(--spacing)*1.5);
  align-items:start;
}
.product {
  background:#fff; padding:var(--spacing);
  border-radius:var(--radius); box-shadow:var(--shadow);
  display:flex; flex-direction:column;
  transition: transform var(--duration), box-shadow var(--duration);
  box-shadow: var(--shadow);
  position: relative;
}
.product:hover, .product:focus-within {
  transform: translateY(-4px); box-shadow:var(--shadow-hover);
}
.product-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacingHalfed);
  margin-bottom: var(--spacing);
}
.product-header .btn.expand {
  width: var(--touch-size);
  height: var(--touch-size);
  padding: 0;
  margin-top: 0;
  min-width: var(--touch-size);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  box-shadow: none;
  color: var(--color-btn-bg);
}
.product-header .btn.expand svg {
  width: 1.5rem;
  height: 1.5rem;
  margin-top: 5px;
  transition: transform var(--duration-short);
}
.product-header .btn.expand[aria-expanded="true"] svg {
  transform: rotate(180deg);
}
.product .allergens {
  font-size:.875rem; color:#7D9775;
  margin-bottom:var(--spacing);
}
.product-details {
  display:grid; row-gap:var(--spacingHalfed);
  margin-top:var(--spacing);
  border-top:1px solid var(--color-bg-dark);
  padding:0 var(--spacing);
  max-height:0; overflow:hidden;
  transition:max-height .3s ease, padding .3s ease;
}
.product-details:not([hidden]) {
  max-height:250px; overflow-y:auto; padding:var(--spacing);
  box-shadow: inset 0 4px 6px -4px rgba(0,0,0,0.1), 0 2px 8px rgba(0,0,0,0.1);
  border-radius: var(--radius);
}
.product-details h4 { margin-top:0; }
.product img.product-image {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  object-fit: cover;
  aspect-ratio: 4 / 3;
  margin-bottom: var(--spacing);
  box-shadow: var(--product-shadow-inset);
  display: block;
  position: relative;
  z-index: 1;
}
.product-overlay {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  left: auto;
  background: rgba(255,255,255,0.85);
  color: var(--color-accent);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.2em 0.8em;
  border-radius: 0.8em 0.2em 0.8em 0.8em;
  box-shadow: 0 2px 6px rgba(0,0,0,0.07);
  z-index: 2;
  pointer-events: none;
  letter-spacing: 0.5px;
}
.product-image-wrapper {
  position: relative;
  width: 100%;
  display: block;
}
.product-image-wrapper::before,
.product-image-wrapper::after {
  content: '';
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 2rem;
  font-weight: bold;
  color: rgba(255, 255, 255, 0.8);
  pointer-events: none;
  z-index: 3;
}
.product-image-wrapper::before {
  content: '❮❮';
  left: 1rem;
  animation: chevron-left 1.5s ease-in-out infinite;
}
.product-image-wrapper::after {
  content: '❯❯';
  right: 1rem;
  animation: chevron-right 1.5s ease-in-out infinite;
}
.product-image-wrapper.single-image::before,
.product-image-wrapper.single-image::after {
  display: none;
}
@keyframes chevron-left {
  0%, 100% { transform: translate(-1px, -50%); }
  50%     { transform: translate(-4px, -50%); }
}
@keyframes chevron-right {
  0%, 100% { transform: translate(1px, -50%); }
  50%     { transform: translate(4px, -50%); }
}
.product-details:not([hidden])::-webkit-scrollbar-track {
  background: var(--scrollbar-track-bg);
}
.product-details:not([hidden])::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb-bg);
  border: var(--scrollbar-thumb-border);
}
.product-details:not([hidden]) {
  scrollbar-width: thin;
  scrollbar-color: var(--color-accent) var(--color-bg-dark);
}

/* Process */
.process {
  display:flex; flex-wrap:wrap; justify-content:center;
  gap:var(--spacing); margin-top:calc(var(--spacing)*1.5);
}
.step {
  flex:1 1 180px; background:#fff;
  padding:var(--spacing); border-radius:var(--radius);
  box-shadow:var(--shadow); text-align:center;
  transition: transform var(--duration), box-shadow var(--duration);
}
.step:hover, .step:focus-within {
  transform: translateY(-4px); box-shadow:var(--shadow-hover);
  background:var(--color-bg-light);
}

/* Footer */
footer {
  background:var(--color-text); color:#B7B7A4;
  text-align:center; padding:calc(var(--spacing)*2) var(--spacing);
  font-size:.85rem;
}
footer a:hover, footer a:focus {
  color:#fff; outline:3px solid var(--color-accent);
}

/* Flash effect when navigating to a section via navbar */
section.flash {
  animation: flashSection var(--duration-flash) ease-in-out;
  animation-delay: var(--delay-flash);
}
@keyframes flashSection {
  0% { background-color: var(--flash-bg); }
  100% { background-color: transparent; }
}

/* Hero Section Styling */
.hero {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100vh;
  background: linear-gradient(135deg, var(--color-accent), var(--color-btn-bg), var(--color-accent-light));
  background-size: 300% 300%;
  animation: gradientAnimation 2.5s ease infinite;
  position: relative;
  color: #fff;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 0;
}
.hero > * {
  position: relative;
  z-index: 1;
}
.hero h2 {
  font-size: clamp(2.5rem, 6vw, 5rem);
  line-height: 1.1;
  margin-bottom: var(--spacing);
  animation: popIn 0.8s ease-out forwards;
  color: var(--color-accent-light);
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}
.hero p {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  max-width: 800px;
  margin-bottom: calc(var(--spacing) * 1.5);
  opacity: 0.95;
}
.hero .btn {
  font-size: clamp(1rem, 2.5vw, 1.1rem);
  padding: clamp(0.75rem, 2vw, 1rem) clamp(1.5rem, 4vw, 2rem);
  animation: bounce 2.5s infinite;
}
@keyframes popIn {
  0% { transform: scale(0.8); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
@keyframes gradientAnimation {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
@media (max-width: 600px) {
  .hero {
    padding: calc(var(--spacing) * 2) var(--spacing);
    height: auto;
    min-height: 70vh;
    text-align: center;
  }
  .hero h2 {
    font-size: clamp(2rem, 8vw, 3rem);
  }
  .hero p {
    font-size: clamp(0.9rem, 3.5vw, 1rem);
  }
  .hero .btn {
    width: 100%;
    max-width: 300px;
  }
}

/* Header adjustments for logo, title, and burger layout */
header h1 {
  text-align: center;
}
.menu-toggle {
  position: absolute;
  right: var(--spacingHalfed);
  top: 30%;
  margin-top: 0;
}

/* Responsive Styles */
@media (max-width:600px) {
  header {
    padding: var(--spacingHalfed) var(--spacingHalfed);
  }
  .menu-toggle {
    display: flex;
  }
  nav > ul {
    display: flex;
    flex-direction: column;
    background: var(--color-bg-light);
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    box-shadow: var(--shadow);
    padding: 0 var(--spacing);    gap: var(--spacingHalfed);
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.4s ease, opacity 0.4s ease;
  }
  nav.open > ul {
    max-height: 500px;
    opacity: 1;
    border: 2.5px solid var(--color-accent);
    border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
    box-shadow: 0 4px 16px rgba(132,59,120,0.08);
    margin-top: 8px;
    padding-bottom: var(--spacingHalfed);
    overflow: visible;
  }
  nav > ul li a {
    opacity: 0;
    transition: opacity 0.2s ease;
  }
  nav.open > ul li a {
    opacity: 1;
    transition-delay: 0.2s;
  }
  nav > ul li {
    margin: var(--spacingHalfed) 0;
  }
  nav li a {
    padding: .5rem 1rem;
  }
  .btn, .btn-whatsapp {
    width: 100%;
  }
  section {
    padding: var(--spacing) .5rem;
    max-width: 100%;
    margin: 0;
  }
  *, *::before, *::after {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
  }
  nav > ul {
    flex-direction: column;
    align-items: center; /* center all nav items horizontally */
    justify-content: flex-start;
    height: auto;
    min-height: 0;
    gap: var(--spacingHalfed);
    margin-top: 0;
  }
  nav > ul > li {
    display: flex;
    align-items: center;
    justify-content: center; /* center li content horizontally */
    height: 48px;
    width: 100%;
  }
  .language-selector {
    margin-left: 0;
    margin-top: var(--spacingHalfed);
    justify-content: center !important;
    align-items: center !important;
    height: 48px;
    width: 100%;
    display: flex !important;
  }
  .lang-button {
    height: 40px;
    min-width: 44px;
    min-height: 32px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

/* Hover Overrides */
.menu-toggle:hover, .menu-toggle:focus {
  background: rgba(0, 0, 0, 0.1);
}
.product:hover .product-overlay,
.product:focus-within .product-overlay {
  background: linear-gradient(90deg, #fff 70%, #f3e3f0 100%);
  color: var(--color-accent);
  box-shadow: 0 2px 8px rgba(132,59,120,0.10);
  transition: background 0.3s, color 0.3s, box-shadow 0.3s;
}

/* Language selector dropdown */
.language-selector {
  display: flex;
  align-items: center;
  height: 100%; /* ensure button fills li vertically */
  position: relative;
  margin-left: var(--spacingHalfed);
  /* Ensures alignment with nav items */
}
.lang-button {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 40px; /* match nav height minus padding */
  margin: 0;
  background: transparent;
  border-radius: var(--radius);
  padding: 2px 6px;
  cursor: pointer;
  transition: box-shadow var(--duration), border-color var(--duration);
  box-shadow: var(--shadow);
  min-width: 44px;
  min-height: 32px;
}
.lang-button:focus, .lang-button:hover {
  border-color: var(--color-accent-light);
  box-shadow: var(--shadow-hover);
  outline: none;
}
.lang-button img {
  width: 32px;
  height: 24px;
  border-radius: 4px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.07);
  display: block;
}
.lang-button span {
  color: var(--color-accent); /* Make language code visible */
  font-weight: bold;
  margin-left: 0.5em;
}
.lang-button:hover span, .lang-button:focus span {
  color: var(--color-btn-text);
}

.lang-dropdown {
  position: absolute;
  top: calc(65% + 0.5rem);
  right: 0;
  background: #fff;
  border: 2px solid var(--color-accent);
  border-radius: var(--radius);
  box-shadow: var(--shadow-hover);
  min-width: 48px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  align-items: center;
  padding: 0.25rem;
}
.lang-dropdown li {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
}
.lang-dropdown a {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px 6px;
  border-radius: 4px;
  transition: background var(--duration), box-shadow var(--duration);
}
.lang-dropdown a:hover, .lang-dropdown a:focus {
  background: var(--color-bg-dark);
  box-shadow: var(--shadow);
  outline: none;
}
.lang-dropdown a span {
  color: var(--color-accent);
  font-weight: bold;
  margin-left: 0.5em;
}
.lang-dropdown img {
  width: 32px;
  height: 24px;
  border-radius: 4px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.07);
}
@media (max-width:600px) {
  .language-selector {
    margin-left: 0;
    margin-top: var(--spacingHalfed);
    justify-content: flex-end;
  }
  .lang-dropdown {
    /* Position dropdown centered under the button */
    top: calc(100% + 0.25rem);
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    min-width: 44px;
  }
}

/* Remove old gallery-btn styles */
.gallery-btn,
.gallery-btn:hover,
.gallery-btn:focus,
.gallery-btn.left,
.gallery-btn.right {
  display: none !important;
}

/* Ensure the .hidden class hides elements completely */
.hidden {
  display: none !important;
}

