/* Custom component classes for C9 SBuyZone */

body {
  -webkit-tap-highlight-color: transparent;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

a {
  color: #db2777;
}

.site-logo-link {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  flex-shrink: 0;
}

.site-logo-image {
  display: block;
  width: auto;
  height: 2.5rem;
  max-width: min(8.25rem, 38vw);
  object-fit: contain;
}

.site-logo-image--menu {
  height: 3rem;
  max-width: 9.5rem;
}

.site-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1;
  white-space: nowrap;
}

.site-brand-text--menu {
  gap: 0.125rem;
}

.site-brand-title {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #be185d;
}

.site-brand-subtitle {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6b7280;
}

@media (min-width: 768px) {
  .site-logo-image {
    height: 2.75rem;
    max-width: 9.5rem;
  }

  .site-brand-title {
    font-size: 1.1rem;
  }

  .site-brand-subtitle {
    font-size: 0.76rem;
  }
}

/* Buttons */
.btn,
.btn-primary,
.btn-secondary,
.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 0.625rem 1rem;
  border-radius: 0.5rem;
  font-weight: 500;
  font-size: 0.875rem;
  line-height: 1.25rem;
  transition: all 0.2s ease;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  white-space: nowrap;
}

.btn:focus,
.btn-primary:focus,
.btn-secondary:focus,
.btn-outline:focus {
  outline: none;
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px #ec4899;
}

.btn-primary {
  background: linear-gradient(180deg, #ec4899, #db2777);
  color: #fff;
  box-shadow: 0 10px 24px rgba(219, 39, 119, 0.18);
}

.btn-primary:hover {
  background: linear-gradient(180deg, #db2777, #be185d);
}

.btn-secondary {
  background: #f3f4f6;
  color: #374151;
  border-color: #e5e7eb;
}

.btn-secondary:hover {
  background: #e5e7eb;
}

.btn-outline {
  background: #fff;
  color: #db2777;
  border-color: #f9a8d4;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.btn-outline:hover {
  background: #fdf2f8;
}

.input {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 0.625rem 0.875rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: #111827;
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input:focus {
  outline: none;
  border-color: #ec4899;
  box-shadow: 0 0 0 3px rgba(236, 72, 153, 0.16);
}

input[type="file"].input {
  padding: 0.35rem 0.5rem;
}

input[type="file"].input::file-selector-button {
  margin-right: 0.75rem;
  padding: 0.45rem 0.75rem;
  border: 1px solid #f9a8d4;
  border-radius: 0.5rem;
  background: #fdf2f8;
  color: #be185d;
  cursor: pointer;
}

input[type="file"].input::file-selector-button:hover {
  background: #fce7f3;
}

.label {
  display: block;
  margin-bottom: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
}

.card {
  background: #fff;
  border: 1px solid #f1f5f9;
  border-radius: 1rem;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
  overflow: hidden;
}

.thai-address-autocomplete .twitter-typeahead {
  width: 100%;
}

.thai-address-autocomplete .tt-menu {
  width: 100%;
  margin-top: 0.375rem;
  padding: 0.375rem 0;
  background: #fff;
  border: 1px solid #fbcfe8;
  border-radius: 0.75rem;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.14);
  max-height: 16rem;
  overflow-y: auto;
  z-index: 80;
}

.thai-address-autocomplete .tt-suggestion {
  padding: 0.625rem 0.875rem;
  font-size: 0.875rem;
  line-height: 1.4;
  cursor: pointer;
}

.thai-address-autocomplete .tt-suggestion.tt-cursor,
.thai-address-autocomplete .tt-suggestion:hover {
  background: #fdf2f8;
}

/* Badges */
.badge {
  display: inline-flex; align-items: center;
  padding: 0.125rem 0.5rem; border-radius: 9999px;
  font-size: 0.75rem; font-weight: 500;
}
.badge-success { background: #dcfce7; color: #166534; }
.badge-warning { background: #fef9c3; color: #854d0e; }
.badge-danger  { background: #fee2e2; color: #991b1b; }
.badge-info    { background: #dbeafe; color: #1e40af; }
.badge-primary { background: #fce7f3; color: #9d174d; }
.badge-promo   { background: #fce7f3; color: #9d174d; }

/* Gallery */
.gallery-scroll {
  display: flex; overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.gallery-scroll::-webkit-scrollbar { display: none; }
.gallery-scroll > * {
  scroll-snap-align: center;
  flex-shrink: 0; width: 100%;
}

.home-carousel-section {
  margin-top: 0.25rem;
}

.home-carousel-frame {
  position: relative;
  aspect-ratio: 18 / 7;
}

.home-carousel-track {
  scroll-behavior: smooth;
  height: 100%;
}

.home-carousel-slide {
  width: 100%;
  height: 100%;
}

.home-carousel-card {
  position: relative;
  display: block;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.home-carousel-media-layer {
  position: absolute;
  inset: 0;
}

.home-carousel-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  transform: scale(1.04);
  transition: transform 0.45s ease, filter 0.3s ease;
  filter: saturate(1.03) contrast(1.02);
}

.home-carousel-media--placeholder {
  object-fit: contain;
  padding: 1rem;
  background: linear-gradient(135deg, #fde7f3 0%, #fff4f8 100%);
}

.home-carousel-media-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, rgba(255, 255, 255, 0.08), rgba(17, 24, 39, 0.08));
}

.home-carousel-media-overlay--placeholder {
  background: linear-gradient(120deg, rgba(190, 24, 93, 0.14), rgba(17, 24, 39, 0.04));
}

.home-carousel-card:hover .home-carousel-media,
.home-carousel-card:focus-visible .home-carousel-media {
  transform: scale(1.07);
}

.home-carousel-content {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 1rem 1rem 3rem;
}

.home-carousel-badge {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.18);
  padding: 0.25rem 0.625rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  backdrop-filter: blur(10px);
}

.home-carousel-title {
  max-width: 32rem;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.35;
  color: #fff;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.home-carousel-summary {
  max-width: 30rem;
  font-size: 0.86rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.9);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.home-carousel-cta {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 0.35rem;
  border-radius: 9999px;
  background: #fff;
  color: #9d174d;
  padding: 0.5rem 0.875rem;
  font-size: 0.8rem;
  font-weight: 700;
  box-shadow: 0 8px 22px rgba(17, 24, 39, 0.14);
}

.home-carousel-controls {
  position: absolute;
  left: 50%;
  bottom: 0.875rem;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
}

.home-carousel-dots {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border-radius: 9999px;
  background: rgba(17, 24, 39, 0.2);
  padding: 0.35rem 0.5rem;
  backdrop-filter: blur(10px);
}

.home-carousel-dot,
.home-carousel-nav {
  border: 0;
  cursor: pointer;
}

.home-carousel-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.46);
  transition: transform 0.2s ease, background 0.2s ease;
}

.home-carousel-dot.is-active {
  background: #fff;
  transform: scale(1.15);
}

.home-carousel-nav {
  display: inline-flex;
  width: 2rem;
  height: 2rem;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.92);
  color: #9d174d;
  box-shadow: 0 8px 22px rgba(17, 24, 39, 0.14);
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
}

.home-carousel-nav--prev {
  left: 0.875rem;
}

.home-carousel-nav--next {
  right: 0.875rem;
}

.home-carousel-nav:hover,
.home-carousel-dot:hover {
  opacity: 0.96;
}

@media (max-width: 767px) {
  .home-carousel-media {
    object-fit: cover;
    object-position: center center;
    transform: scale(1.02);
  }

  .home-carousel-card:hover .home-carousel-media,
  .home-carousel-card:focus-visible .home-carousel-media {
    transform: scale(1.04);
  }

  .home-carousel-media-overlay {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(17, 24, 39, 0.03));
  }

  .home-carousel-nav--prev {
    left: 0.5rem;
  }

  .home-carousel-nav--next {
    right: 0.5rem;
  }
}

@media (min-width: 768px) {
  .home-carousel-nav {
    width: 2.4rem;
    height: 2.4rem;
  }
}

.content-page-body {
  font-size: 0.96rem;
  line-height: 1.9;
}

.content-page-body > :first-child {
  margin-top: 0;
}

.content-page-body > :last-child {
  margin-bottom: 0;
}

.content-page-body h1,
.content-page-body h2,
.content-page-body h3,
.content-page-body h4 {
  color: #111827;
  font-weight: 700;
  line-height: 1.4;
  margin: 1.5rem 0 0.75rem;
}

.content-page-body h1 { font-size: 1.8rem; }
.content-page-body h2 { font-size: 1.45rem; }
.content-page-body h3 { font-size: 1.2rem; }
.content-page-body h4 { font-size: 1.05rem; }

.content-page-body p,
.content-page-body ul,
.content-page-body ol,
.content-page-body blockquote,
.content-page-body pre {
  margin: 0 0 1rem;
}

.content-page-body ul,
.content-page-body ol {
  padding-left: 1.35rem;
}

.content-page-body ul {
  list-style: disc;
}

.content-page-body ol {
  list-style: decimal;
}

.content-page-body a {
  color: #be185d;
  text-decoration: underline;
  text-underline-offset: 0.18rem;
}

.content-page-body blockquote {
  border-left: 4px solid #f9a8d4;
  background: #fdf2f8;
  color: #4b5563;
  border-radius: 0.75rem;
  padding: 0.9rem 1rem;
}

.content-page-body pre,
.content-page-body code {
  font-family: Consolas, Monaco, 'Courier New', monospace;
}

.content-page-body pre {
  overflow-x: auto;
  background: #111827;
  color: #f9fafb;
  border-radius: 0.9rem;
  padding: 1rem;
}

.content-page-body :not(pre) > code {
  background: #f3f4f6;
  color: #be185d;
  border-radius: 0.35rem;
  padding: 0.1rem 0.35rem;
}

/* Bottom nav safe area */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: #fff; border-top: 1px solid #e5e7eb; z-index: 50;
  padding-bottom: env(safe-area-inset-bottom);
}

/* Quantity buttons */
.qty-btn {
  width: 2rem; height: 2rem;
  display: flex; align-items: center; justify-content: center;
  border-radius: 9999px; background: #f3f4f6; color: #374151;
  cursor: pointer; transition: background 0.15s; border: none;
}
.qty-btn:hover { background: #e5e7eb; }

/* Toast notification */
.toast {
  position: fixed; bottom: 5rem; left: 50%; transform: translateX(-50%);
  background: #1f2937; color: #fff; padding: 0.75rem 1.5rem;
  border-radius: 0.5rem; font-size: 0.875rem; z-index: 100;
  animation: toast-in 0.3s ease;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(1rem); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}
