/* Shared corner radius for buttons, slider & selectors (matches Calculate button) */
:root {
  --radius: 8px;
  /* Brand backdrop: fills overscroll, safe areas & browser chrome on mobile */
  --bg-top: #8c4e1f;
  --bg-mid: #5f3921;
  --bg-bottom: #38251e;
  color-scheme: only light;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  background-color: var(--bg-mid);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: 'Moret Book', 'Poppins', sans-serif;
  -webkit-tap-highlight-color: transparent;
}

@font-face {
  font-family: 'Moret Book';
  src: url('fonts/Moret-Book.otf') format('opentype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Tiempos Fine Light';
  src: url('fonts/test-tiempos-fine-light.woff2') format('woff2');
  font-weight: normal;
  font-style: normal;
}

.header-logo {
  position: absolute;
  top: 40px;
  left: 50px;
  z-index: 10;
}

.header-logo img {
  width: 140px;
  height: auto;
  display: block;
}

.header-button {
  position: absolute;
  top: 40px;
  right: 50px;
  z-index: 10;
}

.header-button a {
  display: inline-block;
  padding: 12px 24px;
  background: #5f3921;
  color: #ffffff;
  text-decoration: none;
  border-radius: var(--radius);
  font-family: 'Poppins', sans-serif;
  font-size: 16px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.header-button a:hover {
  background: #4a2c18;
  transform: translateY(-2px);
}

.lamb-calculator-wrapper {
  background:
    url('LC_background_web.png') center center / cover no-repeat,
    linear-gradient(180deg, var(--bg-top) 0%, var(--bg-mid) 50%, var(--bg-bottom) 100%);
  background-color: var(--bg-mid);
  padding: 90px 20px 30px 20px;
  margin: 0;
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.lamb-calculator-header {
  max-width: 1100px;
  margin: 0 auto 28px auto;
  text-align: center;
}

.lamb-icon-wrapper {
  width: 190px;
  height: 190px;
  margin: 0 auto 20px auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lamb-icon-glow {
  display: none;
}

.lamb-icon {
  width: 190px;
  height: 190px;
  animation: glow-rotate 3s ease-in-out infinite;
}

@keyframes glow-rotate {
  0% {
    filter: drop-shadow(0 0 15px rgba(255, 140, 60, 1))
            drop-shadow(0 0 30px rgba(255, 140, 60, 0.8))
            drop-shadow(0 0 50px rgba(255, 165, 80, 0.6));
  }
  33% {
    filter: drop-shadow(0 0 20px rgba(255, 165, 80, 1))
            drop-shadow(0 0 40px rgba(255, 165, 80, 0.9))
            drop-shadow(0 0 60px rgba(255, 140, 60, 0.7));
  }
  66% {
    filter: drop-shadow(0 0 18px rgba(255, 180, 100, 1))
            drop-shadow(0 0 35px rgba(255, 180, 100, 0.9))
            drop-shadow(0 0 55px rgba(255, 140, 60, 0.6));
  }
  100% {
    filter: drop-shadow(0 0 15px rgba(255, 140, 60, 1))
            drop-shadow(0 0 30px rgba(255, 140, 60, 0.8))
            drop-shadow(0 0 50px rgba(255, 165, 80, 0.6));
  }
}

.lamb-calculator-title {
  font-family: 'Moret Book', 'Poppins', sans-serif;
  font-size: 44px;
  font-weight: normal;
  letter-spacing: -0.5px;
  color: #e8dcc8;
  margin: 0;
  line-height: 1.1;
}

.lamb-calculator-container {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  background: linear-gradient(180deg, #a67c52 0%, #e8dcc8 100%);
  border-radius: 20px;
  padding: 28px 40px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3), 0 0 60px rgba(255, 157, 77, 0.4);
  position: relative;
  border: 3px solid transparent;
  background-clip: padding-box;
  animation: glow-pulse 2s ease-in-out infinite;
}

@keyframes glow-pulse {
  0%, 100% {
    box-shadow:
      0 0 8px rgba(117, 63, 26, 0.4),
      0 0 15px rgba(117, 63, 26, 0.2),
      inset 0 0 8px rgba(166, 124, 82, 0.1);
    border-color: #8b5a3c;
  }
  50% {
    box-shadow:
      0 0 12px rgba(166, 124, 82, 0.5),
      0 0 20px rgba(166, 124, 82, 0.3),
      inset 0 0 10px rgba(166, 124, 82, 0.15);
    border-color: #a67c52;
  }
}

.calculator-input-group {
  margin-bottom: 18px;
}

.calculator-label {
  font-family: 'Moret Book', 'Poppins', sans-serif;
  font-size: 24px;
  color: #ffffff;
  font-weight: normal;
  display: block;
  margin-bottom: 8px;
  text-align: center;
  white-space: nowrap;
}

.calculator-slider-container {
  position: relative;
  margin-bottom: 10px;
  background: transparent;
  border-radius: 0;
  padding: 0;
  overflow: visible;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

.calculator-slider-fill {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 54px;
  background: #5f3921;
  border-radius: var(--radius) 0 0 var(--radius);
  pointer-events: none;
  z-index: 0;
  transition: width 0.1s ease;
}

.calculator-slider {
  width: 100%;
  max-width: 560px;
  margin: 10px auto;
  height: 54px;
  border-radius: var(--radius);
  background: #e8dcc8;
  outline: none;
  -webkit-appearance: none;
  position: relative;
  cursor: pointer;
  padding: 0;
  z-index: 1;
  display: block;
}

.calculator-slider::-webkit-slider-runnable-track {
  width: 100%;
  height: 54px;
  background: transparent;
  border-radius: var(--radius);
}

.calculator-slider::-moz-range-track {
  width: 100%;
  height: 54px;
  background: transparent;
  border-radius: var(--radius);
}

.calculator-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 54px;
  height: 54px;
  border-radius: var(--radius);
  background: #f5f0e8;
  cursor: grab;
  border: 2px solid #5f3921;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  margin-top: 0;
}

.calculator-slider::-webkit-slider-thumb:active {
  cursor: grabbing;
}

.calculator-slider::-moz-range-thumb {
  width: 54px;
  height: 54px;
  border-radius: var(--radius);
  background: #f5f0e8;
  cursor: grab;
  border: 2px solid #5f3921;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.calculator-slider::-moz-range-thumb:active {
  cursor: grabbing;
}

.calculator-value-display {
  position: absolute;
  top: 50%;
  left: 0;
  transform: translate(-50%, -50%);
  width: 54px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Poppins', sans-serif;
  font-size: 24px;
  font-weight: 700;
  color: #5f3921;
  pointer-events: none;
  z-index: 10;
  line-height: 1;
  text-align: center;
}

.hunger-level-label {
  font-family: 'Moret Book', 'Poppins', sans-serif;
  font-size: 24px;
  color: #ffffff;
  font-weight: normal;
  display: block;
  margin-bottom: 10px;
  text-align: center;
  white-space: nowrap;
}

.hunger-level-buttons {
  position: relative;
  display: flex;
  background: #e8dcc8;
  border-radius: var(--radius);
  padding: 6px;
  max-width: 560px;
  margin: 0 auto;
}

.hunger-level-buttons::before {
  content: '';
  position: absolute;
  top: 6px;
  left: 6px;
  width: calc(33.333% - 6px);
  height: calc(100% - 12px);
  background: #5f3921;
  border-radius: var(--radius);
  transition: transform 0.3s ease;
  z-index: 0;
}

.hunger-level-buttons[data-active="snack"]::before {
  transform: translateX(0);
}

.hunger-level-buttons[data-active="regular"]::before {
  transform: translateX(calc(100% + 3px));
}

.hunger-level-buttons[data-active="big"]::before {
  transform: translateX(calc(200% + 6px));
}

.hunger-level-btn {
  flex: 1;
  padding: 12px 16px;
  background: transparent;
  border: none;
  border-radius: var(--radius);
  font-family: 'Poppins', sans-serif;
  font-size: 16px;
  color: #553026;
  cursor: pointer;
  transition: color 0.3s ease;
  font-weight: 400;
  position: relative;
  z-index: 1;
  white-space: nowrap;
}

.hunger-level-btn.active {
  color: #ffffff;
  font-weight: 500;
}

.calculator-button {
  width: 100%;
  padding: 16px;
  background: #5f3921;
  color: #ffffff;
  border: none;
  border-radius: var(--radius);
  font-family: 'Poppins', sans-serif;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.calculator-button:hover {
  background: #4a2c18;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(95, 57, 33, 0.3);
}

.calculator-reset {
  width: 100%;
  background: transparent;
  color: #553026;
  border: none;
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  cursor: pointer;
  margin-top: 4px;
  padding: 8px;
  text-decoration: underline;
  opacity: 0.7;
  transition: opacity 0.3s ease;
}

.calculator-reset:hover {
  opacity: 1;
}

.results-section-wrapper {
  background: #e8dcc8;
  padding: 60px 20px;
  margin: 0;
  display: none;
}

.results-section-container {
  max-width: 1400px;
  margin: 0 auto;
}

.results-title {
  font-family: 'Tiempos Fine Light', sans-serif;
  font-size: 42px;
  color: #553026;
  margin: 0 0 40px 0;
  text-align: center;
  font-weight: 300;
}

.results-recommendation {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 20px;
}

.result-card {
  background: #d5cab8;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: transform 0.3s ease;
}

.result-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.result-card-image {
  width: 100%;
  height: 250px;
  object-fit: cover;
  display: block;
}

.result-card-content {
  padding: 20px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.result-card-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(85, 48, 38, 0.2);
}

.result-card-name {
  font-family: 'Poppins', sans-serif;
  font-size: 20px;
  color: #553026;
  margin: 0;
  font-weight: 400;
}

.result-card-description {
  font-family: 'Moret Book', 'Poppins', sans-serif;
  font-size: 14px;
  color: #553026;
  line-height: 1.6;
  margin: 0 0 16px 0;
  flex-grow: 1;
}

.result-card-tags {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.result-card-tag {
  background: #553026;
  color: #e8dcc8;
  font-family: 'Poppins', sans-serif;
  font-size: 11px;
  padding: 4px 12px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.result-card-tag::before {
  content: '✓';
  display: inline-block;
  width: 14px;
  height: 14px;
  background: #e8dcc8;
  color: #553026;
  border-radius: 50%;
  text-align: center;
  line-height: 14px;
  font-size: 10px;
}

.result-card-weight {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding: 16px 0;
  border-top: 1px solid rgba(85, 48, 38, 0.2);
  border-bottom: 1px solid rgba(85, 48, 38, 0.2);
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  color: #553026;
}

.result-card-weight-label {
  font-weight: 400;
}

.result-card-weight-value {
  font-weight: 500;
}

.result-card-button {
  display: block;
  width: 100%;
  padding: 14px 24px;
  background: #553026;
  color: #ffffff;
  border: none;
  border-radius: var(--radius);
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-decoration: none;
  text-align: center;
}

.result-card-button:hover {
  background: #3d2a23;
  transform: translateY(-1px);
}

.no-results {
  text-align: center;
  color: #553026;
  font-family: 'Moret Book', 'Poppins', sans-serif;
  font-size: 14px;
  padding: 20px;
  opacity: 0.7;
}

@media screen and (max-height: 820px) {
  .lamb-calculator-wrapper {
    padding-top: 80px;
    padding-bottom: 20px;
  }

  .lamb-icon-wrapper,
  .lamb-icon {
    width: 150px;
    height: 150px;
  }

  .lamb-icon-wrapper {
    margin-bottom: 14px;
  }

  .lamb-calculator-title {
    font-size: 36px;
  }

  .lamb-calculator-header {
    margin-bottom: 20px;
  }

  .lamb-calculator-container {
    padding: 22px 40px;
  }

  .calculator-label,
  .hunger-level-label {
    font-size: 22px;
  }
}

@media screen and (max-height: 700px) {
  .lamb-icon-wrapper,
  .lamb-icon {
    width: 110px;
    height: 110px;
  }

  .lamb-icon-wrapper {
    margin-bottom: 10px;
  }
}

@media screen and (max-width: 1024px) {
  .results-recommendation {
    grid-template-columns: repeat(2, 1fr);
  }

  .results-title {
    font-size: 36px;
  }
}

@media screen and (max-width: 750px) {
  .desktop-break {
    display: none;
  }

  .header-logo {
    top: calc(25px + env(safe-area-inset-top));
    left: calc(25px + env(safe-area-inset-left));
  }

  .header-logo img {
    width: 100px;
  }

  .header-button {
    top: calc(25px + env(safe-area-inset-top));
    right: calc(25px + env(safe-area-inset-right));
  }

  .header-button a {
    padding: 10px 20px;
    font-size: 14px;
  }

  .lamb-calculator-wrapper {
    padding: calc(90px + env(safe-area-inset-top)) 15px calc(40px + env(safe-area-inset-bottom)) 15px;
  }

  .lamb-calculator-container {
    padding: 30px 20px;
  }

  .lamb-icon-wrapper {
    margin-bottom: 15px;
  }

  .lamb-calculator-header {
    margin-bottom: 30px;
  }

  .lamb-calculator-title {
    font-size: 28px;
  }

  .hunger-level-btn {
    font-size: 12px;
    padding: 8px 8px;
    min-width: 0;
  }

  .calculator-label {
    font-size: 20px;
    white-space: normal;
  }

  .results-recommendation {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 15px;
    padding-bottom: 20px;
    -webkit-overflow-scrolling: touch;
    padding-left: 15px;
    padding-right: 15px;
  }

  .result-card {
    flex: 0 0 calc(100% - 30px);
    scroll-snap-align: center;
  }

  .result-card-image {
    height: 350px;
  }

  .results-title {
    font-size: 32px;
    margin-bottom: 30px;
  }

  .results-section-wrapper {
    padding: 40px 15px;
  }

  .result-card-image {
    height: 200px;
  }

  .result-card-content {
    padding: 16px;
  }

  .result-card-name {
    font-size: 18px;
  }

  .result-card-description {
    font-size: 12px;
  }
}
