/* pb.css — Candy-Themed Party Bag Wizard */

/* Overall wizard container */
#pb-wizard {
  width: 95%;
  max-width: 1100px;
  margin: 2em auto;
  background: #fff;
  /*border: 4px solid #cac4ef;*/
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.1);
  font-family: 'Poppins', sans-serif;
  color: #222;
  padding: 1rem;
}

/* Step sections */
.pb-step {
  background: #fff;
  /*border: 2px solid #e8e8e8;*/
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.pb-step h3 {
  text-align: center;
}

/* Headings */
#pb-wizard h3,
#pb-wizard h4 {
  font-weight: 600;
  color: #000;
  margin-bottom: 1rem;
}

/* Buttons */
.pb-step button,
#pb-add-to-cart {
  background: #ff95c6;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.75rem 1.25rem;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease;
  margin-top: 50px;
}

.pb-step button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pb-step button:not(:disabled):hover {
  background: #cac4ef;
  transform: translateY(-2px);
}

/* STEP 1: Bag selection */
#pb-wizard .pb-bag-options {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

.pb-bag-card {
  position: relative;
  background: #fafafa;
  border: 1px solid #E2E2E2;
  border-radius: 8px;
  flex: 0 1 calc(33% - 1rem);
  max-width: 320px;
  padding: 1rem;
  text-align: center;
  transition: border-color 0.2s, box-shadow 0.2s;
  cursor: pointer;
}

.pb-bag-card img {
  max-width: 100%;
  border-radius: 6px;
}

.pb-bag-card:hover,
.pb-bag-card.selected {
  border-color: #c1d72e;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.pb-bag-card .pb-bag-config label {
  display: block;
  margin-bottom: 0.75rem;
}

.pb-bag-card .pb-bag-config select,
.pb-bag-card .pb-bag-config input[type="number"] {
  width: 100%;
  max-width: 140px;
}

.pb-bag-price {
	font-size: 1rem;
	font-weight: 600;
	color: #2EA3F2;
}

/* Configuration fields container (color/pattern/qty) */
.pb-bag-config {
  background: #fafafa;
  border: 2px dashed #cac4ef;
  border-radius: 8px;
  padding: 1rem;
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

.pb-bag-config label {
  display: flex;
  flex-direction: column;
  font-weight: 500;
  color: #222;
}

.pb-bag-config select,
.pb-bag-config input[type="number"] {
  margin-top: 0.5rem;
  padding: 0.5rem;
  border: 2px solid #c1d72e;
  border-radius: 6px;
  max-width: 120px;
}

/* STEP 2: Search & selection grid */
.pb-filter-bar {
  text-align: center;
  margin-bottom: 1rem;
}

#pb-search {
  width: 80%;
  max-width: 320px;
  padding: 0.5rem;
  border: 2px solid #c1d72e;
  border-radius: 6px;
}

#pb-search:focus {
  outline: none;
  border-color: #ff95c6;
}

.pb-scrollable-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  max-height: 600px;
  overflow-y: auto;
  padding-right: 0.5rem;
}

.pb-candy-card {
  position: relative;
  flex: 0 1 calc(25% - 1rem);
  border: 2px solid #cac4ef;
  border-radius: 8px;
  overflow: visible !important;
  z-index: 1;
  background: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  height: 180px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  cursor: pointer;
}

.pb-candy-card:hover {
  transform: translateY(-1px);
  border-color: #ff95c6;
  box-shadow: 0 6px 16px rgba(0,0,0,0.15);
  z-index: 10;
}

.pb-candy-card::before {
  content: "";
  display: block;
 /* padding-top: 100%; */
}

.pb-candy-card img {
  max-width: 50%;
  object-fit: contain;
}

.pb-candy-card .name {
  text-align: center;
  margin-top: 0.5rem;
  font-size: 0.9rem;
}

.pb-candy-card.selected {
  border-color: #c1d72e;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.pb-candy-card.selected::after {
  content: "✓";
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  font-size: 1.2rem;
  color: #c1d72e;
  background: #fff;
  border-radius: 50%;
  width: 1.4em;
  height: 1.4em;
  line-height: 1.4em;
  text-align: center;
}

#pb-no-results {
  display: none;
  text-align: center;
  padding: 1rem;
  font-style: italic;
  color: #888;
}

/* Selected‐list sidebar below grid */
#pb-selected-list {
  border: 2px dashed #cac4ef;
  background: #fafafa;
  border-radius: 8px;
  padding: 1rem;
  margin-top: 1rem;
}

#pb-selected-list h4 {
  color: #ff95c6;
  margin-bottom: 0.5rem;
}

#pb-selected-list ul {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  list-style: none;
  padding: 0;
  margin: 0;
}

#pb-selected-list ul li {
  position: relative;
  padding: 0.5em 1em;
  display: flex;
  align-items: center;
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 6px;
}

#pb-selected-list li img {
  width: 28px;
  height: 28px;
  object-fit: cover;
  border-radius: 4px;
  margin-right: 0.5rem;
}

.pb-remove-item {
  position: absolute;
  top: 0.25rem;
  right: 0.25rem;
  background: transparent;
  border: none;
  font-size: 10px !important;
  line-height: 1;
  cursor: pointer;
  color: #ff95c6;
  padding: 2px 7px !important;
  margin-top: -10px !important;
}

.pb-remove-item:hover {
  color: #c12a5a;
}

/* STEP 3: Summary */
#pb-summary {
  list-style: none;
  margin: 1rem 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.pb-summary-bag {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.pb-summary-bag-icon {
  width: 80px;
  height: 80px;
  object-fit: contain;
}

.pb-summary-bag div {
  font-weight: bold;
  color: #222;
}

.pb-summary-sweet {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #fafafa;
  border: 2px solid #cac4ef;
  border-radius: 6px;
  padding: 0.5rem 1rem;
}

.pb-summary-thumb-small {
  width: 32px;
  height: 32px;
  object-fit: cover;
  border-radius: 4px;
}

/* Toast styles */
#pb-toast-container {
  position: fixed;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 1000;
}

.pb-toast {
  background: #ff95c6;
  color: #fff;
  padding: 0.75rem 1.25rem;
  margin-top: 0.5rem;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  animation: pop-in 0.2s ease-out forwards,
             fade-out 0.5s ease-in 2.5s forwards;
}

@keyframes pop-in {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes fade-out {
  from { opacity: 1; }
  to   { opacity: 0; }
}

/* ────────────────────────────────────────────────────────────────────────────
   Party-Bag Wizard: Step 3 (Name & Date / Age)
   ──────────────────────────────────────────────────────────────────────────── */

/* Heading */
.pb-heading {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: #333;
  font-weight: 500;
}

/* Form rows (label + input) */
.pb-form-row {
  display: flex;
  flex-direction: column;
  margin-bottom: 1.25rem;
}

/* Label styling */
.pb-label {
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  color: #555;
}

/* Input styling */
.pb-input {
  padding: 0.6rem 0.75rem;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  max-width: 300px;
  width: 100%;
  box-sizing: border-box;
  transition: border-color 0.2s;
}

.pb-input:focus {
  outline: none;
  border-color: #0073aa; /* adjust to your primary brand color */
  box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
}

/* Button row: right-align the “Next” button, space them apart */
.pb-button-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1.5rem;
}

/* Base button styles */
.pb-button {
  padding: 0.6rem 1rem;
  font-size: 0.95rem;
  border-radius: 4px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s;
}

/* Primary button (filled) */
.pb-button--primary {
  background-color: #0073aa;      /* your primary color */
  color: #fff;
  border-color: #0073aa;
}
.pb-button--primary:hover:not(:disabled) {
  background-color: #005f8d;
  border-color: #005f8d;
}

/* Outline button style (for “Back”) */
.pb-button--outline {
  background-color: transparent;
  color: #333;
  border-color: #ccc;
}
.pb-button--outline:hover:not(:disabled) {
  background-color: #f3f3f3;
  border-color: #bbb;
}

/* Disabled state */
.pb-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Adjust spacing on smaller screens */
@media (max-width: 480px) {
  .pb-button-row {
    flex-direction: column;
    gap: 0.75rem;
  }
  .pb-button {
    width: 100%;
    text-align: center;
  }
}

/* RESPONSIVE */

/* STEP 1 */
/* ─── Tablet & Mobile: horizontal scroll for bag cards ───────────────── */
@media (max-width: 1024px) {
  /* Make the container a single row that scrolls sideways */
  #pb-wizard .pb-bag-options {
    display: flex;
    flex-direction: row;
    gap: 1rem;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 0.5rem;
    -webkit-overflow-scrolling: touch;
  }
  /* Slim scrollbar styling */
  #pb-wizard .pb-bag-options::-webkit-scrollbar {
    height: 8px;
  }
  #pb-wizard .pb-bag-options::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.2);
    border-radius: 4px;
  }

  /* Each card keeps a fixed width */
  .pb-bag-card {
    flex: 0 0 auto;
    width: 260px;      /* adjust to taste */
    max-width: 260px;
  }
}

/* Optional: ensure on very small screens cards aren’t too tall */
@media (max-width: 480px) {
  .pb-bag-card {
    padding: 0.75rem;
    width: 220px;
    max-width: 220px;
  }
  .pb-bag-card img {
    max-height: 140px;
    object-fit: contain;
  }
}


/* STEP 2 */

/* ─── Tablet & Mobile: horizontal scrollable sweets row ───────────────── */
@media (max-width: 1024px) {
  .pb-scrollable-grid {
    display: flex;
    flex-direction: row;
	justify-content: center;
    gap: 0.75rem;
    max-width: 100%;
    overflow-y: auto;
    padding-bottom: 0.5rem;
  }
  .pb-scrollable-grid::-webkit-scrollbar {
    height: 8px;
  }
  .pb-scrollable-grid::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.2);
    border-radius: 4px;
  }
  .pb-candy-card {
    flex: 0 0 auto;         /* don’t wrap, keep intrinsic width */
    width: 140px;           /* fixed card width */
    height: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.5rem;
  }
  .pb-candy-card::before { display: none; }
  .pb-candy-card img {
    width: 80px;            /* consistent thumbnail size */
    height: 80px;
    object-fit: contain;
    margin-bottom: 0.5rem;
  }
  .pb-candy-card .name {
    font-size: 0.9rem;
    text-align: center;
    line-height: 1.2;
  }
}