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

:root {
  --logo-color: #b27d6b;
  --logo-color-light: #e7b1a0;
  --logo-color-nav-hover: #ffefea;
  --logo-color-dark: #9c6856;
  --menu-text-color: #black;
  --menu-item-color: #black;
  --menu-item-hover-color: #black;

  --main-color-light: #fdfaf5;
  --main-color-dark: #f8edd8;
  --secondary-color: #e9d9bc;
}

h1, h2, h3 {
  font-family: 'DM Sans', sans-serif;
  letter-spacing: 1.2px;
}

body { 
  background:#fff; 
  color:#333; 
  font-family: 'Poppins', sans-serif; 
}

.body-container {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0 auto;
  background: #fff;
  width: 80%;
  border-radius:8px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* Box di avviso */
.alert-box {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #fff5e6;
    border: 2px solid #ff9800;
    padding: 20px 30px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    text-align: center;
    display: none;
    z-index: 9999;
}
.alert-box p {
    font-size: 16px;
    margin-bottom: 15px;
}
.alert-box button {
    background-color: #ff9800;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 6px;
    cursor: pointer;
}
.alert-box button:hover {
    background-color: #e68a00;
}

/* Intestazione sito */
header .section {
  width: 100%;
  text-align: center;
  padding: 20px 50px;
}
header .section img { 
  width: 30%;
}

/* Contenitore pagina principale */
main {
  flex: 1;
  width: 100%;
  margin: 20px auto;
  padding: 20px;
  margin-bottom: 200px;
}
main > section {
  flex: 1;
  width: 90%;
  margin: 20px auto;
  padding: 20px;
  background: #fff;
  border-radius: 8px;
 /*box-shadow: 0 2px 5px rgba(0,0,0,0.1);*/
}
main > section > h1 {
  margin-bottom: 20px;
}

/* Menu navigatore */
nav.menu {
  width: 100%;
  position: fixed;
  left: 0px;
  bottom: 0px;
  display: flex;
  justify-content: space-evenly;
  align-items: center;
  background: #fff;
  box-shadow: 0px -2px 17px 4px rgba(0, 0, 0, 0.1);
  padding: 20px;
  padding-bottom: 50px;
  z-index: 1000;
}
nav.menu .menu-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  padding: 4px 20px;
  border-radius: 8px;
  transition: color 0.3s ease;
}
nav.menu .menu-item-rounder {
  position: absolute;
  top: -20px;
  left: calc(50% - 45px);
  border-radius: 50%;
  width: 100px;
  height: 100px;
  background-color: black;
  z-index: -1;
}
nav.menu .central-item i {
  position: relative;
  top: -4px;
}
nav.menu .menu-item .active {
  background-color: var(--menu-item-color);
}
nav.menu .menu-item i {
  display: block;
  clear: both;
  padding-bottom: 18px;
}
nav.menu a {
  text-decoration: none;
  color: var(--menu-text-color);
}
nav.menu i:hover {
  position: relative;
  top: -2px;
}
nav.menu .central-item i:hover {
  position: relative;
  top: -7px;
}
nav.menu img {
  width: 44px;
  height: 44px;
  margin-bottom: 4px;
}
nav.menu span {
  font-size: 12px;
}

/* Ricette cards */
.ricetta-search {
  width: 100%;
  margin: 35px 0px;
}
.ricetta-search input {
  width: 100%;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 16px;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
}
.ricetta-search input:focus {
  border-color: var(--logo-color);
  outline: none;
}
.ricette-cards {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
}
.ricetta-card {
  width: 48%;
  margin-bottom: 20px;
  background-color: white;
  border-radius: 4px;
  box-shadow: 0 2px 5px rgb(221 221 221);
  cursor: pointer;
}
.ricetta-card img {
  width: 100%;
  height: auto;
  aspect-ratio: 1/1;      
  object-fit: cover;        
  display: block;
}
.ricetta-card h2, .ricetta-card p {
  margin: 14px;
  letter-spacing: 1px;
}
.ricetta-card h2 {
  font-family: "DM Sans", sans-serif;
  font-size: 0.8em;
}
.ricetta-card p {
  font-family: "DM Sans", sans-serif;
  font-size: 0.7em;
  padding: 8px 14px;
  border-radius: 8px;
  background-color: #86ce86;
  color: white;
}
.ricetta-card > p > * {
  display: inline;
  margin-right: 10px;
}

#inserisci_ricetta {
  width: 100%;
  margin: 20px auto;
  padding: 20px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
#inserisci_ricetta td {
  padding: 10px;
}
#inserisci_ricetta input, #inserisci_ricetta select {
  width: 100%;
  padding: 12px;
}
#inserisci_ricetta .ingredient-row input, #inserisci_ricetta .ingredient-row select {
  max-width: 200px;
}
#inserisci_ricetta input[type="submit"], #inserisci_ricetta .button-add {
  width: 100%;
  background-color: var(--logo-color);
  color: white;
  border: none;
  padding: 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  cursor: pointer;
}
#inserisci_ricetta button.button-add {
  background-color: #f1f1f1;
    color: black;
}

.main-container-ricetta .checkbox-flex {
  display: flex;
    justify-content: flex-start;
    flex-wrap: wrap;
}
.main-container-ricetta .checkbox-flex label {
  width: 25%;
  text-align: center;
  margin-bottom: 15px;
}

section.single-recipe {
  background-color: var(--main-color-light);
  position: relative;
}
section.single-recipe .save-recipe {
  width: 40px;
  height: 40px;
  position: absolute;
  top: 40px;
  right: 40px;
  background-color: white;
  border-radius: 50%;
}
.single-recipe .container-image img {
  width: 100%;
}
.single-recipe .container-title {
  position: relative;
  top: -70px;
  width: 80%;
  border-radius: 8px;
  background-color: white;
  padding: 40px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  margin: 20px auto;
  margin-bottom: 0px;
}
.single-recipe .container-title h1 {
  font-size: 22px;
  font-family: 'Poppins', sans-serif;
  letter-spacing: 0.5px;
  font-weight: normal;
  max-width: 80%;
}
.single-recipe .container-time {
  position: absolute;
  right: 40px;
  top: 45px;
}
.single-recipe .container-nutritions-info table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 40px;
}
.single-recipe .container-nutritions-info table td {
  width: 25%;
  text-align: center;
}
.single-recipe .container-nutritions-info table tr.values {
  font-weight: bold;
}
.single-recipe .container-buttons {
  display: flex;
  justify-content: center;
}
.single-recipe .container-buttons button {
  width: 50%;
  border-radius: 8px;
  padding: 12px;
  background-color: white;
  color: black;
  margin: 0px 20px;
  border: 0.5px solid black;
  cursor: pointer;
}
.single-recipe .container-buttons .active {
  background-color: var(--main-color-dark);
}
.single-recipe .recipe-main {
  margin: 20px;
}
.single-recipe .recipe-main .content-ingredients .desc {
  width: 65%;
}
.single-recipe .recipe-main .content-ingredients .exchange {
  text-align: center;
}
.single-recipe .recipe-main .content-ingredients .exchange a {
    font-size: 12px;
    color: black;
    text-decoration: none;
}
.single-recipe .recipe-main .content-ingredients table td, .single-recipe .recipe-main .content-steps table td {
  padding: 8px 0px;
}
.single-recipe .recipe-main .content-ingredients table td.quantity, .single-recipe .recipe-main .content-steps td.n_step {
  width: 15%;
  font-weight: bold;
  text-align: center;
}
.single-recipe .recipe-main .content-steps .n_step {
  font-size: 25px;
  color: #e6cea4;
}
.single-recipe .recipe-main .content-steps {
  display: none;
}

/* Pagina delle ricette */
.main-container-ricette .ricette-filter {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  margin-bottom: 20px;
}
.main-container-ricette .ricette-filter button {
  background-color: var(--logo-color);
  color: white;
  border: 0.5px solid var(--logo-color-dark);
  border-radius: 3px;
  margin-right: 16px;
  padding: 8px 16px;
  cursor: pointer;
}
.main-container-ricette .ricette-filter button.active {
  background-color: var(--logo-color-dark);
}
.main-container-ricette .ricette-filter button:hover {
  background-color: var(--logo-color-dark);
}
.main-container-ricette .ricetta-card {
  position: relative;
}
.main-container-ricette .ricetta-card i {
  position: absolute;
  top: 15px;
  left: 15px;
}
.main-container-ricette .ricetta-card img.save-recipe {
  z-index: 1;
  width: 30px;
  position: absolute;
  bottom: 30px;
  right: 15px;
  background-color: white;
  border-radius: 50%;
}

/* Il mio piano */
.section-myplan {
  width: 100%;
}
.section-myplan h1 {
  margin-bottom: 20px;
}
.section-myplan .ricetta-card {
  width: 100%;
  margin-bottom: 30px;
  font-family: 'poppins', sans-serif;
}
.section-myplan .ricetta-card img {
  height: 200px;
}

/* Registrazione */
.main-container-plan [class^="section-"] { text-align: center; }
.main-container-plan [class^="section-"] h1 { font-size: 24px; }
.main-container-plan [class^="section-"] h3 { font-size: 14px; text-align: left; margin-bottom: 20px; }
.main-container-plan [class^="section-"] p { font-size: 14px; }
.main-container-plan [class^="section-"] .calorie-input {
  width: 100%;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 16px;
  font-family: 'DM Sans', sans-serif;
}
.main-container-plan [class^="section-"] button {
  width: 100%;
  padding: 20px;
  border: 0.5px solid black;
  background-color: white;
  font-size: 18px;
  color: black;
  margin-bottom: 14px;
  cursor: pointer;
}
.main-container-plan [class^="section-"] button:hover {
  background-color: var(--main-color-light);
}
.main-container-plan .btn-active {
  background-color: var(--main-color-dark) !important;
}
.main-container-plan [class^="section-"] .option-2 {
  margin-top: 50px;
}
.main-container-plan .nutrition-container {
    display: flex;
    gap: 20px;
    margin-bottom: 50px;
}
.main-container-plan .nutrition-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.main-container-plan .nutrition-column img {
    margin-bottom: 20px;
}
.main-container-plan .nutrition-column input[type="number"] {
    width: 80%;
    padding: 8px;
    font-size: 16px;
    text-align: center;
} 
.main-container-plan .input-percent {
    content: "%";
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    color: #555;
    font-weight: bold;
    pointer-events: none; /* così non clicchi sul simbolo */
}
.main-container-plan .prev-next-buttons {
  display: flex;
  justify-content: space-between;
}
.main-container-plan .prev-button {
  width: 30% !important;
  background-color: var(--main-color-light) !important;
}
.main-container-plan .next-button {
  width: 30% !important;
  background-color: var(--main-color-dark) !important;
}

.custom-alert {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #ffefef;
    color: #b30000;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0px 4px 10px rgba(0,0,0,0.15);
    font-size: 16px;
    font-weight: bold;
    z-index: 9999;
    display: none;
    text-align: center;
    max-width: 300px;
}

/* Login */
.main-container-login table td {
  padding: 8px;
}
.main-container-login table td input {
  width: 100%;
  padding: 8px 20px;
}
.main-container-login table td button {
  width: 100%;
  padding: 12px 30px;
  border: 1px solid var(--logo-color);
  background-color: var(--main-color-dark);
  color: black;
  border-radius: 8px;
  cursor: pointer;
}

table.cambia_ingrediente {
  width: 100%;
  background-color: var(--main-color-dark);
  color: black;
  padding: 40px;
  border-radius: 6px;
}
table.cambia_ingrediente td {
  padding: 8px 30px !important;
}
table.cambia_ingrediente .title {
  font-weight: bold;
  text-align: center;
}
table.cambia_ingrediente .select {
  width: 20%;
  cursor: pointer;
}
icon-btns {
display: flex;
gap: 20px;
justify-content: center;
margin: 30px 0;
}

.icon-btn {
display: flex;
flex-direction: column;
align-items: center;
text-decoration: none;
color: black;
font-size: 14px;
transition: 0.3s;
}

.icon-btn i {
font-size: 20px;
margin-bottom: 5px;
}

.icon-btn:hover {
color: gray;
}

.content-recommended {
  margin-top: 30px;
}

.recommended-title {
  font-size: 16px;
  font-weight: bold;
  margin-bottom: 10px;
}

.recommended-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
}

.recommended-card {
  border: 1px solid #ddd;
  border-radius: 10px;
  padding: 10px;
  width: 180px;
  text-align: center;
  background: #fff;
}

.product-img-container {
  position: relative;
  width: 150px;
  height: 150px;
  margin: 0 auto 10px;
}

.product-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
}

.btn-plus {
  position: absolute;
  bottom: 5px;
  right: 5px;
  width: 32px;
  height: 32px;
  background: #fff;
  border-radius: 50%;
  border: 1px solid #ccc;
  display: block;
}

.btn-plus::before,
.btn-plus::after {
  content: '';
  position: absolute;
  background: #333;
}

.btn-plus::before {
  top: 50%;
  left: 8px;
  width: 16px;
  height: 2px;
  transform: translateY(-50%);
}

.btn-plus::after {
  left: 50%;
  top: 8px;
  width: 2px;
  height: 16px;
  transform: translateX(-50%);
}