/* ====================================================
   ŠPICAMENU — User Menu Page
   ==================================================== */

.menu-body {
  background: var(--bg-light);
  height: auto;
  padding-top: var(--navbar-h);
}

/* -- Header section --------------------------------- */
.menu-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 900px;
  margin: 2rem auto;
  padding: 0 1.5rem;
  gap: 1.5rem;
  height: 100%;
}

.header-top {
  display: flex;
  flex-direction: column;
  text-align: center;
  width: 100%;
  gap: .5rem;
}

.header-top h1 {
  margin: 0 0 .5rem;
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  color: var(--text-primary);
}

.week-info {
  color: var(--text-muted);
  font-size: 1rem;
  margin: 0 0 .5rem;
}

.alergens-list {
  
  font-size: 1rem;
  margin: 0 0 .5rem !important;
}

/* -- Week navigation -------------------------------- */
.week-nav {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.week-nav form {
  display: flex;
}

.week-btn {
  background: var(--surface);
  color: var(--brand-primary);
  border: 1.5px solid var(--brand-primary);
  border-radius: 50px;
  padding: .6rem 1.5rem;
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--ease), color var(--ease), box-shadow var(--ease);
  box-shadow: var(--shadow-sm);
}

.week-btn:hover:not(:disabled) {
  background: var(--brand-primary);
  color: #fff;
  box-shadow: var(--shadow-md);
}

.week-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

/* ====================================================
   MENU CONTAINER - DAYS LIST
   ==================================================== */

.menu-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* -- Day section ------------------------------------ */
.menu-day {
  background: var(--surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  transition: box-shadow var(--ease);
}

.menu-day:hover {
  box-shadow: var(--shadow-lg);
}

.menu-day-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-dark));
  color: #fff;
  gap: 1rem;
}

.menu-day-header h2 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
}

/* -- Day items list --------------------------------- */
.menu-day-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .9rem 1.5rem;
  border-bottom: 1px solid rgba(0,0,0,.04);
  transition: background var(--ease);
  gap: 1rem;
}

.menu-day-item:last-child {
  border-bottom: none;
}

.menu-day-item:hover {
  background: var(--bg-light);
}

.menu-day-item.meal:hover {
  background: rgb(170, 19, 24);
  color: #fff;
}

.menu-day-item.meal.soup-item {
  font-weight: 600;
}

.menu-day-item.disabled-day {
  background: rgba(0,0,0,.02);
}

.item-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: .2rem;
  min-width: 0;
}

.item-name {
  margin: 0;
  font-weight: 600;
  color: currentColor;
  font-size: .95rem;
  word-break: break-word;
}

.item-desc {
  margin: 0;
  font-size: .8rem;
  color: rgba(0,0,0,.6);
  font-style: italic;
}

.menu-day-item.meal:hover .item-desc {
  color: rgba(255,255,255,.8);
}

.item-price {
  margin: 0;
  font-size: .85rem;
  color: currentColor;
  font-weight: 500;
}

.item-actions {
  display: flex;
  gap: 1rem;
  flex-shrink: 0;
  align-items: center;
}

.amount-control {
  display: flex;
  align-items: center;
  gap: .5rem;
  background: rgba(0,0,0,.05);
  border-radius: var(--radius-sm);
  padding: .25rem;
}

.menu-day-item.meal:hover .amount-control {
  background: rgba(255,255,255,.2);
}

.amount-btn {
  width: 30px;
  height: 30px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 1.2rem;
  font-weight: bold;
  color: currentColor;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .2s;
}

.amount-btn:hover {
  transform: scale(1.15);
}

.amount-input {
  width: 35px;
  height: 30px;
  text-align: center;
  border: none;
  background: transparent;
  color: currentColor;
  font-size: .9rem;
  font-weight: 600;
  padding: 0;
  cursor: default;
  margin: 0;
}

.isOrdered {
  background: rgb(170, 19, 24) !important;
  color: #fff !important;
}

.isOrdered .item-desc {
  color: rgba(255,255,255,.8) !important;
}

.amountAdded {
  background: rgb(227, 45, 45);
  border-radius: var(--radius-sm);
}

.empty-state {
  padding: 1.5rem;
  text-align: center;
  color: var(--text-muted);
  font-style: italic;
  margin: 0;
}

/* ====================================================
   ORDER SECTION
   ==================================================== */

.order-section {
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 1.5rem;
  background: var(--surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

.order-info {
  display: flex;
  align-items: center;
  gap: 2rem;
  width: 100%;
  justify-content: space-between;
  flex-wrap: wrap;
}

.order-total {
  display: flex;
  align-items: baseline;
  gap: .5rem;
}

.order-total h3 {
  margin: 0;
  font-size: 1rem;
  color: var(--text-primary);
}

.total-price {
  display: flex;
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--brand-primary);
}

.order-btn-main {
  background: var(--brand-primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: .8rem 2rem;
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--ease), box-shadow var(--ease);
  box-shadow: var(--shadow-sm);
}

.order-btn-main:hover:not(:disabled) {
  background: var(--brand-dark);
  box-shadow: var(--shadow-md);
}

.order-btn-main:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ====================================================
   ORDER POPUP - MODAL
   ==================================================== */

.order-popup {
  position: fixed;
  width: 0;
  height: 0;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  transition: opacity var(--ease), visibility var(--ease);
  z-index: -1;
  background: white;
  display: flex;
  flex-direction: column;
}

.order-popup.order-popped {
  width: min(40vw, 600px);
  height: auto;
  max-height: 85vh;
  opacity: 1;
  visibility: visible;
  z-index: 15;
  border-radius: var(--radius-lg);
  box-shadow: 0 0 40px rgba(0,0,0,.3);
}

/* Popup backdrop */
.flex.center:has(> .order-popped) {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 10;
}

/* Popup Structure */
.popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-dark));
  color: #fff;
  flex-shrink: 0;
}

.popup-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
}

.close-btn {
  width: 24px;
  height: 24px;
  cursor: pointer;
  transition: transform var(--ease);
  flex-shrink: 0;
}

.close-btn:hover {
  transform: scale(1.15);
}

.popup-content {
  flex: 1;
  overflow-y: auto;
  padding: 0;
  min-height: 0;
    width: 100%;
}

.popup-footer {
  display: flex;
  gap: .75rem;
  justify-content: flex-end;
  padding: 1rem 1.5rem;
  border-top: 1px solid rgba(0,0,0,.08);
  flex-shrink: 0;
  flex-wrap: wrap;
}

.popup-btn {
  padding: .6rem 1.5rem;
  border: none;
  border-radius: var(--radius-sm);
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--ease);
  white-space: nowrap;
}

.popup-btn.submit-btn {
  background: var(--brand-primary);
  color: #fff;
}

.popup-btn.submit-btn:hover {
  background: var(--brand-dark);
}

.popup-btn.next-btn {
  background: var(--brand-primary);
  color: #fff;
}

.popup-btn.next-btn:hover {
  background: var(--brand-dark);
}

.popup-btn.prev-btn {
  background: var(--bg-muted);
  color: var(--text-primary);
}

.popup-btn.prev-btn:hover {
  background: #ddd;
}

.order-step {
  display: none;
  padding: 2rem 1.5rem;
}

.step-opened {
  display: flex !important;
}

.info-step {
  flex-direction: row;
  justify-content: space-around;
  align-items: center;
  gap: 1.5rem;
  text-align: center;
}

.info-step .red-bg {
  flex: 1;
  min-width: 100px;
  padding: 1.5rem;
  border-radius: var(--radius-md);
}

.red-bg {
  background: rgba(170,19,24,.1);
  color: var(--brand-primary);
}

.info-step h3 {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 700;
}

.info-step img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.info-step p {
  margin: .5rem 0 0;
  font-size: .85rem;
  font-weight: 500;
}

.order-popup-inputs {
  gap: 1rem;
  padding: 1.5rem 0 0;
  margin: 0;
  display: flex;
  flex-direction: column;
}

.order-popup-inputs input {
  width: 100%;
  padding: .75rem 1rem;
  border: 1.5px solid rgba(0,0,0,.12);
  border-radius: var(--radius-sm);
  background: var(--bg-light);
  color: var(--text-primary);
  font-family: inherit;
  font-size: .95rem;
  transition: border-color var(--ease), box-shadow var(--ease);
  box-sizing: border-box;
}

.order-popup-inputs input:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(170,19,24,.1);
}

.order-step.column {
  flex-direction: column;
  gap: 0;
}

.sum-div {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin: 1.5rem 0 1rem;
  cursor: pointer;
  padding: 1rem;
  border-radius: var(--radius-sm);
  background: var(--bg-light);
  transition: background var(--ease);
}

.sum-div:hover {
  background: rgba(0,0,0,.05);
}

.sum-btn {
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  margin: 0;
}
.sum-btn:hover {
    background: none;
}

.order-sum-div {
  max-height: 150px;
  overflow-y: auto;
  margin: 0;
  padding: 1rem;
  background: var(--bg-light);
  border-radius: var(--radius-sm);
}

.order-sum-div::-webkit-scrollbar {
  width: 6px;
}

.order-sum-div::-webkit-scrollbar-track {
  background: transparent;
}

.order-sum-div::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,.2);
  border-radius: 3px;
}

.order-sum-div::-webkit-scrollbar-thumb:hover {
  background: rgba(0,0,0,.3);
}

.dayTitle {
  margin: 1rem 0 .5rem;
  padding: 0;
  font-size: .9rem;
  font-weight: 700;
  color: var(--brand-primary);
  text-transform: uppercase;
  letter-spacing: .5px;
}

.order-sum-div p {
  margin: .5rem 0;
  padding: .5rem;
  background: white;
  border-radius: var(--radius-sm);
  font-size: .9rem;
  color: var(--text-primary);
}

.rot180 {
  transform: rotate(180deg);
  transition: transform .2s ease-in-out;
}

#sum-arrow {
  width: 20px;
  height: auto;
}

.pix20 {
  width: 20px;
}

#cross {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 24px;
  height: 24px;
  cursor: pointer;
  transition: transform var(--ease);
}

#cross:hover {
  transform: scale(1.15);
}

.flex {
  display: flex;
}

.center {
  justify-content: center;
  align-items: center;
}

.column {
  flex-direction: column;
}

.none {
  display: none !important;
}

.shadow {
  box-shadow: var(--shadow-sm);
}

/* ====================================================
   RESPONSIVE DESIGN
   ==================================================== */

@media (max-width: 768px) {
  .menu-header {
    margin: 1rem auto;
  }

  .menu-day-item {
    flex-direction: column;
    align-items: flex-start;
    padding: .75rem 1rem;
    gap: .75rem;
  }

  .item-actions {
    width: 100%;
  }

  .order-popup.order-popped {
    width: min(90vw, 500px);
    max-height: 80vh;
  }

  .popup-footer {
    flex-direction: column;
  }

  .popup-btn {
    width: 100%;
  }

  .order-info {
    flex-direction: column;
    gap: 1rem;
  }

  .order-btn-main {
    width: 100%;
  }

  .info-step {
    flex-direction: column;
    padding: 1.5rem;
    gap: 1rem;
  }

  .info-step .red-bg {
    width: 100%;
  }

  .week-nav {
    flex-direction: column;
    width: 100%;
  }

  .week-btn {
    width: 100%;
  }
}

@media (max-width: 600px) {
  .menu-header {
    padding: 0 1rem;
  }

  .menu-day-header {
    padding: .75rem 1rem;
  }

  .menu-day-header h2 {
    font-size: 1rem;
  }

  .menu-day-item {
    padding: .6rem .75rem;
  }

  .order-popup.order-popped {
    width: 95vw;
    max-height: 85vh;
  }

  .popup-header {
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }

  .popup-footer {
    flex-direction: column;
    gap: .5rem;
  }

  .popup-btn {
    width: 100%;
    font-size: .85rem;
  }

  .popup-content {
    max-height: 55vh;
  }

  .header-top h1 {
    font-size: 1.5rem;
  }

  .order-section {
    padding: 1rem;
  }

  .order-info {
    flex-direction: column;
  }

  .order-total {
    width: 100%;
  }

  .order-btn-main {
    width: 100%;
  }

  .order-popup-inputs input {
    font-size: .9rem;
  }

  .info-step {
    padding: 1rem !important;
    gap: .75rem;
  }

  .info-step h3 {
    font-size: 1.1rem;
  }

  .info-step img {
    width: 35px;
    height: 35px;
  }
}

/* Error and message styles */
.errMsg {
  background: rgba(170,19,24,.1);
  border-left: 4px solid var(--brand-primary);
  padding: 1rem;
  margin: 1rem auto;
  max-width: 900px;
  border-radius: var(--radius-sm);
}

.errMsg ul {
  margin: 0;
  padding-left: 1.5rem;
  list-style: none;
}

.errMsg li {
  color: var(--brand-primary);
  font-weight: 500;
  padding: .25rem 0;
}

.msg {
  background: rgba(76,175,80,.1);
  border-left: 4px solid #4caf50;
  color: #2e7d32;
  padding: 1rem;
  margin: 1rem auto;
  max-width: 900px;
  border-radius: var(--radius-sm);
  font-weight: 500;
}
