:root {
  --accent: #ff2d2d;
  --accent-2: #ff6b6b;
  --violet: #a855f7;
  --txt: #ffffff;
  --muted: #b0b8c4;
  --bg-0: #0b0b0e;
  --bg-1: #141419;
  --glass: rgba(255, 255, 255, .1);
  --glass-2: rgba(255, 255, 255, .07);
  --glass-border: rgba(255, 255, 255, .12);
  --radius: 16px;
  --shadow-sm: 0 10px 28px rgba(0, 0, 0, .30);
  --shadow-lg: 0 36px 110px rgba(0, 0, 0, .55);
}

html[data-theme="light"] {
  --txt: #0f172a;
  --muted: #475569;
  --bg-0: #f6f7fb;
  --bg-1: #ffffff;
  --glass: rgba(255, 255, 255, .85);
  --glass-2: rgba(255, 255, 255, .72);
  --glass-border: rgba(0, 0, 0, .08);
}

* {
  box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

body {
  margin: 0;
  font-family: 'Anuphan', sans-serif;
  color: var(--txt);
  background: radial-gradient(1000px 520px at 110% -10%, rgba(255, 45, 45, .16), transparent 60%), radial-gradient(960px 520px at -10% 110%, rgba(168, 85, 247, .12), transparent 60%), linear-gradient(0deg, var(--bg-0), var(--bg-1));
  min-height: 100svh;
  line-height: 1.6;
  transition: background-color 0.3s, color 0.3s;
}

a {
  color: inherit;
  text-decoration: none;
}
a:hover {
    color: var(--accent);
}

.container {
  width: min(1200px, 96vw);
  margin: 0 auto;
  padding: 0 clamp(12px, 2.5vw, 24px);
}

.glass {
  background: var(--glass);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(10px) saturate(150%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transform: translateZ(0);
  will-change: backdrop-filter, transform;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: .4rem .7rem;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: var(--glass-2);
  font-size: .8rem;
  font-weight: 700;
}

.chip--points {
  box-shadow: 0 0 0 1px rgba(255, 45, 45, .35) inset, 0 0 10px rgba(255, 45, 45, .22);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .6rem 1.2rem;
  border-radius: 10px;
  border: 1px solid var(--glass-border);
  background: var(--glass-2);
  cursor: pointer;
  transition: .22s;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--txt);
}
.btn:hover {
    background: var(--glass);
    color: var(--txt);
    transform: translateY(-2px);
}

@keyframes rotate {
  100% {
    transform: rotate(360deg);
  }
}

.btn--neon {
  position: relative;
  overflow: hidden;
  border: none;
  padding: 2px;
  background: transparent;
  z-index: 1;
  border-radius: 10px;
}

.btn--neon .btn-inner {
  display: flex;
  align-items: center;
  gap: .5rem;
  background: var(--bg-1);
  padding: .6rem 1.2rem;
  border-radius: 8px;
  color: #fff;
  transition: background .2s;
}

.btn--neon:hover .btn-inner {
  background: var(--bg-0);
}

html[data-theme="light"] .btn--neon .btn-inner {
  color: var(--accent);
  background: var(--bg-1);
}

html[data-theme="light"] .btn--neon:hover .btn-inner {
  background: var(--bg-0);
}

.btn--neon::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  z-index: -1;
  width: 200%;
  height: 200%;
  background: conic-gradient(var(--accent), var(--violet), var(--accent));
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 70;
  background: linear-gradient(180deg, rgba(11, 11, 14, .5), transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
html[data-theme="light"] .topbar {
    background: linear-gradient(180deg, rgba(255,255,255,.5), transparent);
}

.top-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: .6rem;
}

.brand .mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: radial-gradient(circle at 28% 28%, #fff6, #0000 45%), linear-gradient(45deg, var(--accent), #3a0c0c);
  box-shadow: inset 0 1px 0 #fff6, 0 6px 18px rgba(255, 45, 45, .35);
}

.brand .name {
  font-weight: 900;
  letter-spacing: .3px;
}

.search {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .5rem .8rem;
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  background: var(--glass-2);
  max-width: 350px;
  width: 100%;
}

.search input {
  all: unset;
  width: 100%;
  font-size: .9rem;
  color: var(--txt);
}

.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--glass-border);
  background: var(--glass-2);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
}
.icon-btn:hover {
    color: var(--txt);
}

.profile-dropdown {
    position: relative;
    display: inline-block;
}
.profile-display {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}
.username-display {
    font-weight: 700;
    color: var(--txt);
}
.profile-avatar {
    display: block;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    border: 2px solid var(--glass-border);
}
.dropdown-content {
    display: none;
    position: absolute;
    background-color: var(--bg-1);
    min-width: 180px;
    box-shadow: var(--shadow-lg);
    z-index: 100;
    right: 0;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--glass-border);
}
.dropdown-content a {
    color: var(--muted);
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    font-size: 0.9em;
    font-weight: 700;
}
.dropdown-content a:hover {
    background-color: var(--glass-2);
    color: var(--txt);
}
.profile-dropdown:hover .dropdown-content {
    display: block;
}

.layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 20px;
  margin-top: 16px;
}

@media (max-width: 960px) {
  .layout {
    grid-template-columns: 1fr;
  }
  .sidebar {
      display: none;
  }
  .username-display {
      display: none;
  }
}

.sidebar {
  position: sticky;
  top: 80px;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.side-card {
  padding: 10px;
}

.side-title {
  font-size: .7rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .12em;
  margin: 4px 10px;
  font-weight: 700;
}

.side-item {
  display: flex;
  align-items: center;
  padding: .7rem .8rem;
  border-radius: 10px;
  border: 2px solid transparent;
  background: transparent;
  cursor: pointer;
  transition: .2s;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--muted);
}

.side-item span {
    display: flex;
    align-items: center;
    gap: .7rem;
    position: relative;
    z-index: 2;
}

.side-item:hover {
  transform: translateX(4px);
  background: var(--glass-2);
  color: var(--txt);
}

.side-item.active {
  background: linear-gradient(90deg, rgba(255, 45, 45, .18), rgba(168, 85, 247, .16));
  color: #fff;
  position: relative;
  border-radius: 10px;
}

html[data-theme="light"] .side-item.active {
    color: var(--txt);
}

.side-item.active::before {
  content: '';
  position: absolute;
  left: -2px;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 60%;
  background: linear-gradient(to bottom, var(--accent), var(--violet));
  border-radius: 4px;
}

.side-item svg {
  width: 20px;
  height: 20px;
  opacity: 0.7;
}

.side-item.active svg,
.side-item:hover svg {
  opacity: 1;
}

.support-card {
  text-align: center;
  padding: 16px;
}

.support-card .icon {
  font-size: 2.5rem;
  line-height: 1;
  opacity: 0.8;
  margin-bottom: 8px;
  color: var(--accent);
}

.support-card h4 {
  margin: 8px 0;
  font-size: 1rem;
  color: var(--txt);
}

.support-card p {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0 0 12px;
}

.content {
  display: grid;
  gap: 20px;
  padding-bottom: 40px;
}

.hero {
  position: relative;
  overflow: hidden;
  animation: fadeIn .5s .1s both;
}

.hero .bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(80% 70% at 82% 0%, rgba(255, 45, 45, .35), transparent 60%), radial-gradient(80% 70% at 10% 100%, rgba(168, 85, 247, .22), transparent 60%), linear-gradient(160deg, rgba(255, 255, 255, .08), rgba(0, 0, 0, .16));
}

.hero .in {
  position: relative;
  z-index: 5;
  display: grid;
  grid-template-columns: 1fr .8fr;
  gap: 20px;
  padding: 20px;
}

@media (max-width: 800px) {
  .hero .in {
    grid-template-columns: 1fr;
  }
}

.hero h1 {
  font-size: clamp(1.6rem, 1rem + 2.2vw, 2.4rem);
  margin: .2rem 0 .5rem;
  font-weight: 900;
  line-height: 2.2;
}

.hero-illust {
  min-height: 180px;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  background: linear-gradient(160deg, rgba(255, 255, 255, .08), rgba(0, 0, 0, .16));
  background-image: url('https://placehold.co/800x600/141419/ff2d2d?text=Hero');
  background-size: cover;
  background-position: center;
}

@keyframes marquee {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

.marquee {
  overflow: hidden;
  padding: 10px 0;
}

.marquee-content {
  display: flex;
  gap: 12px;
  animation: marquee 30s linear infinite;
  padding-right: 12px;
}

.marquee:hover .marquee-content {
  animation-play-state: paused;
}

.image-square {
  display: block;
  width: 80px;
  height: 80px;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  background-color: var(--glass-2);
  transition: .2s;
  cursor: pointer;
  flex-shrink: 0;
  background-size: cover;
  background-position: center;
}

.image-square:hover {
  background-color: var(--glass);
  border-color: rgba(255, 255, 255, .2);
  transform: translateY(-2px);
}
html[data-theme="light"] .image-square:hover {
    border-color: rgba(0,0,0,.2);
}

@media (max-width: 600px) {
  .panes {
    grid-template-columns: 1fr;
  }
}

.pane {
  position: relative;
  overflow: hidden;
  animation: fadeIn .5s .2s both;
}

.poster-1 {
  background-image: url('https://placehold.co/800x450/141419/ff2d2d?text=News');
}

.poster-2 {
  background-image: url('https://placehold.co/800x450/141419/a855f7?text=New');
}

.news-nav {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  background: var(--glass);
  padding: 6px;
  border-radius: 99px;
  border: 1px solid var(--glass-border);
}

.news-nav button {
  all: unset;
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  transition: .2s;
  color: var(--muted);
}

.news-nav button:hover {
  background: var(--glass-2);
  color: var(--txt);
}

.section {
  padding: 16px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.section-head strong {
  font-size: 1.1rem;
}

.slider-grid {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 180px;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 16px;
  margin-bottom: -16px;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.slider-grid::-webkit-scrollbar {
  display: none;
}

.slider-grid .card {
  width: 180px;
}

.card {
  display: grid;
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(160deg, rgba(255, 255, 255, .08), rgba(0, 0, 0, .14));
  transition: .18s;
  animation: fadeIn .5s both;
}
html[data-theme="light"] .card {
    background: var(--bg-1);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 44px rgba(255, 45, 45, .22);
}
html[data-theme="light"] .card:hover {
    box-shadow: 0 16px 44px rgba(0,0,0,.1);
}

.card .thumb {
  aspect-ratio: 1/1;
  background-size: cover;
  background-position: center;
}

.card .body {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex-grow: 1;
}

.card .title {
  font-weight: 700;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--txt);
}

.card .meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: .8rem;
  margin-top: auto;
}

.card .price {
  color: var(--accent);
  font-weight: 900;
  font-size: 1rem;
  flex-shrink: 0;
}
html[data-theme="light"] .card .price {
    color: var(--txt);
}

.chat-widget-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1100;
}

.chat-popup {
  width: 340px;
  height: 450px;
  border-radius: var(--radius);
  overflow: hidden;
  display: none;
  flex-direction: column;
  animation: fadeIn .3s both;
  box-shadow: var(--shadow-lg);
}

.chat-popup.open {
  display: flex;
}

.chat-header {
  padding: 12px 16px; background: var(--glass-2); display: flex;
  justify-content: space-between; align-items: center;
  border-bottom: 1px solid var(--glass-border); flex-shrink: 0;
}
.chat-header h4 { margin: 0; font-size: 1rem; }
.chat-header-buttons { display: flex; gap: 8px; }
.chat-header-buttons button { all: unset; cursor: pointer; color: var(--muted); font-size: 1.2rem; transition: color .2s; }
.chat-header-buttons button:hover { color: var(--txt); }
.chat-messages { flex-grow: 1; padding: 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.msg { max-width: 80%; padding: 8px 12px; border-radius: 12px; line-height: 1.4; }
.msg.support { background: var(--glass-2); align-self: flex-start; }
.msg.user { background: var(--accent); color: #fff; align-self: flex-end; }
.chat-input { display: flex; padding: 12px; border-top: 1px solid var(--glass-border); background: var(--glass-2); flex-shrink: 0; }
.chat-input input { all: unset; width: 100%; padding: 8px 12px; background: var(--bg-0); border-radius: 8px; border: 1px solid var(--glass-border); }

.minimized-chat-button {
  display: none; width: 60px; height: 60px; border-radius: 50%;
  background: var(--accent); color: #fff; font-size: 1.8rem;
  cursor: pointer; border: none; box-shadow: var(--shadow-lg);
  animation: fadeIn .3s both;
}
.minimized-chat-button.show { display: grid; place-items: center; }


@media (max-width: 960px) {
    .chat-widget-container {
        bottom: 80px;
        right: 20px;
        left: 20px;
        width: auto;
    }
}

@media (max-width: 480px) {
    .chat-widget-container {
        bottom: 75px;
        right: 10px;
        left: 10px;
    }
    .chat-popup {
        width: 100%;
        height: 60vh;
    }
}

.chat-popup.open {
  display: flex;
}

.chat-header {
  padding: 12px 16px;
  background: var(--glass-2);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--glass-border);
  flex-shrink: 0;
}

.chat-header h4 { margin: 0; font-size: 1rem; }
.chat-header-buttons { display: flex; gap: 8px; }
.chat-header-buttons button { all: unset; cursor: pointer; color: var(--muted); font-size: 1.2rem; transition: color .2s; }
.chat-header-buttons button:hover { color: var(--txt); }

.chat-messages {
  flex-grow: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.msg { max-width: 80%; padding: 8px 12px; border-radius: 12px; line-height: 1.4; }
.msg.support { background: var(--glass-2); align-self: flex-start; }
.msg.user { background: var(--accent); color: #fff; align-self: flex-end; }

.chat-input {
  display: flex;
  padding: 12px;
  border-top: 1px solid var(--glass-border);
  background: var(--glass-2);
  flex-shrink: 0;
}

.chat-input input {
  all: unset;
  width: 100%;
  padding: 8px 12px;
  background: var(--bg-0);
  border-radius: 8px;
  border: 1px solid var(--glass-border);
}

.minimized-chat-button {
  display: none;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 1.8rem;
  cursor: pointer;
  border: none;
  box-shadow: var(--shadow-lg);
  animation: fadeIn .3s both;
}

.minimized-chat-button.show {
  display: grid;
  place-items: center;
}

.footer-cyber {
    text-align:center;
    padding: 32px 20px;
    color:var(--muted);
    font-size:.85rem;
    border-top: 1px solid var(--glass-border);
    margin-top: 40px;
}

.page-product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.page-product-grid .card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(160deg, rgba(255, 255, 255, .08), rgba(0, 0, 0, .14));
  transition: .18s;
  animation: fadeIn .5s both;
}

.page-product-grid .card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 44px rgba(255, 45, 45, .22);
}

.page-product-grid .card .thumb {
  aspect-ratio: 1/1;
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
}

.page-product-grid .card .body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-grow: 1;
}

.page-product-grid .card .title {
  font-weight: 700;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--txt);
}

.page-product-grid .card .meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: .85rem;
  margin-top: auto;
}

.page-product-grid .card .price {
  color: var(--accent);
  font-weight: 900;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.cart-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    align-items: flex-start;
}

.cart-items-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cart-item-card {
    display: grid;
    grid-template-columns: auto 1fr auto auto auto;
    align-items: center;
    gap: 16px;
    padding: 12px;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    background: var(--glass-2);
}

.cart-item-card .item-image {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 8px;
    background-color: var(--bg-0);
}

.cart-item-card .item-details {
    line-height: 1.4;
}

.cart-item-card .item-title {
    font-weight: 700;
    color: var(--txt);
}

.cart-item-card .item-option {
    font-size: 0.85rem;
    color: var(--muted);
}

.cart-item-card .item-price-mobile {
    display: none;
    font-size: 0.9rem;
    color: var(--accent);
    font-weight: 700;
}

.cart-item-card .item-quantity {
    font-size: 0.9rem;
    color: var(--muted);
}

.cart-item-card .item-subtotal {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--txt);
    min-width: 100px;
    text-align: right;
}

.cart-item-card .btn--remove {
    padding: 0;
    width: 36px;
    height: 36px;
    background: rgba(255, 45, 45, .1);
    color: var(--accent);
    border: 1px solid rgba(255, 45, 45, .2);
}
.cart-item-card .btn--remove:hover {
    background: var(--accent);
    color: #fff;
}

.cart-summary {
    position: sticky;
    top: 80px;
    padding: 20px;
}

.cart-summary .summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.1rem;
    margin-bottom: 16px;
}

.cart-summary .summary-divider {
    border: none;
    height: 1px;
    background-color: var(--glass-border);
    margin: 16px 0;
}


@media (max-width: 960px) {
    .cart-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .cart-item-card {
        grid-template-columns: auto 1fr auto;
        grid-template-areas:
            "image details actions"
            "image quantity subtotal";
        gap: 8px 12px;
    }
    .item-image { grid-area: image; }
    .item-details { grid-area: details; }
    .item-actions { grid-area: actions; }
    .item-quantity { grid-area: quantity; text-align: left; }
    .item-subtotal { grid-area: subtotal; min-width: auto; }
    .item-price-mobile { display: block; }
}
.cart-icon-wrapper {
    position: relative;
    color: var(--muted);
}
.cart-icon-wrapper:hover {
    color: var(--txt);
}
.cart-count {
    position: absolute;
    top: -2px;
    right: -4px;
    background-color: var(--accent);
    color: #fff;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    border: 1px solid var(--bg-1);
}

.checkout-page-wrapper {
    max-width: 600px;
    margin: 0 auto;
}

.checkout-card {
    padding: clamp(20px, 4vw, 32px);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.order-summary-box, .order-total-box, .payment-form-box {
    width: 100%;
}

.box-title {
    margin-top: 0;
    margin-bottom: 16px;
    font-size: 1.1rem;
    color: var(--muted);
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 8px;
}

.summary-item {
    display: flex;
    align-items: center;
    gap: 16px;
}
.summary-item:not(:last-child) {
    margin-bottom: 12px;
}

.summary-item-image {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 8px;
    background-color: var(--bg-0);
    flex-shrink: 0;
}

.summary-item-details {
    flex-grow: 1;
    line-height: 1.3;
}
.summary-item-details .item-title { font-weight: 700; }
.summary-item-details .item-option { font-size: 0.85rem; color: var(--muted); }
.summary-item-price { font-weight: 700; font-size: 1rem; }

.order-total-box {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 1.2rem;
    font-weight: 700;
    padding: 16px 0;
    border-top: 1px solid var(--glass-border);
    border-bottom: 1px solid var(--glass-border);
}

.order-total-box strong {
    font-size: 1.5rem;
    color: var(--accent);
}

.button-container {
    display: flex;
    justify-content: center;
    margin-top: 10px;
}

.empty-state {
    text-align: center;
    padding: 30px;
}
.empty-state p {
    margin: 0 0 20px;
    color: var(--muted);
}

.custom-modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex; justify-content: center; align-items: center;
    z-index: 200; opacity: 0; visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.custom-modal-overlay.is-visible { opacity: 1; visibility: visible; }
.custom-modal-content {
    padding: 30px;
    width: 90%; max-width: 400px; text-align: center; position: relative;
    transform: scale(0.9); transition: transform 0.3s ease;
}
.custom-modal-overlay.is-visible .custom-modal-content { transform: scale(1); }
.custom-modal-close {
    position: absolute; top: 10px; right: 15px; font-size: 2em;
    color: var(--muted); cursor: pointer; line-height: 1;
}
#custom-alert-title { margin: 10px 0; color: var(--txt); }
#custom-alert-message { color: var(--muted); line-height: 1.6; }
#custom-alert-ok { margin-top: 20px; }
#custom-alert-canvas { background: transparent; border-radius: 50%; margin-bottom: 10px; }
.product-detail-grid {
    display: grid;
    grid-template-columns: 5fr 4fr;
    gap: clamp(20px, 4vw, 40px);
    align-items: flex-start;
}

@media (max-width: 960px) {
    .product-detail-grid {
        grid-template-columns: 1fr;
    }
}

.new-gallery-layout {
    display: grid;
    grid-template-columns: 1fr 4fr;
    gap: 10px;
}

.thumb-slider-wrapper {
    min-width: 0;
}

.product-thumb-slider {
    height: 100%;
}

.product-thumb-slider .swiper-slide {
    width: 100%;
    opacity: 0.6;
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    transition: opacity 0.2s, border-color 0.2s;
    border: 2px solid transparent;
}

.product-thumb-slider .swiper-slide-thumb-active {
    opacity: 1;
    border-color: var(--accent);
}

.product-thumb-slider .swiper-slide img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}


.main-slider-wrapper {
    width: 100%;
    aspect-ratio: 1 / 1;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background-color: var(--bg-0);
}

.product-main-slider {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
}

.product-main-slider .swiper-slide {
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-main-slider .swiper-slide img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.swiper-button-next, .swiper-button-prev {
    color: var(--txt) !important;
    background: rgba(var(--bg-rgb-1), 0.7);
    backdrop-filter: blur(5px);
    width: 44px; height: 44px;
    border-radius: 50%;
    transition: background 0.3s ease;
}
.swiper-button-next:hover, .swiper-button-prev:hover {
    background: var(--accent);
    color: #fff !important;
}
.swiper-button-next:after, .swiper-button-prev:after {
    font-size: 20px !important;
}

.product-info-panel .game-tag {font-size: 0.9rem; font-weight: 700; color: var(--muted); margin: 0 0 4px;}
.product-info-panel .product-title {font-weight: 900; line-height: 1.2; margin: 0 0 24px;}
.product-info-panel .section-label {display: block; font-size: 0.9rem; font-weight: 700; color: var(--muted); margin-bottom: 10px;}
.variation-selector {display: flex; flex-wrap: wrap; gap: 10px;}
.variation-selector input[type="radio"] {display: none;}
.variation-selector .variation-label {display: inline-block; padding: .6rem 1rem; border: 1px solid var(--glass-border); border-radius: 8px; background: var(--glass-2); cursor: pointer; transition: all .2s; font-weight: 700; font-size: 0.9rem;}
.variation-selector .variation-label:hover {background: var(--glass); border-color: rgba(255,255,255,.2);}
/* --- สไตล์สำหรับปุ่มตัวเลือก "ที่ถูกเลือก" --- */
.variation-selector input[type="radio"]:checked + .variation-label {
    background: transparent;
    color: var(--accent);
    border-color: var(--accent);
    border-width: 2px;
}

/* --- สไตล์สำหรับปุ่มตัวเลือก "ที่ปิดใช้งาน" --- */
.variation-selector input[type="radio"]:disabled + .variation-label {
    background: transparent;
    color: var(--muted);
    cursor: not-allowed;
    text-decoration: line-through;
    opacity: 0.6;
}
.price-display .out-of-stock {font-size: 1.5rem; color: var(--muted);}
.action-buttons {display: flex; gap: 12px;}
.description-section {margin-top: 16px;}
.description-section h3 {font-size: 1.1rem;}
.description-section p {color: var(--muted); line-height: 1.7; font-size: 0.95rem;}

.checkout-form-panel form {
    text-align: center;
}

.checkout-form-panel .form-group {
    text-align: left;
    width: 100%;
    margin-bottom: 20px;
}

.cart-summary {
    text-align: center;
}

.custom-modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex; justify-content: center; align-items: center;
    z-index: 200; opacity: 0; visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.custom-modal-overlay.is-visible { opacity: 1; visibility: visible; }
.custom-modal-content {
    background-color: var(--bg-1);
    border: 1px solid var(--glass-border);
    padding: 30px; border-radius: 12px;
    width: 90%; max-width: 400px; text-align: center; position: relative;
    transform: scale(0.9); transition: transform 0.3s ease;
}
.custom-modal-overlay.is-visible .custom-modal-content { transform: scale(1); }
.custom-modal-close {
    position: absolute; top: 10px; right: 15px; font-size: 2em;
    color: var(--muted); cursor: pointer; line-height: 1;
}
#custom-alert-title { margin: 10px 0; color: var(--txt); }
#custom-alert-message { color: var(--muted); line-height: 1.6; }
#custom-alert-ok { margin-top: 20px; width: 100%; }
#custom-alert-canvas { background: transparent; border-radius: 50%; margin-bottom: 10px; }

.checkout-form-panel form {
    text-align: center;
}
.checkout-form-panel .form-group {
    text-align: left;
}

.form-control {
    all: unset;
    box-sizing: border-box;
    width: 100%;
    padding: .8rem 1rem;
    background: var(--bg-1);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    color: var(--txt);
    font-size: 1rem;
    box-shadow: inset 0 2px 4px rgba(0,0,0,.25);
    transition: all .2s;
}

.form-control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(255, 45, 45, .25), inset 0 2px 4px rgba(0,0,0,.25);
}

.custom-modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex; justify-content: center; align-items: center;
    z-index: 200; opacity: 0; visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.custom-modal-overlay.is-visible {
    opacity: 1;
    visibility: visible;
}
.custom-modal-content {
    padding: 30px;
    width: 90%; max-width: 400px; text-align: center; position: relative;
    transform: scale(0.9); transition: transform 0.3s ease;
}
.custom-modal-overlay.is-visible .custom-modal-content {
    transform: scale(1);
}
.custom-modal-close {
    position: absolute; top: 10px; right: 15px; font-size: 2em;
    color: var(--muted); cursor: pointer; line-height: 1;
}
#custom-alert-title {
    margin: 10px 0; color: var(--txt);
}
#custom-alert-message {
    color: var(--muted); line-height: 1.6;
}
#custom-alert-ok {
    margin-top: 20px;
}
#custom-alert-canvas {
    background: transparent; border-radius: 50%; margin-bottom: 10px;
}

.custom-modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex; justify-content: center; align-items: center;
    z-index: 200; opacity: 0; visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.custom-modal-overlay.is-visible { opacity: 1; visibility: visible; }
.custom-modal-content {
    padding: 30px;
    width: 90%; max-width: 400px; text-align: center; position: relative;
    transform: scale(0.9); transition: transform 0.3s ease;
}
.custom-modal-overlay.is-visible .custom-modal-content { transform: scale(1); }
.custom-modal-close {
    position: absolute; top: 10px; right: 15px; font-size: 2em;
    color: var(--muted); cursor: pointer; line-height: 1;
}
#custom-alert-title { margin: 10px 0; color: var(--txt); }
#custom-alert-message { color: var(--muted); line-height: 1.6; }
#custom-alert-ok { margin-top: 20px; }
#custom-alert-canvas { background: transparent; border-radius: 50%; margin-bottom: 10px; }

.text-center {
    text-align: center;
}

.btn--full-width {
    display: flex;
    width: 100%;
    justify-content: center;
}

.btn--full-width.btn--neon .btn-inner {
    width: 100%;
    justify-content: center;
}

.checkout-form-panel .button-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.account-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 20px;
    align-items: flex-start;
}

.account-sidebar .side-item {
    font-size: 0.95rem;
}

.order-history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.order-card-link {
    display: block;
    transition: transform .2s;
}
.order-card-link:hover {
    transform: translateY(-3px);
}

.order-card-item {
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--glass-2);
}

.order-card-info {
    display: flex;
    flex-direction: column;
}

.order-card-title {
    font-weight: 700;
}

.order-card-date {
    font-size: 0.85rem;
    color: var(--muted);
}

.order-card-status {
    display: flex;
    align-items: center;
    gap: 16px;
}
.order-card-status span:first-child {
    font-weight: 700;
    font-size: 1.1rem;
}

.status-chip {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 99px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: capitalize;
}
.status-pending { background-color: rgba(255, 159, 10, 0.1); color: #ff9f0a; }
.status-completed { background-color: rgba(48, 209, 88, 0.1); color: #30d158; }
.status-failed { background-color: rgba(255, 69, 58, 0.1); color: #ff453a; }
.status-expired { background-color: rgba(142, 142, 147, 0.1); color: #8e8e93; }

.account-form {
    max-width: 500px;
}
.profile-avatar-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
}
.profile-avatar-preview {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--glass-border);
}

.form-message {
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 16px;
}
.form-message.error { background: rgba(255, 69, 58, 0.1); color: #ff453a; }
.form-message.success { background: rgba(48, 209, 88, 0.1); color: #30d158; }

@media (max-width: 960px) {
    .account-layout {
        grid-template-columns: 1fr;
    }
    .account-sidebar {
        position: static;
    }
}

.page-wrapper-center {
    max-width: 1000px;
    margin: 0 auto;
}

.order-details-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 16px;
    margin-bottom: 16px;
}
.order-details-header h2 { margin: 0; }
.order-code-tag {
    background-color: var(--glass-2);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 700;
}
.order-items-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.summary-item { display: flex; justify-content: space-between; align-items: center; }

.countdown-box {
    text-align: center;
    padding: 20px;
    background: var(--glass-2);
    border-radius: 12px;
    margin: 24px 0;
}
.countdown-box p { margin: 0 0 8px; color: var(--muted); }
.countdown-box h3 { margin: 0 0 16px; font-size: 2.2rem; color: var(--accent); }

.claim-header { text-align: center; margin-bottom: 24px; }
.claim-header h2 { margin: 0; }
.claim-header p { font-size: 1.1rem; color: var(--muted); margin: 8px 0 0; }
.credentials-container { display: flex; flex-direction: column; gap: 16px; }
.credential-box { padding: 16px; background: var(--bg-0); }
.credential-box h4 { margin: 0 0 16px; text-align: center; border-bottom: 1px solid var(--glass-border); padding-bottom: 12px; }
.credential-field { margin-bottom: 12px; }
.credential-field:last-child { margin-bottom: 0; }
.input-with-copy { display: flex; gap: 8px; }
.input-with-copy input { flex-grow: 1; }
.input-with-copy .btn { padding: 0 .8rem; }

.form-header { text-align: center; margin-bottom: 24px; }
.form-header h2 { margin: 0; }
.form-header p { color: var(--muted); margin: 8px 0 0; }
.form-footer-note { text-align: center; margin-top: 16px; font-size: 0.9rem; color: var(--muted); }

.page-wrapper-narrow {
    max-width: 600px;
    margin: 0 auto;
}

.order-detail-card, .claim-detail-card {
    padding: clamp(20px, 4vw, 32px);
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.order-detail-header, .claim-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 16px;
    margin-bottom: 8px;
}
.order-detail-header h2, .claim-header h2 { margin: 0; font-size: 1.5rem; }
.order-detail-header .header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}
.order-code-tag {
    background-color: var(--glass-2);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 700;
}
.status-chip {
    padding: 4px 10px;
    border-radius: 99px;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: capitalize;
}
.status-text {
    font-weight: 700;
    text-transform: capitalize;
}
.status-pending { background-color: rgba(255, 159, 10, 0.1); color: #ff9f0a; }
.status-completed { background-color: rgba(48, 209, 88, 0.1); color: #30d158; }
.status-failed { background-color: rgba(255, 69, 58, 0.1); color: #ff453a; }
.status-expired { background-color: rgba(142, 142, 147, 0.1); color: #8e8e93; }

.order-info-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px 20px;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 24px;
}
@media (min-width: 480px) {
    .order-info-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
.order-info-grid .info-item {
    display: flex;
    flex-direction: column;
    font-size: 0.9rem;
	align-items: flex-start;
}
.order-info-grid .info-item strong {
    color: var(--muted);
    font-weight: 500;
    margin-bottom: 4px;
}
.order-info-grid .info-item span {
    color: var(--txt);
    font-weight: 600;
}

.order-items-section h3 {
    margin: 0 0 16px;
    font-size: 1.2rem;
    color: var(--muted);
}
.order-items-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    background: var(--glass-2);
    padding: 10px 15px;
    border-radius: 8px;
}
.summary-item-details { flex-grow: 1; }
.summary-item .item-title { font-weight: 700; }
.summary-item .item-option { font-size: 0.85rem; color: var(--muted); }
.summary-item-price { font-weight: 700; font-size: 1rem; white-space: nowrap; }
.claim-btn {
    padding: .6rem 1rem;
    font-size: 0.85rem;
}


.expired-message {
    background-color: rgba(255, 69, 58, 0.15);
    color: #ff453a;
    padding: 16px;
    border-radius: 12px;
    text-align: center;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}
.expired-message svg { opacity: 0.8; }
.expired-message p { margin: 0; font-size: 1.1rem; font-weight: 600; }

.countdown-box {
    text-align: center;
    padding: 20px;
    background: var(--glass-2);
    border-radius: 12px;
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.countdown-box p { margin: 0 0 8px; color: var(--muted); font-size: 0.95rem; }
.countdown-box h3 { margin: 0 0 16px; font-size: 2.5rem; color: var(--accent); }
.countdown-box .btn { width: auto; }


.claim-header .product-title {
    font-size: 1.1rem;
    color: var(--muted);
    margin: 8px 0 0;
}
.credentials-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.credential-box {
    padding: clamp(16px, 3vw, 24px);
    background: var(--bg-0);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.credential-box h4 {
    margin: 0;
    text-align: center;
    font-size: 1.2rem;
    color: var(--accent);
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 12px;
    margin-bottom: 16px;
}
.credential-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.credential-field label {
    font-size: 0.9rem;
    color: var(--muted);
    font-weight: 600;
}
.input-with-copy {
    display: flex;
    gap: 8px;
}
.input-with-copy input {
    flex-grow: 1;
    font-family: 'Consolas', 'Monaco', monospace;
    background: var(--glass-2);
    border: 1px solid var(--glass-border);
    padding: .8rem 1rem;
    border-radius: 8px;
    color: var(--txt);
    font-size: clamp(0.75rem, 2.5vw, 0.95rem);
}
.input-with-copy .copy-btn {
    padding: .6rem 1rem;
    font-size: 0.85rem;
    white-space: nowrap;
}

.form-message {
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 16px;
    text-align: center;
    font-weight: 600;
}
.form-message.error { background: rgba(255, 69, 58, 0.15); color: #ff453a; }
.form-message.success { background: rgba(48, 209, 88, 0.15); color: #30d158; }

@media (max-width: 400px) {
    .order-detail-header, .claim-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .order-detail-header .header-right {
        width: 100%;
        justify-content: space-between;
    }
    .summary-item {
        flex-wrap: wrap;
    }
    .summary-item-details {
        flex-basis: 100%;
    }
    .summary-item-price {
        margin-left: auto;
    }
}

.auth-page-wrapper {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 5vh;
    min-height: 70vh;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    padding: clamp(20px, 4vw, 32px);
}

.auth-card .form-header {
    text-align: center;
    margin-bottom: 24px;
}
.auth-card .form-header h2 {
    margin: 0;
    font-size: 1.8rem;
}
.auth-card .form-header p {
    color: var(--muted);
    margin: 8px 0 0;
}
.auth-card .form-footer-note {
    text-align: center;
    margin-top: 20px;
    font-size: 0.9rem;
    color: var(--muted);
}
.auth-card .form-footer-note a {
    font-weight: 700;
    color: var(--txt);
}

.form-group.password-group {
    position: relative;
}

.password-group .forgot-password-link {
    position: absolute;
    top: 0;
    right: 0;
    line-height: 1.6;
    font-size: 0.85em;
    color: var(--muted);
    font-weight: 500;
}
.password-group .forgot-password-link:hover {
    color: var(--txt);
}

.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.password-input-wrapper .form-control {
    padding-right: 44px;
}

.password-toggle-btn {
    all: unset;
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 100%;
    width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--muted);
}
.password-toggle-btn:hover {
    color: var(--txt);
}

.auth-page-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    padding-top: 5vh;
    min-height: 70vh;
}

.auth-card-new {
    width: 100%;
    max-width: 400px;
    padding: 32px;
    border-radius: 24px;
}

.auth-header {
    text-align: center;
    margin-bottom: 24px;
}

.auth-header h1 {
    margin: 0;
    font-size: 2rem;
    font-weight: 700;
}

.auth-form .input-group {
    position: relative;
    margin-bottom: 16px;
}

.auth-form .input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    pointer-events: none;
}

.auth-form .form-control {
    padding-left: 48px;
    border-radius: 99px;
    height: 50px;
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    margin-bottom: 24px;
}

.form-options .form-action-link {
    color: var(--muted);
    font-weight: 500;
}
.form-options .form-action-link:hover {
    color: var(--txt);
}

.custom-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: var(--muted);
}
.custom-checkbox input { display: none; }
.custom-checkbox .checkmark {
    width: 16px;
    height: 16px;
    border: 2px solid var(--muted);
    border-radius: 4px;
    display: inline-block;
    transition: all .2s;
}
.custom-checkbox input:checked + .checkmark {
    background-color: var(--accent);
    border-color: var(--accent);
}

.auth-footer-link {
    text-align: center;
    margin-top: 24px;
    font-size: 0.9rem;
    color: var(--muted);
}
.auth-footer-link a {
    font-weight: 700;
    color: var(--txt);
}

.search-input-wrapper {
    position: relative;
    width: 100%;
}

.guide-list { display: flex; flex-direction: column; gap: 12px; }
.guide-list-item { display: block; padding: 16px; font-weight: 700; transition: .2s; }
.guide-list-item:hover { transform: translateX(5px); background: var(--glass); }
.guide-title { font-size: 2rem; margin-bottom: 24px; }
.guide-content { display: flex; flex-direction: column; gap: 32px; }
.guide-section h2 { font-size: 1.5rem; margin-bottom: 16px; border-bottom: 1px solid var(--glass-border); padding-bottom: 8px; }
.guide-step { margin-bottom: 24px; }
.guide-step img { max-width: 100%; border-radius: 8px; margin-bottom: 12px; }
.guide-step p { line-height: 1.8; color: var(--muted); }

.panes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
  align-items: start;
}

.pane {
  display: flex;
  flex-direction: column;
  height: fit-content;
}

.pane .poster {
  aspect-ratio: 16 / 9;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  flex-shrink: 0;
}

.pane > a, .pane .pane-content {
  display: flex;
  flex-direction: column;
}

.pane .news-nav, .pane .pane-button-wrapper {
  margin-top: auto;
  padding-top: 10px;
}

.pane h3 {
    text-align: center;
}

.pane .poster {
    border-radius: 10px;
}

.product-swiper {
    width: 100%;
    padding: 10px 0;
}

.product-swiper .swiper-slide {
    width: 220px;
    height: auto;
    display: flex;
}

.product-swiper .card {
    width: 100%;
    display: flex;
    flex-direction: column;
}

.product-swiper .card .body {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-swiper .card .meta {
    margin-top: auto;
}

.product-swiper .card .title {
    height: 2.8em;
    line-height: 1.4;
    overflow: hidden;
    
    position: relative; 
}

.product-swiper .card .title::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 100%;
    height: 1.4em;
    background: linear-gradient(to bottom, transparent, var(--glass));
}

.pagination-controls {
    display: flex;
    gap: 6px;
    margin-left: auto;
}
.pagination-controls a, .pagination-controls span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    background: var(--glass-2);
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--muted);
    text-decoration: none;
    transition: all .2s;
}
.pagination-controls a:hover {
    background: var(--glass);
    color: var(--txt);
}
.pagination-controls span.active, .pagination-controls a.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.showcase-section {
    padding: 16px;
    display: grid;
    grid-template-rows: auto 1fr;
    gap: 16px;
}

.showcase-section .section-head {
    display: flex;
    align-items: center;
    margin-bottom: 0;
}

.showcase-navigation {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

.showcase-navigation .swiper-button-prev,
.showcase-navigation .swiper-button-next {
    position: static;
    width: 36px;
    height: 36px;
    margin: 0;
    background: var(--glass-2);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    transition: background .2s;
    cursor: pointer;
}
.showcase-navigation .swiper-button-prev:hover,
.showcase-navigation .swiper-button-next:hover {
    background: var(--glass);
}
.showcase-navigation .swiper-button-prev::after,
.showcase-navigation .swiper-button-next::after {
    font-size: 14px;
    font-weight: bold;
    color: var(--txt);
}
.showcase-navigation .swiper-button-disabled {
    opacity: 0.4;
    cursor: not-allowed;
}


.showcase-swiper {
    width: 100%;
    overflow: hidden;
}

.showcase-swiper .swiper-slide {
    height: auto;
    width: 220px;
    flex-shrink: 0;
}

.showcase-swiper .card {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.showcase-swiper .card .body {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.showcase-swiper .card .meta {
    margin-top: auto;
}

.price-container {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1.2;
}

.price-regular {
    color: var(--accent);
    font-weight: 900;
    font-size: 1.1rem;
}

.price-on-sale {
    display: flex;
    flex-direction: row;
    align-items: baseline;
    gap: 8px;
}

.price-on-sale .sale-price {
    color: var(--accent);
    font-weight: 900;
    font-size: 1.1rem;
}

.price-on-sale .sale-details {
    display: flex;
    align-items: center;
    gap: 8px;
}

.price-on-sale .original-price {
    text-decoration: line-through;
    color: var(--muted);
    font-size: 0.85rem;
}

.price-on-sale .discount-badge {
    background: var(--accent);
    color: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
}

.card {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.card .body {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    padding: 12px;
}

.card-title {
    font-weight: 700;
    font-size: 1.1rem;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-grow: 1;
}

.card-price-meta {
    margin-top: 8px;
    min-height: 1.5em;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.card-tooltip {
    position: absolute;
    background-color: var(--bg-0);
    color: var(--txt);
    border: 1px solid var(--glass-border);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.9rem;
    z-index: 100;
    max-width: 300px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
    box-shadow: var(--shadow-lg);
}

.card-tooltip.visible {
    opacity: 1;
}

.price-container { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; }
.price-regular { color: var(--accent); font-weight: 900; font-size: 1.1rem; }
.price-on-sale { display: flex; flex-direction: row; align-items: flex-end; }
.price-on-sale .sale-price { color: var(--accent); font-weight: 900; font-size: 1.1rem; }
.price-on-sale .sale-details { display: flex; align-items: center; gap: 8px; }
.price-on-sale .original-price { text-decoration: line-through; color: var(--muted); font-size: 0.85rem; }
.price-on-sale .discount-badge {
    background: rgba(48, 209, 88, 0.15);
    color: #30d158;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 700;
}

.site-footer {
    padding: 48px 0 0;
    margin-top: 40px;
    border-top: 1px solid var(--glass-border);
}

.footer-main {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 32px;
    padding-bottom: 32px;
}

.footer-heading {
    font-size: 1rem;
    font-weight: 700;
    color: var(--txt);
    margin: 0 0 16px;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.footer-about-text {
    font-size: 0.9rem;
    color: var(--muted);
    line-height: 1.7;
    margin: 0;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-links a {
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s, transform 0.2s;
    display: inline-block;
}

.footer-links a:hover {
    color: var(--accent);
    transform: translateX(4px);
}

.social-links {
    display: flex;
    gap: 12px;
}

.social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--glass-2);
    color: var(--muted);
    transition: all 0.2s;
}

.social-icon:hover {
    background: var(--accent);
    color: #fff;
    transform: translateY(-3px);
}

.social-icon svg {
    width: 20px;
    height: 20px;
}

.footer-bottom-bar {
    border-top: 1px solid var(--glass-border);
    padding: 20px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.copyright {
    font-size: 0.85rem;
    color: var(--muted);
}

.payment-logos {
    display: flex;
    align-items: center;
}

@media (max-width: 768px) {
    .footer-main {
        text-align: center;
    }
    .social-links {
        justify-content: center;
    }
    .footer-bottom-bar {
        flex-direction: column;
        justify-content: center;
    }
}

input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type=number] {
  -moz-appearance: textfield;
}

.order-detail-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

@media (max-width: 960px) {
  .layout {
    grid-template-columns: 1fr;
  }
  .sidebar {
      display: none;
  }
}

@media (max-width: 768px) {
    .top-inner .username-display {
        display: none; 
    }

    .top-inner .search {
        position: absolute;
        top: 64px; 
        left: 0;
        width: 100%;
        max-width: 100%;
        padding: 10px;
        background: var(--bg-1);
        border-top: 1px solid var(--glass-border);
        border-radius: 0;
        z-index: 60;
    }

    main.layout {
        margin-top: 60px; 
    }

    .cart-grid + .section-head, .cart-grid ~ .section-head {
        justify-content: center;
    }

    .cart-item-card {
        align-items: end;
    }

    .cart-item-card .item-details {
        align-self: center;
    }
    
    .cart-item-card .item-image {
        align-self: center;
    }

    .checkout-card .box-title:first-of-type {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }

    .checkout-card .summary-item {
        display: grid;
        grid-template-columns: 48px 1fr auto;
        align-items: center;
        gap: 12px;
    }

    .checkout-card .summary-item-details .item-title {
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
    }
}

@media (max-width: 960px) {
    .layout {
        grid-template-columns: 1fr;
    }
    .sidebar {
        display: none;
    }
    .product-detail-grid {
        grid-template-columns: 1fr;
    }
    .new-gallery-layout {
        display: grid;
        grid-template-columns: 80px 1fr;
        gap: 10px;
    }
    .cart-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .thumb-slider-wrapper {
        max-width: 100%;
    }
}

.layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 20px;
}

.sidebar {
    position: sticky;
    top: 80px;
    align-self: start;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.bottom-tab-bar {
    display: none;
}

@media (max-width: 960px) {
    body {
        padding-bottom: 70px;
    }
    .layout {
        display: block;
    }
    .sidebar {
        display: none;
    }
    .bottom-tab-bar {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 60px;
        justify-content: center;
        align-items: center;
        border-top: 1px solid var(--glass-border);
        z-index: 1000;
        background: var(--glass);
        -webkit-backdrop-filter: blur(10px);
        backdrop-filter: blur(10px);
    }
    .tab-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        color: var(--muted);
        font-size: 0.7rem;
        font-weight: 600;
        gap: 4px;
        flex: 1;
        min-width: 0;
        height: 100%;
        transition: color 0.2s;
    }
    .tab-item:hover {
        color: var(--txt);
    }
    .tab-item.active {
        color: var(--accent);
    }
    .tab-item svg {
        width: 24px;
        height: 24px;
    }

    .bottom-tab-bar .tab-item span {
        width: 100%;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        text-align: center;
    }
}

.tab-item button {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    font-family: inherit;
    cursor: pointer;
}

.tab-item .avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid var(--glass-border);
    object-fit: cover;
}

.tab-item.active .avatar {
    border-color: var(--accent);
}

@media (max-width: 960px) {
    .top-inner .profile-dropdown {
        display: none; 
    }
}

.bottom-tab-bar button.tab-item {
    background-color: transparent;
    border: none;
    padding: 0;
    margin: 0;
    font-family: inherit;
    cursor: pointer;
}

@media (max-width: 960px) {
    .desktop-auth-buttons,
    .top-inner .profile-dropdown {
        display: none !important;
    }

    .top-inner .chip--points {
        display: inline-flex;
    }
}

@media (max-width: 960px) {
    .top-inner .chip--points {
        order: 1;
    }
    .top-inner .cart-icon-wrapper {
        order: 2;
    }
    .top-inner #themeToggle {
        order: 3;
    }
}

.bottom-tab-bar button.tab-item {
    background: transparent;
    border: none;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
}

@media (max-width: 768px) {
    .category-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }
}

.category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
}

.category-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    background-size: cover;
    background-position: center;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    transition: transform 0.2s;
}

.category-card:hover .category-image {
    transform: scale(1.05);
}

.category-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--muted);
    width: 100%;
    line-height: 1.4; /* 1. กำหนดความสูงของแต่ละบรรทัด */
    height: 2.8em;    /* 2. กำหนดความสูงของกล่องข้อความให้พอดี 2 บรรทัด */

    /* --- 3. ชุดคำสั่งสำหรับตัดข้อความ 2 บรรทัด --- */
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    white-space: normal; /* อนุญาตให้ข้อความขึ้นบรรทัดใหม่ได้ */
}

@media (max-width: 960px) {
    .page-product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .page-product-grid .card-title {
        height: 2.8em;
        line-height: 1.4em;

        white-space: normal;

        overflow: hidden;
        text-overflow: ellipsis;
        
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
    }
}

@media (max-width: 768px) {
    .page-product-grid .card-title {
        font-size: 0.85rem;
        height: 2.6em; 
    }

    .page-product-grid .card-subtitle {
        font-size: 0.75rem;
    }

    .category-name {
        font-size: 0.75rem;
    }

    .product-info-panel .product-title {
        font-size: 1.5rem;
    }

}

@media (max-width: 768px) {
    .order-detail-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        flex-wrap: wrap;
        gap: 10px;
    }
    .order-detail-header h2 {
        font-size: 1.3rem;
        margin: 0;
    }
    .order-detail-header .header-right {
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .order-info-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-template-areas:
            "status date"
            "email  total";
        gap: 20px;
    }
    .info-status { grid-area: status; }
    .info-date   { grid-area: date;   text-align: right; }
    .info-email  { grid-area: email; }
    .info-total  { grid-area: total;  text-align: right; }

    
    .summary-item {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
        padding: 16px;
    }
    .summary-item-row-1 {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        width: 100%;
    }
    .summary-item-price {
        white-space: nowrap;
        margin-left: 16px;
    }
    
    .summary-item-actions {
        display: flex;
        justify-content: center;
        gap: 12px;
        width: 100%;
        padding-top: 16px;
        border-top: 1px solid var(--glass-border);
    }
    .summary-item-actions .btn {
        width: auto; 
        flex-grow: 0;
    }
}

    .claim-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 8px;
    }

    .claim-header h2 {
        font-size: 1.5rem;
    }

    .claim-header .product-title {
        font-size: 1rem;
    }

    @media (max-width: 768px) {
}

.mobile-layout-only {
    display: none;
}

@media (max-width: 960px) {
    .desktop-layout-only {
        display: none;
    }
    .mobile-layout-only {
        display: block;
    }

    .mobile-layout-only {
        padding-bottom: 120px;
    }

    .mobile-pdp-gallery .swiper {
        width: 100%;
        aspect-ratio: 1 / 1;
    }
    .mobile-pdp-gallery .swiper-slide img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    .mobile-pdp-gallery .swiper-pagination-bullet-active {
        background-color: var(--accent);
    }
    
    .mobile-pdp-info {
        margin-top: -30px;
        position: relative;
        z-index: 10;
    }
    .mobile-pdp-info .product-title {
        font-size: 1.5rem;
    }
    .mobile-pdp-info .price-display {
        margin: 16px 0;
    }

    .mobile-pdp-sticky-bar {
        position: fixed;
        bottom: 60px;
        left: 0;
        right: 0;
        padding: 12px;
        z-index: 900;
        border-radius: 0;
        border-top: 1px solid var(--glass-border);
    }
    #normal-purchase-buttons-mobile {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
}

.checkout-card .payment-form-box > .box-title {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    gap: 8px;
    margin-bottom: 12px;
}

.checkout-card h3.box-title {
    text-align: center;
    width: 100%;
    margin-bottom: 12px;
}

.checkout-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

@media (min-width: 769px) {
    .payment-form-box .form-group label[for="email"] {
        display: block;
        width: 100%;
        text-align: center;
        margin-top: 24px;
        margin-bottom: 10px;
    }
    
    @media (min-width: 961px) {
    .checkout-page-wrapper {
        width: 600px;
    }
}
}

@media (max-width: 768px) {
    .payment-form-box .form-group label[for="email"] {
        display: block;
        width: 100%;
        text-align: center;
        margin-top: 24px;
        margin-bottom: 10px;
    }
}

@media (max-width: 768px) {

    .cart-item-card {
        display: grid;
        grid-template-columns: 70px 1fr auto;
        grid-template-rows: auto auto;
        gap: 0 12px;
        align-items: center;
    }

    .item-image {
        grid-column: 1;
        grid-row: 1 / 3;
    }
    .item-details {
        grid-column: 2;
        grid-row: 1;
        min-width: 0;
    }
    .item-quantity {
        grid-column: 2;
        grid-row: 2;
    }
    .item-actions {
        grid-column: 3;
        grid-row: 1;
        justify-self: end;
    }
    .item-subtotal {
        grid-column: 3;
        grid-row: 2;
        justify-self: end;
        font-weight: 700;
        color: var(--accent);
    }

    .cart-item-card .item-title,
    .cart-item-card .item-option,
    .cart-item-card .item-quantity {
        display: block;
    }
    
    .cart-item-card .item-title {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        font-weight: 700;
    }
    
    .cart-item-card .item-option,
    .cart-item-card .item-quantity {
        font-size: 0.85rem;
        color: var(--muted);
    }
}

@media (min-width: 769px) {
    .cart-item-card .item-title {
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        
        white-space: normal;
        line-height: 1.4;
        max-height: 2.8em;
    }
}

.product-info-panel .price-display {
    margin: 24px 0;
    font-size: 1.6rem;
    font-weight: 900;
    color: var(--txt);
}

/* ===== PRODUCT DETAIL PAGE - STICKY BAR & NAV HIDING (FINAL FIX) ===== */

/* --- ค่าเริ่มต้นบน Desktop: ซ่อนแถบเมนูพิเศษไว้ก่อน --- */
.pdp-sticky-bar {
    display: none;
}

/* ===== PRODUCT DETAIL PAGE - RESPONSIVE TITLE FONT SIZES ===== */

/* --- สำหรับ Desktop (หน้าจอใหญ่กว่า 960px) --- */
@media (min-width: 961px) {
    .product-info-panel .product-title {
        font-size: 1.2rem; /* << ขนาดสำหรับ Desktop */
    }
}

/* --- กำหนดสไตล์ทั้งหมดสำหรับ Mobile เท่านั้น --- */
@media (max-width: 960px) {

    /* 1. เมื่ออยู่ในหน้าที่มีป้าย 'page-is-pdp' ให้ "ซ่อน" Navigator Bar เดิม */
    body.page-is-pdp .bottom-tab-bar {
        display: none;
    }

    /* 2. เมื่ออยู่ในหน้าที่มีป้าย 'page-is-pdp' ให้ "แสดง" แถบเมนูพิเศษ */
    body.page-is-pdp .pdp-sticky-bar {
        display: flex;
        flex-direction: column; /* จัดเรียงเป็น 2 แถว บน-ล่าง */
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 1000;
        padding: 8px;
        gap: 8px;
        background: var(--glass);
        -webkit-backdrop-filter: blur(10px);
        backdrop-filter: blur(10px);
        border-top: 1px solid var(--glass-border);
    }
    .pdp-price-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0 4px 8px 4px;
        border-bottom: 1px solid var(--glass-border); /* เส้นแบ่ง */
    }
    .pdp-price-label { font-size: 0.9rem; color: var(--muted); }
    .pdp-price-value { font-size: 1.2rem; font-weight: 700; color: var(--txt); }

    .pdp-button-row {
        display: flex;
        align-items: stretch;
        gap: 8px;
        height: 44px;
        padding-top: 8px;
    }

    /* สไตล์อื่นๆ ของปุ่มในแถบเมนูพิเศษ (เหมือนเดิม) */
    .pdp-support-btn {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        flex-basis: 60px;
        flex-shrink: 0;
        border: 0px solid var(--glass-border);
        border-radius: 8px;
        color: var(--muted);
        font-size: 0.7rem;
    }
    .pdp-support-btn:hover {
        background-color: var(--glass-2);
        color: var(--txt);
    }
    .pdp-normal-actions, .pdp-contact-action {
        flex-grow: 1;
        display: grid;
        gap: 8px;
    }
    .pdp-normal-actions {
        grid-template-columns: 1fr 1fr;
    }
    .pdp-normal-actions .btn, .pdp-contact-action .btn {
        width: 100%;
        height: 100%;
        padding: 0 10px;
        font-size: 0.85rem;
    }
    .pdp-contact-action .btn {
        font-size: 1rem;
    }
    .pdp-support-btn svg {
        width: 20px;
        height: 20px;
    }
    
    /* ===== PRODUCT DETAIL PAGE - MOBILE LAYOUT CLEANUP ===== */ 
    
    /* 1. ซ่อนราคาเก่า (ที่อยู่ในส่วนเนื้อหาหลัก) */ 
    .product-info-panel .price-display { 
        display: none; 
    } 

    /* 2. ขยับชื่อสินค้าให้เข้าใกล้เส้นแบ่งด้านบนมากขึ้น */ 
    .product-info-panel { 
        padding-top: 16px; /* ลดช่องว่างโดยรวมเหนือ Panel */ 
    } 
    /* --- สำหรับ Mobile (หน้าจอเล็กกว่า 960px) --- */
    .product-info-panel .product-title {
        font-size: 1.1rem; /* << ขนาดสำหรับ Mobile */
    }

    /* --- โค้ดส่วนอื่นๆ ที่จำเป็นยังคงอยู่เหมือนเดิม --- */ 
    .product-info-panel::before { 
        content: ''; display: block; width: 80%; height: 1px; 
        background: linear-gradient(to right, transparent, var(--glass-border), transparent); 
        margin: 0 auto 28px auto; 
    } 
    .product-info-panel .action-buttons { 
        display: none; 
    }
    
    
}

/* ===== GLOBAL PRICE COLOR FIX ===== */
/* --- ทำให้ราคาทั่วไปเป็นสีข้อความหลัก (ขาว/ดำ) --- */

/* 1. ราคาในการ์ดสินค้า (หน้าแรก, หน้าสินค้าทั้งหมด, หน้าหมวดหมู่) */
.price-regular {
    color: var(--txt);
}

/* 2. ราคารวมในหน้าตะกร้าสินค้า (สำหรับ Mobile) */
@media (max-width: 768px) {
    .cart-item-card .item-subtotal {
        color: var(--txt);
    }
}

/* 3. ยอดรวม (Total) ในหน้าชำระเงิน */
.order-total-box strong {
    color: var(--txt);
}

/* ===== HOMEPAGE - HERO CONTENT CENTER ON MOBILE ===== */
@media (max-width: 960px) {
    .hero .in > div:first-child {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
}

/* สำหรับปุ่ม "สินค้าหมด" */
.out-of-stock-button {
    width: 100%; /* ทำให้ปุ่มเต็มความกว้าง */
    padding: 10px;
    background-color: #6c757d; /* สีเทา */
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1.1em;
    cursor: not-allowed;
    margin-top: 15px; /* เพิ่มระยะห่างด้านบน */
}

/* เพิ่ม responsive เพื่อซ่อนปุ่มเดิมบนมือถือหากยังจำเป็น */
/* (อันนี้อาจจะไม่จำเป็นหากแก้ไข PHP ข้างบนแล้ว) */
@media (max-width: 768px) { /* หรือขนาด breakpoint ของมือถือของคุณ */
    .product-actions-mobile-wrapper .add-to-cart-button,
    .product-actions-mobile-wrapper .buy-now-button,
    .product-actions-mobile-wrapper .check-delivery-button {
        display: none !important;
    }
}

/* ===== ORDER DETAILS PAGE - DESKTOP ITEM LIST STYLE ===== */

@media (min-width: 769px) {
  /* กำหนดให้แต่ละรายการสินค้าเป็น Flexbox */
  .order-items-section .summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
  }

  /* จัดการกลุ่มของปุ่มกด */
  .order-items-section .summary-item-actions {
    display: flex;
    align-items: center;
    gap: 12px; /* << ระยะห่างระหว่างปุ่ม */
    flex-shrink: 0; /* ป้องกันปุ่มถูกบีบ */
  }

  /* จัดการกลุ่มของชื่อและรายละเอียดสินค้า */
  .order-items-section .summary-item-details {
    flex-grow: 1; /* ทำให้ส่วนนี้ยืดเพื่อดันปุ่มไปทางขวา */
    min-width: 0; /* สำหรับ Flexbox Truncation */
  }

  /* ตัดข้อความชื่อสินค้าให้เหลือ 2 บรรทัด */
  .order-items-section .item-title {
    font-weight: 700;
    line-height: 1.4;
    max-height: 2.8em; /* ความสูงสำหรับ 2 บรรทัด (1.4 * 2) */
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }
}

/* ===== LOADER SPINNER KEYFRAMES ===== */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}