/* =========================================================
   GlowWithBella — Size Chart Modal
   ========================================================= */

.size-chart-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.size-chart-modal.is-open {
  opacity: 1;
  pointer-events: all;
}
.size-chart-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.55);
  cursor: pointer;
}
.size-chart-modal__box {
  position: relative;
  background: #fff;
  width: 100%;
  max-width: 780px;
  max-height: 92vh;
  border-radius: 20px 20px 0 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(30px);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  margin: 0 auto;
}
.size-chart-modal.is-open .size-chart-modal__box {
  transform: translateY(0);
}

/* On desktop show as centered dialog */
@media (min-width: 768px) {
  .size-chart-modal { align-items: center; }
  .size-chart-modal__box { border-radius: 20px; max-height: 85vh; }
}

/* Header */
.size-chart-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid #f0f0f0;
  flex-shrink: 0;
}
.size-chart-modal__header h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0;
}
.size-chart-modal__close {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: #f5f5f5;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
}
.size-chart-modal__close:hover { background: #ffe0ef; }

/* Tabs */
.size-chart-modal__tabs {
  display: flex;
  border-bottom: 2px solid #f0f0f0;
  overflow-x: auto;
  scrollbar-width: none;
  flex-shrink: 0;
  padding: 0 16px;
}
.size-chart-modal__tabs::-webkit-scrollbar { display: none; }
.sc-tab {
  flex-shrink: 0;
  padding: 12px 16px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-text-muted);
  border: none;
  background: none;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
  white-space: nowrap;
}
.sc-tab.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}
.sc-tab:hover { color: var(--color-primary); }

/* Body */
.size-chart-modal__body {
  overflow-y: auto;
  padding: 20px 24px 28px;
  flex: 1;
}
.sc-panel { display: none; }
.sc-panel.active { display: block; }

/* Note */
.sc-note {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-bottom: 14px;
  padding: 8px 12px;
  background: #fff8f0;
  border-left: 3px solid var(--color-primary);
  border-radius: 4px;
}

/* Table */
.sc-table-wrap {
  overflow-x: auto;
  margin-bottom: 24px;
  border-radius: 10px;
  border: 1px solid #f0f0f0;
}
.sc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  min-width: 400px;
}
.sc-table th, .sc-table td {
  padding: 10px 14px;
  text-align: center;
  border-bottom: 1px solid #f5f5f5;
}
.sc-table thead th {
  background: var(--color-primary);
  color: #fff;
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.5px;
}
.sc-table thead th:first-child { border-radius: 10px 0 0 0; }
.sc-table thead th:last-child { border-radius: 0 10px 0 0; }
.sc-table tbody tr:nth-child(even) td,
.sc-table tbody tr:nth-child(even) th { background: #fafafa; }
.sc-table tbody th {
  font-weight: 700;
  color: var(--color-primary);
  background: #fff0f8;
}
.sc-table tbody tr:last-child td,
.sc-table tbody tr:last-child th { border-bottom: none; }

.size-pill {
  display: inline-block;
  padding: 3px 10px;
  border: 1.5px solid var(--color-primary);
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-primary);
}

/* Measure steps */
.sc-measure-steps { display: flex; flex-direction: column; gap: 14px; margin-top: 16px; }
.sc-step {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.sc-step__num {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}
.sc-step strong { font-size: 0.88rem; display: block; margin-bottom: 3px; }
.sc-step p { font-size: 0.8rem; color: var(--color-text-muted); margin: 0; line-height: 1.5; }

.sc-measure-tip {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px;
  background: #fff0f8;
  border-radius: 10px;
  margin-bottom: 20px;
}
.sc-measure-tip p { font-size: 0.82rem; color: var(--color-text); margin: 0; line-height: 1.6; }

/* =========================================================
   Add to Cart Toast Notification (improved)
   ========================================================= */
.cart-toast {
  position: fixed;
  bottom: 80px;
  right: 16px;
  z-index: 9999;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
  padding: 0;
  width: 300px;
  overflow: hidden;
  transform: translateX(340px);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  border: 1px solid #f0f0f0;
}
.cart-toast.is-visible { transform: translateX(0); }
.cart-toast__bar {
  height: 4px;
  background: var(--color-primary);
  animation: cartToastProgress 3.5s linear forwards;
}
@keyframes cartToastProgress {
  from { width: 100%; }
  to   { width: 0%; }
}
.cart-toast__inner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 14px 14px 14px;
}
.cart-toast__img {
  width: 56px; height: 70px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  background: #f5f5f5;
}
.cart-toast__img img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.cart-toast__content { flex: 1; min-width: 0; }
.cart-toast__label {
  font-size: 0.7rem;
  color: var(--color-primary);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 3px;
}
.cart-toast__name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 8px;
}
.cart-toast__actions {
  display: flex;
  gap: 8px;
}
.cart-toast__actions a,
.cart-toast__actions button {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 50px;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}
.cart-toast__view {
  background: var(--color-primary);
  color: #fff !important;
}
.cart-toast__view:hover { background: var(--color-primary-dark); }
.cart-toast__checkout {
  background: #f5f5f5;
  color: var(--color-text) !important;
}
.cart-toast__checkout:hover { background: #eee; }
.cart-toast__close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 20px; height: 20px;
  background: none;
  border: none;
  cursor: pointer;
  color: #aaa;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 14px;
  line-height: 1;
}
.cart-toast__close:hover { color: var(--color-text); background: #f5f5f5; }

@media(max-width: 480px) {
  .cart-toast { width: calc(100vw - 32px); right: 16px; bottom: 72px; }
}

/* Size Chart button */
.size-chart-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--color-primary);
  text-decoration: none;
  border: none;
  background: none;
  cursor: pointer;
  padding: 0;
  margin-top: 6px;
}
.size-chart-btn:hover { text-decoration: underline; }
.size-chart-btn svg { flex-shrink: 0; }
