/* ============================================================
   SizeSelector — like Noon.com size picker
   ============================================================ */

.pdp-size-section {
  margin-top: 0;
  padding: 0;
  background: none;
  box-shadow: none;
  border-radius: 0;
}

.pdp-size-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.pdp-size-title {
  font-size: 0.95rem;
  font-weight: 900;
  color: var(--pdp-ink);
  margin: 0;
}

.pdp-size-guide-link {
  font-size: 0.82rem;
  color: var(--pdp-blue);
  font-weight: 700;
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: opacity 0.15s;
}
.pdp-size-guide-link:hover {
  opacity: 0.75;
}
.pdp-size-guide-link .material-icons-outlined {
  font-size: 16px;
}

/* Size options — always wrap into rows, exactly like Noon */
.pdp-size-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.pdp-size-options.pdp-size-scroll {
  flex-wrap: wrap;
  overflow: visible;
}

/* Individual size button — flat square style like Noon */
.pdp-size-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  height: 42px;
  padding: 0 14px;
  border: 1px solid #c9ccd4;
  border-radius: 4px;
  background: #fff;
  color: var(--pdp-text);
  font-size: 0.85rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, color 0.15s ease;
  user-select: none;
  flex: none;
}
.pdp-size-btn:hover {
  border-color: #7c818c;
}
.pdp-size-btn:active {
  transform: scale(0.97);
}

/* Selected state — thick dark border, no badge (Noon style) */
.pdp-size-btn.is-selected {
  border-color: var(--pdp-ink);
  box-shadow: inset 0 0 0 1px var(--pdp-ink);
  color: var(--pdp-ink);
  font-weight: 900;
}

/* Unavailable state — grey text + diagonal strike like Noon */
.pdp-size-btn.is-unavailable {
  cursor: not-allowed;
  color: #b6bac3;
  background: #fcfcfc;
  border-color: #eceef2;
  position: relative;
  overflow: hidden;
}
.pdp-size-btn.is-unavailable::before {
  content: "";
  position: absolute;
  top: 50%;
  left: -8%;
  right: -8%;
  height: 1.5px;
  background: #c3c7cf;
  transform: rotate(-22deg);
}
.pdp-size-btn.is-unavailable:hover {
  border-color: #eceef2;
  box-shadow: none;
}

/* Size guide modal */
.pdp-size-guide-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: pdp-fade-in 0.2s ease both;
}

.pdp-size-guide-modal {
  background: #fff;
  border-radius: 20px;
  max-width: 560px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 28px 24px 24px;
  position: relative;
  direction: rtl;
  animation: pdp-modal-in 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes pdp-modal-in {
  from { opacity: 0; transform: scale(0.92) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.pdp-size-guide-close {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 0;
  background: #f1f5f9;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  font-size: 18px;
  transition: background 0.15s, transform 0.15s;
}
.pdp-size-guide-close:hover {
  background: #e2e8f0;
  transform: scale(1.1);
}

.pdp-size-guide-modal h2 {
  margin: 0 0 18px;
  font-size: 1.15rem;
  font-weight: 900;
  color: var(--pdp-ink);
}

.pdp-size-guide-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 18px;
  font-size: 0.85rem;
}
.pdp-size-guide-table th {
  background: #f8fafc;
  color: var(--pdp-muted);
  font-weight: 700;
  padding: 10px 12px;
  text-align: center;
  border-bottom: 2px solid var(--pdp-border);
}
.pdp-size-guide-table td {
  padding: 10px 12px;
  text-align: center;
  border-bottom: 1px solid #f1f5f9;
  color: var(--pdp-text);
}

.pdp-size-guide-section {
  margin-top: 16px;
}
.pdp-size-guide-section h3 {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--pdp-ink);
  margin: 0 0 8px;
}
.pdp-size-guide-section p,
.pdp-size-guide-section li {
  font-size: 0.85rem;
  color: var(--pdp-text);
  line-height: 1.7;
  margin: 0 0 6px;
}
.pdp-size-guide-section ol {
  padding-inline-start: 20px;
  margin: 0;
}

.pdp-size-guide-img {
  width: 100%;
  max-width: 300px;
  height: auto;
  display: block;
  margin: 14px auto 0;
  border-radius: 12px;
}

/* Toast for "select size first" */
.pdp-size-toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 99999;
  background: var(--pdp-ink);
  color: #fff;
  padding: 12px 24px;
  border-radius: 14px;
  font-size: 0.9rem;
  font-weight: 700;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  animation: pdp-size-toast-in 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  direction: rtl;
  white-space: nowrap;
}
.pdp-size-toast.pdp-size-toast-hide {
  animation: pdp-size-toast-out 0.25s ease-in forwards;
}

@keyframes pdp-size-toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(20px) scale(0.9); }
  to { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}
@keyframes pdp-size-toast-out {
  from { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
  to { opacity: 0; transform: translateX(-50%) translateY(-10px) scale(0.9); }
}

/* Responsive */
@media (max-width: 767px) {
  .pdp-size-btn {
    min-width: 46px;
    height: 38px;
    padding: 0 12px;
    font-size: 0.8rem;
  }
  .pdp-size-guide-modal {
    padding: 20px 16px;
    border-radius: 16px;
  }
}

@media (min-width: 1200px) {
  .pdp-size-btn {
    min-width: 56px;
    height: 44px;
    padding: 0 18px;
    font-size: 0.88rem;
  }
}

/* ---------- Desktop: card parked under the gallery ---------- */
@media (min-width: 1200px) {
  #pdp-sizes-section.pdp-size-desktop-card {
    margin-top: 16px;
    padding: 16px 18px;
    background: var(--pdp-surface);
    border-radius: var(--pdp-radius);
    box-shadow: var(--pdp-shadow-sm);
  }
}
