/* =========================================
   Prescription / Lens Info Layout
   (Desktop + Mobile SAFE)
========================================= */

.prescription {
  display: grid;
  gap: clamp(14px, 2.4vw, 22px);
  max-width: 100%;
  box-sizing: border-box;
}

/* Jedan red = jedno oko (OD / OS) */
.prescription-row {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 14px;
  align-items: start;

  max-width: 100%;
  box-sizing: border-box;
  min-width: 0; /* KRITIČNO */
}

/* Lijevo – oznaka oka */
.prescription-left .eye-badge {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.prescription-left .eye-badge strong {
  font-weight: 800;
  font-size: 1.05rem;
  color: #111;
  text-transform: uppercase;
}

.prescription-left .eye-badge span {
  font-size: .9rem;
  color: #666;
}

/* Desno – RX polja */
.prescription-right {
  display: grid;

  /* 🔥 KLJUČNI FIX:
     auto-fit + minmax(160px, 1fr)
     → nikad ne izlazi van roditelja */
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));

  gap: 12px;

  max-width: 100%;
  box-sizing: border-box;
  min-width: 0; /* KRITIČNO */
}

/* Pojedinačno polje */
.prescription-field {
  display: flex;
  flex-direction: column;
  gap: 6px;

  min-width: 0;
  max-width: 100%;
}

.prescription-field-label {
  font-size: .9rem;
  color: #444;
}

/* Input / Select */
.lens-input {
  width: 100%;
  padding: 14px 16px;
  font-size: clamp(1rem, 2vw, 1.15rem);
  background: #fff;
  border: 1px solid #d8dbe0;
  border-radius: 12px;
  outline: none;

  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;

  transition: border-color .18s, box-shadow .18s;
}

.lens-input:focus {
  border-color: #b7d7dd;
  box-shadow: 0 0 0 3px rgba(0,124,186,.12);
}

.lens-select {
  cursor: pointer;
}

/* Number input bez strelica */
.lens-input-axis::-webkit-outer-spin-button,
.lens-input-axis::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.lens-input-axis {
  appearance: textfield;
}

/* =========================================
   Responsive behaviour
========================================= */

/* Tablet */
@media (max-width: 900px) {
  .prescription-row {
    grid-template-columns: 1fr;
  }

  .prescription-right {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Mobile */
@media (max-width: 600px) {
  .prescription-right {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .lens-input {
    padding: 12px 14px;
    font-size: 1rem;
  }
}

/* =========================================
   Safety: nikad overflow
========================================= */

.product-info-section,
.prescription,
.prescription-row,
.prescription-right {
  overflow-x: hidden;
  max-width: 100%;
  box-sizing: border-box;
}
