.pw-section,
.pw-section * {
  box-sizing: border-box;
  font-family: "Noto Sans Thai", Arial, sans-serif;
}

.pw-section {
  max-width: 1200px;
  margin: 0 auto;
  background: #fff7f7;
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  color: #141414;
  font-size: 20px;
}

.pw-section .pw-title {
  text-align: center;
  font-size: 40px !important;
  font-weight: 800;
  margin-bottom: 8px;
  line-height: 1.2;
}

.pw-section .pw-title .red { color: #ff1d1d; }

.pw-section .pw-subtitle {
  text-align: center;
  font-size: 32px !important;
  font-weight: 800;
  margin-bottom: 16px;
}

/* --- feature row --- */
.pw-feature-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 18px 26px;
  margin-bottom: 18px;
}

.pw-feature-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: clamp(20px, 2vw, 24px);
}

.pw-feature-icon {
  width: 34px;
  height: 34px;
  border: 4px solid #ff3657;
  color: #ff3657;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
  flex: 0 0 auto;
}

/* --- filter bar --- */
.pw-filter-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  padding: 10px 0;
}

.pw-arrow {
  cursor: pointer;
  font-size: 28px;
  padding: 0 6px;
  user-select: none;
  color: #222;
  line-height: 1;
  flex: 0 0 auto;
}

.pw-filter-container {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  flex: 1;
  scroll-behavior: smooth;
}

.pw-filter-container::-webkit-scrollbar { display: none; }

.pw-fil-btn {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #ddd;
  background: #fff;
  border-radius: 999px;
  padding: 6px 12px 6px 6px;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  color: inherit;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.pw-fil-btn:hover         { background: #FF7E7E; color: #fff; border-color: #FF7E7E; }
.pw-fil-btn.active        { background: #FC0000; color: #fff; border-color: #FC0000; }
.pw-fil-btn.active:hover  { background: #FC0000; color: #fff; border-color: #FC0000; }

.pw-fil-btn img {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
}

/* --- package columns --- */
.pw-package-columns {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.pw-package-column {
  width: calc(50% - 8px);
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
}

.pw-column-head {
  color: #fff;
  text-align: center;
  font-size: clamp(28px, 3vw, 36px);
  font-weight: 800;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.pw-column-head.red  { background: #ff1d1d; }
.pw-column-head.blue { background: #1657ea; }

.pw-head-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
}

.pw-head-icon svg { display: block; width: 100%; height: 100%; }

/* --- cards grid --- */
.pw-cards-grid {
  padding: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-content: flex-start;
  justify-content: flex-start;
  max-height: 560px;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

.pw-cards-grid::-webkit-scrollbar       { width: 8px; }
.pw-cards-grid::-webkit-scrollbar-thumb { background: #d9d9d9; border-radius: 999px; }

/* --- product card --- */
.pw-product-card {
  width: calc(50% - 6px);
  max-width: 260px;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #e8e8e8;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
}

.pw-card-image-wrap {
  position: relative;
  height: 130px;
  overflow: hidden;
  background: linear-gradient(135deg, #e8e8e8 0%, #f5f5f5 100%);
}

.pw-card-image-wrap .main-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* flag fallback: center + scale up nicely */
.pw-card-image-wrap .main-img[src$=".svg"] {
  object-fit: contain;
  padding: 20px;
  background: linear-gradient(135deg, #f0f4ff 0%, #e8ecff 100%);
}

.pw-flag-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #fff;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.pw-corner-flag {
  position: absolute;
  top: 0;
  right: 0;
  min-width: 58px;
  padding: 6px 8px 12px;
  color: #fff;
  text-align: center;
  line-height: 1;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 84%, 0 100%);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.pw-corner-flag.red  { background: #ff1d1d; }
.pw-corner-flag.blue { background: #1657ea; }

.pw-signal {
  display: block;
  margin: 0 auto 3px;
  width: 14px;
  height: 14px;
}

.pw-net-text {
  display: block;
  font-size: 17px;
  font-weight: 800;
}

/* --- card body --- */
.pw-card-body { padding: 10px; }

.pw-country-name {
  font-size: 17px;
  font-weight: 800;
  color: #111;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.pw-price-row   { margin-bottom: 6px; }

.pw-current-price {
  font-size: 20px;
  font-weight: 800;
  color: #ff1d1d;
}

.pw-old-price {
  font-size: 16px;
  color: #777;
  text-decoration: line-through;
  margin-left: 6px;
}

.pw-desc {
  font-size: 14px;
  color: #666;
  line-height: 1.4;
  min-height: 30px;
}

.pw-buy-btn {
  width: 100%;
  border: 0;
  border-radius: 6px;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  padding: 8px 10px;
  margin-top: 8px;
  cursor: pointer;
  display: block;
  text-align: center;
  text-decoration: none;
}

.pw-buy-btn.red  { background: #ff1d1d; }
.pw-buy-btn.blue { background: #1657ea; }

.pw-empty-box {
  display: none;
  text-align: center;
  padding: 30px 10px;
  color: #777;
  font-size: 18px;
  width: 100%;
}

/* --- filtered view (single country selected) --- */
.pw-package-columns.filtered-view                    { justify-content: center; gap: 12px; }
.pw-package-columns.filtered-view .pw-package-column { width: 260px; flex: 0 0 260px; }
.pw-package-columns.filtered-view .pw-package-column--5g { order: 1; }
.pw-package-columns.filtered-view .pw-package-column--4g { order: 2; }
.pw-package-columns.filtered-view .pw-cards-grid     { justify-content: center; }
.pw-package-columns.filtered-view .pw-product-card   { width: 100%; max-width: 100%; }

/* --- tablet --- */
@media (max-width: 1024px) {
  .pw-package-columns,
  .pw-package-columns.filtered-view {
    flex-direction: column;
    gap: 16px;
  }

  .pw-package-column,
  .pw-package-columns.filtered-view .pw-package-column {
    width: 100%;
    flex: 1 1 auto;
    margin: 0;
  }

  .pw-cards-grid {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    max-height: none;
    justify-content: flex-start;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }

  .pw-package-columns.filtered-view .pw-cards-grid { justify-content: flex-start; }

  .pw-product-card,
  .pw-package-columns.filtered-view .pw-product-card {
    flex: 0 0 38%;
    width: 38%;
    max-width: none;
    scroll-snap-align: start;
  }

  .pw-empty-box { min-width: 100%; }
}

/* --- mobile --- */
@media (max-width: 640px) {
  .pw-section                  { padding: 16px; }
  .pw-section .pw-title        { font-size: 32px !important; }
  .pw-section .pw-subtitle     { font-size: 26px !important; }
  .pw-feature-row              { gap: 12px; }
  .pw-feature-item             { font-size: 19px; }

  .pw-product-card,
  .pw-package-columns.filtered-view .pw-product-card {
    flex: 0 0 72%;
    width: 72%;
    scroll-snap-align: center;
  }

  .pw-package-columns.filtered-view .pw-cards-grid { justify-content: center; }
}
