/* ===============================
   BOX BUILDER LAYOUT
=================================*/

.builder-container {
  padding: 20px 15px;
}

.box-builder-wrapper {
  max-width: 1300px;
  margin: 0 auto;
}

/* WRAPPER 2 STĹPCE */
.box-wrapper {
  display: flex;
  flex-direction: column;
  gap: 25px;
  padding: 0;
  box-sizing: border-box;
}

/* ===============================
   LEFT PANEL (CONFIG)
=================================*/

.box-config {
  background: #fafafa;
  padding: 20px;
  border-radius: 16px;
  box-sizing: border-box;
}

/* ===============================
   RIGHT PANEL (PREVIEW)
=================================*/

.box-preview {
  background: #fafafa;
  padding: 10px;
  border-radius: 16px;
  box-sizing: border-box;
}

/* ===============================
   SIZE BUTTONS
=================================*/

.box-size-options {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.box-size-options button {
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid #ddd;
  background: white;
  cursor: pointer;
}

.box-size-options button.active {
  background: black;
  color: white;
}

/* ===============================
   STYLE INPUTS
=================================*/

.style-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.style-option, .people-input-wrap {
  justify-content: space-between;
  align-items: center;
  border: 1px #e7e7e7 solid;
  padding: 0 0 0 5px;
  box-sizing: border-box;
  border-radius: 9px;
  background: #f1f1f1;
}

.style-option {
  display: block;
}

.people-input-wrap {
  display: flex;
}

.style-option input, .people-input-wrap input {
  width: 70px;
  padding: 6px;
  border-radius: 8px;
  border: 0px solid #ccc;
  font-size: 1rem;
}

/* ===============================
   ALLERGENS
=================================*/

#box-alergens {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 15px;
}

#box-alergens label {
  font-size: 14px;
}

/* ===============================
   PREVIEW GRID
=================================*/

.box-preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px;
  margin-top: 15px;
}

/* KARTA */
.box-item {
  background: white;
  border-radius: 14px;
  padding: 12px;
  text-align: center;
  box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.box-item img {
  width: 100%;
  max-width: 120px;
  height: auto;
  border-radius: 10px;
}

.box-item-name {
  font-size: 14px;
  margin-top: 8px;
}

.box-item-variant {
  font-size: 13px;
  opacity: 0.7;
}

/* ===============================
   ACTION BUTTONS
=================================*/

.box-actions {
  margin-top: 20px;
}

/*
.ck-btn {
  padding: 12px 18px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
}

.ck-btn.primary {
  background: black;
  color: white;
}
*/

.btn-add-box {
  background:#111;
  color:#fff;
  padding:12px 20px;
  border:none;
  border-radius:8px;
  cursor:pointer;
  font-size: 1rem;
  display: block;
  margin: auto;
}

.box-footer {
  padding: 30px 0;
}

.allergen-container {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
/*  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 0 0 5% 0; */
}

.allergen-container label {
  padding: 5px 10px;
  border: 1px silver solid;
  box-sizing: border-box;
  border-radius: 25px;
  flex: auto;
  flex-wrap: nowrap;
  white-space: nowrap;
  align-items: center;
  gap: 3px;
}

/* ==========================================
   EVENT BUTTONS – MOBILE FIRST
========================================== */

.box-event-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 15px 0 25px 0;
}

.event-btn {
  flex: 1 1 calc(50% - 8px); /* 2 na riadok */
  padding: 10px 14px;
  border-radius: 30px;
  border: 1.5px solid #ddd;
  background: #fff;
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s ease;
  color: #333;
}

/* hover (funguje aj na mobile tap) */
.event-btn:hover {
  border-color: #000;
  background: #f5f5f5;
}

/* active */
.event-btn.active {
  background: #000;
  color: #fff;
  border-color: #000;
  box-shadow: 0 6px 18px rgba(0,0,0,0.15);
}

/* klik efekt */
.event-btn:active {
  transform: scale(0.97);
}


/* ==========================================
   ALERGEN CHIP BUTTONS – MOBILE FIRST
========================================== */

#box-alergens {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}


.alergen-chip {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;

  flex: 1 1 calc(50% - 8px);
  min-height: 38px;

  border-radius: 30px;
  border: 1.5px solid #ddd;
  background: #fff;
  cursor: pointer;
  transition: all 0.25s ease;
  font-size: 13px;
  font-weight: 500;
  text-align: center;
}

.alergen-chip input {
  display: none;
}

.alergen-chip:hover {
  border-color: #000;
  background: #f5f5f5;
}

.alergen-chip.active {
  background: #000;
  border-color: #000;
  color: #fff;
  box-shadow: 0 6px 18px rgba(0,0,0,0.15);
}

.alergen-chip:active {
  transform: scale(0.97);
}

.alergen-chip img {
  width:24px;
}

.alergen-chip.active img {
  filter: brightness(0) invert(1);
}

.box-message {
  margin-top: 10px;
  font-size: 14px;
  color: #c40000;
  font-weight: 500;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.box-message.show {
  opacity: 1;
}

.box-total-price {
  margin-top: 5px;
  font-size: 18px;
  font-weight: 600;
}



.box-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 320px;
  text-align: center;
  padding: 30px 20px;
  opacity: 0.8;
}

.box-placeholder-icon {
  margin-bottom: 20px;
}

.box-svg {
  width: 90px;
  height: 90px;
  stroke: #000;
  stroke-width: 3;
  fill: none;
  animation: floatBox 3s ease-in-out infinite;
}

@keyframes floatBox {
  0%   { transform: translateY(0px); }
  50%  { transform: translateY(-8px); }
  100% { transform: translateY(0px); }
}

.box-placeholder-text h3 {
  font-size: 18px;
  margin-bottom: 8px;
}

.box-placeholder-text p {
  font-size: 14px;
  color: #777;
}



.cake-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 320px;
  text-align: center;
}

.cake-svg {
  width: 150px;
  height: 150px;
  margin-bottom: 20px;
}

.layer {
  transform: translateY(60px);
  opacity: 0;
  animation: riseLayer 3s ease-in-out infinite;
}

.layer-bottom {
  fill: #5b3a29;
  animation-delay: 0s;
}

.layer-middle {
  fill: #f5e1c8;
  animation-delay: 0.3s;
}

.layer-top {
  fill: #ffb3c6;
  animation-delay: 0.6s;
}

.layer-glaze {
  fill: #ff6b6b;
  animation-delay: 0.9s;
}

@keyframes riseLayer {
  0% {
    transform: translateY(60px);
    opacity: 0;
  }
  30% {
    transform: translateY(0);
    opacity: 1;
  }
  70% {
    transform: translateY(0);
    opacity: 1;
  }
  100% {
    transform: translateY(60px);
    opacity: 0;
  }
}

.cake-text h3 {
  font-size: 18px;
  margin-bottom: 6px;
}

.cake-text p {
  font-size: 14px;
  color: #777;
}

.style-summary {
  margin-top: 15px;
}

.style-remaining {
  font-size: 14px;
  margin-bottom: 6px;
}

.style-progress {
  width: 100%;
  height: 8px;
  background: #eee;
  border-radius: 6px;
  overflow: hidden;
}

.style-progress-bar {
  height: 100%;
  width: 0%;
  background: #000;
  transition: width 0.3s ease;
}


.style-option {
  margin-bottom: 14px;
}

.style-option:hover {
  background: #e7e7e7;
}

.style-control {
  display: flex;
  align-items: center;
  gap: 10px;
}

.style-range {
  flex: 1;
  accent-color: #000;
  cursor: pointer;
}

.style-value {
  width: 40px;
  font-weight: 600;
  font-size: 14px;
}


.spinner {
  width: 20px;
  height: 20px;
  animation: spin 1s linear infinite;
  margin-right: 8px;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.btn-add-box.loading {
  opacity: 0.8;
  cursor: not-allowed;
}


/* ===============================
   DESKTOP
=================================*/

@media (min-width: 992px) {

  .alergen-chip {
    flex: 0 0 auto;
    padding: 0 16px;
    min-height: 36px;
  }

  .box-event-options {
    gap: 12px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }

  .event-btn {
    flex: 0 0 auto;       /* už nie 50% */
    padding: 10px 18px;
    font-size: 15px;
  }

  .event-btn:hover {
    transform: translateY(-2px);
  }

.allergen-container label {
    /* flex: none; */
    justify-content: flex-start;
}


  .box-wrapper {
    flex-direction: row;
    align-items: stretch;
    padding: 4%;
  }

  .box-config {
    flex: 1;
  }

  .box-preview {
    padding: 10px 20px;
    flex: 1.3;
  }

  .box-preview-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .style-option {
    display: flex;
  }

  .btn-add-box {
    display: inline;
    margin: auto;
  }


}
