/* Print Configurator – styles */

/* Root layout */
.pc-react {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  margin-top: 24px;
}

/* Left column for configuration */
/*
 * Left column: allocate roughly 75% of the available width on desktop. The
 * flex-basis is set to 75% and we remove the max-width to allow it to
 * expand. This gives the configuration area more space while keeping the
 * summary narrower.
 */
.pc-left {
  flex: 0 0 75%;
  max-width: 100%;
}

.pc-section {
  margin-bottom: 24px;
}

.pc-section h3 {
  margin-bottom: 8px;
  font-size: 1.1rem;
  font-weight: 600;
}

.pc-field {
  margin-bottom: 16px;
}

.pc-field label {
  display: block;
  margin-bottom: 4px;
  font-weight: 600;
}

.pc-input {
  width: 100%;
  border: 1px solid #e1e8f0;
  border-radius: 6px;
  padding: 8px;
  box-sizing: border-box;
}

/* Cards for size, paper, grammatura */
/* Cards container: allow more spacing between options */
.pc-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* Individual card: larger tap area and refined style */
.pc-card {
  border: 1px solid #dce3ec;
  border-radius: 20px;
  padding: 12px 16px;
  background: #fff;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1.3;
  transition: background-color .2s, border-color .2s, box-shadow .2s;
}

.pc-card:hover {
  border-color: #8ab4f8;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.pc-card.active {
  border-color: #4285f4;
  background-color: #e8f0fe;
  box-shadow: 0 2px 6px rgba(66,133,244,0.2);
}

/* Table for quantity & delivery */
.pc-table {
  width: 100%;
  border-collapse: collapse;
}

.pc-table th, .pc-table td {
  padding: 8px 4px;
  text-align: center;
}

.pc-th-qty {
  text-align: left;
  padding-left: 0;
}

.pc-table thead th {
  font-weight: 600;
}

.pc-datehead {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  line-height: 1.2;
}

.pc-day {
  font-size: 0.95rem;
  font-weight: 600;
  text-transform: capitalize;
}

.pc-date {
  font-size: 0.85rem;
  color: #6b7280;
}

/* Table cell buttons displaying a price. Increase padding and font size to
   accommodate numeric values and improve readability. */
.pc-cell {
  border: 1px solid #dce3ec;
  border-radius: 18px;
  padding: 14px 12px;
  background: #fff;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  transition: background-color .15s, border-color .15s, box-shadow .15s;
  width: 100%;
  box-sizing: border-box;
}

.pc-cell:hover {
  border-color: #8ab4f8;
  background-color: #f1f5fb;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.pc-cell.active {
  background-color: #4285f4;
  color: #fff;
  border-color: #4285f4;
  box-shadow: 0 2px 6px rgba(66,133,244,0.2);
}

.pc-qty {
  font-weight: 600;
  text-align: left;
  font-size: 1rem;
}

/* Extras chips */
.pc-extras {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pc-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #dce3ec;
  border-radius: 20px;
  padding: 8px 14px;
  cursor: pointer;
  font-size: 0.95rem;
  background: #fff;
}

.pc-chip.active {
  border-color: #4285f4;
  background-color: #e8f0fe;
  box-shadow: 0 2px 4px rgba(66,133,244,0.2);
}

.pc-chip input {
  margin-right: 4px;
}

/* Summary panel */
/*
 * Summary column: allocate about 25% of the width on desktop. Keep a
 * sensible minimum width so the card never gets too small. The flex-basis
 * ensures it scales proportionally with the left column.
 */
/* Summary container: allocate 25% of the width and push it to the right
 * using margin-left:auto so it aligns at the end of the flex row. This
 * ensures the configurator remains sulla sinistra and the summary card
 * appears on the right. */
.pc-summary {
  /*
   * The summary column should take up as much space as it needs but not
   * impose a fixed width on the flex container. Removing the explicit
   * flex‑basis ensures that the sticky behaviour on the summary card
   * works reliably. The margin-left pushes the summary to the far right.
   */
  /* flex: 0 0 25%; -- removed to fix sticky positioning */
  min-width: 260px;
  margin-left: auto;
  /* Make the container a positioning context for sticky children */
  position: relative;
}

/* Summary card: make it sticky near the top so it follows the page
   during scroll. Reduce the top offset to ensure it stays visible
   sooner when the user scrolls. */
.pc-summary-card {
  border: 1px solid #dce3ec;
  border-radius: 14px;
  padding: 16px;
  background: #fff;
  position: sticky;
  top: 20px;
  /* Ensure the summary card aligns to the top of the container when using
     flex layouts. Without this, the sticky element may remain anchored
     at the end of the column. */
  align-self: flex-start;
  /* Raise z-index to ensure it remains above other content */
  z-index: 10;
}

/* When the summary card has the pc-fixed class (applied via JS), we
   switch to fixed positioning so it stays visible at the top of the
   viewport. A right offset is used to keep it aligned with the
   configurator column; adjust this value to fine‑tune horizontal
   placement. */
.pc-summary-card.pc-fixed {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 280px;
  max-width: calc(25% - 40px);
}

.pc-summary-card div {
  margin-bottom: 6px;
}

.pc-total {
  font-size: 1.1rem;
  font-weight: 700;
  margin-top: 8px;
}

.pc-switch {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
}

.pc-switch input {
  margin-right: 4px;
}

.pc-add {
  margin-top: 12px;
  padding: 8px 14px;
  background-color: #4285f4;
  border: none;
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  font-size: 0.95rem;
  transition: background-color .15s;
}

.pc-add:hover {
  background-color: #2a64c6;
}

/* Loading state */
.pc-loading {
  padding: 20px;
  font-style: italic;
}