:root {
  --bg: #fffaf8;
  --card: #ffffff;
  --pink: #e8b7c5;
  --pink-soft: #fff0f4;
  --pink-dark: #b9798d;
  --text: #4c3f42;
  --muted: #9b8589;
  --border: #f2dce3;
  --disabled-bg: #f6f0f2;
  --disabled-text: #c6adb5;
  --shadow: 0 14px 34px rgba(185, 121, 141, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background:
    radial-gradient(circle at top left, #ffeef4 0, transparent 32%),
    radial-gradient(circle at bottom right, #fff0e6 0, transparent 34%),
    var(--bg);
  color: var(--text);
}

.container {
  max-width: 1160px;
  margin: auto;
  padding: 34px 18px 60px;
}

.hero {
  position: relative;
  text-align: center;
  margin-bottom: 30px;
  padding: 20px 10px;
}

.brand-badge {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(255,255,255,0.85);
  border: 1px solid var(--border);
  color: var(--pink-dark);
  font-size: 13px;
  margin-bottom: 12px;
}

.hero h1 {
  margin: 0;
  font-size: clamp(32px, 6vw, 54px);
  color: var(--pink-dark);
}

.hero p {
  margin: 10px 0 0;
  color: var(--muted);
}

.contact-actions,
.tool-actions,
.tabs,
.sizes {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

.contact-actions {
  margin-top: 22px;
}

.tool-actions {
  margin-top: 12px;
}

.tabs,
.sizes {
  margin: 18px 0;
  padding: 10px 6px 14px;
  overflow: visible;
}

a,
button {
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.95);
  color: var(--pink-dark);
  padding: 10px 18px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 14px;
  text-decoration: none;
  transition: transform 0.22s ease, box-shadow 0.22s ease, background 0.22s ease, opacity 0.22s ease;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}

a:hover,
button:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 8px 18px rgba(185, 121, 141, 0.14);
  background: var(--pink-soft);
}

.soft-btn {
  background: rgba(255,255,255,0.95);
  color: var(--pink-dark);
  border: 1px solid var(--border);
}

.refresh-icon-btn {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 50%;
  font-size: 20px;
  line-height: 1;
  background: rgba(255,255,255,0.95);
  color: var(--pink-dark);
  border: 1px solid var(--border);
}

button.active {
  background: var(--pink);
  color: #fff;
  border-color: var(--pink);
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(185, 121, 141, 0.22);
}

button.size-disabled {
  background: var(--disabled-bg);
  color: var(--disabled-text);
  border-color: #eadfe3;
  opacity: 0.72;
  cursor: not-allowed;
  box-shadow: none;
  position: relative;
}

button.size-disabled:hover {
  transform: none;
  box-shadow: none;
  background: var(--disabled-bg);
}

button.size-disabled::after {
  content: 'ยังไม่มีตัวอย่าง';
  display: block;
  font-size: 9px;
  line-height: 1;
  margin-top: 3px;
  color: #bfa7ae;
}

.section-title {
  text-align: center;
  margin: 26px 0 4px;
  font-size: 20px;
  color: var(--pink-dark);
}

.count-text {
  text-align: center;
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 14px;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 18px;
}

.card {
  background: var(--card);
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 8px 22px rgba(185, 121, 141, 0.10);
  cursor: pointer;
  transition: 0.25s ease;
  aspect-ratio: 4 / 5;
}

.card:hover {
  transform: translateY(-7px) scale(1.035);
  box-shadow: var(--shadow);
  border-color: var(--pink);
}

.card.selected {
  transform: scale(1.04);
  border: 2px solid var(--pink);
  box-shadow: var(--shadow);
}

.card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.empty {
  text-align: center;
  color: var(--muted);
  margin-top: 32px;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(55, 42, 45, 0.72);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 999;
  padding: 20px;
}

.modal.show {
  display: flex;
}

.modal-content,
.guide-box {
  position: relative;
  background: #fff;
  border-radius: 26px;
  padding: 14px;
  box-shadow: 0 22px 70px rgba(0,0,0,0.25);
  animation: pop 0.2s ease;
}

.modal-content {
  width: min(94vw, 920px);
}

@keyframes pop {
  from {
    transform: scale(0.94);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

.modal-content img {
  width: 100%;
  max-height: 78vh;
  object-fit: contain;
  border-radius: 18px;
  display: block;
}

.modal-info {
  text-align: center;
  padding: 12px 6px 2px;
}

.modal-info p {
  margin: 0;
  color: var(--muted);
}

.close-btn {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--pink-dark);
  font-size: 22px;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(0,0,0,0.12);
  z-index: 5;
}

.guide-box {
  width: min(94vw, 900px);
  max-height: 88vh;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 34px 28px 28px;
}

.guide-box h2 {
  text-align: center;
  margin: 0 0 22px;
  color: var(--pink-dark);
}

.guide-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.guide-card {
  background: #fff8fa;
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 22px;
}

.guide-card h3 {
  margin: 0 0 14px;
  color: var(--pink-dark);
  text-align: center;
}

.guide-card p {
  margin: 10px 0;
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

.guide-card b {
  color: var(--pink-dark);
}

.guide-note {
  margin: 20px 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

@media (max-width: 720px) {
  .container {
    padding: 26px 14px 50px;
  }

  .refresh-icon-btn {
    top: 12px;
    right: 12px;
    width: 38px;
    height: 38px;
    font-size: 18px;
  }

  .contact-actions,
  .tabs,
  .sizes {
    justify-content: flex-start;
    overflow-x: auto;
    overflow-y: visible;
    flex-wrap: nowrap;
    padding: 12px 6px 18px;
    scroll-padding-inline: 12px;
    -webkit-overflow-scrolling: touch;
  }

  .contact-actions::-webkit-scrollbar,
  .tabs::-webkit-scrollbar,
  .sizes::-webkit-scrollbar {
    height: 0;
  }

  .tool-actions {
    justify-content: center;
    flex-wrap: wrap;
    overflow: visible;
  }

  a,
  button {
    flex: 0 0 auto;
    font-size: 13px;
    padding: 9px 15px;
  }

  button.size-disabled::after {
    font-size: 8px;
  }

  .gallery {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .card {
    border-radius: 18px;
  }

  .guide-columns {
    grid-template-columns: 1fr;
  }

  .guide-box {
    width: min(94vw, 560px);
    padding: 58px 16px 22px;
  }

  .modal-content {
    border-radius: 20px;
    padding: 8px;
  }

  .close-btn {
    top: 14px;
    right: 14px;
  }
}
