/* SSN Authentic Design Theme for หจก.แสงสร้างงาน (saengsangngan-web10) */
@import url('https://fonts.googleapis.com/css2?family=Anuphan:wght@300;400;500;600;700;800&family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --font-sans: 'Anuphan', sans-serif;
  --font-mono: 'Inter', monospace;
  --srs-blue: #016BB9;
  --srs-blue-hover: #005696;
  --srs-blue-dark: #003e6d;
  --srs-blue-light: #E5F0F8;
  --srs-blue-subtle: #F1F6FA;
  --srs-red: #C4021A;
  --srs-amber: #F59E0B;
  --srs-dark: #343434;
  --srs-gray-circle: #F3F4F6;
  --srs-border: #E5E7EB;
}

* {
  font-family: 'Anuphan', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
  box-sizing: border-box;
}

.font-num {
  font-family: 'Inter', 'Anuphan', sans-serif !important;
}

body {
  font-family: 'Anuphan', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
  color: #343434;
  background-color: #ffffff;
  -webkit-font-smoothing: antialiased;
}

/* Smooth Scrolling with Sticky Header Offset */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 145px;
}

@media (max-width: 1024px) {
  html {
    scroll-padding-top: 135px;
  }
}

/* Offset for direct section anchors */
.scroll-section,
#home,
#brands-section,
#products-showcase,
#calculator-section,
#contact {
  scroll-margin-top: 145px;
}

@media (max-width: 1024px) {
  .scroll-section,
  #home,
  #brands-section,
  #products-showcase,
  #calculator-section,
  #contact {
    scroll-margin-top: 135px;
  }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #016BB9;
}

.scrollbar-none::-webkit-scrollbar {
  display: none;
}
.scrollbar-none {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Text Truncation */
.line-clamp-1 {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* SSN Top Header */
.srs-header {
  background-color: #ffffff;
  border-bottom: 1px solid #f1f5f9;
}

/* Search Pill */
.srs-search-input {
  border: 1px solid #d1d5db;
  border-radius: 9999px;
  padding-left: 1.25rem;
  padding-right: 4.5rem;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  font-size: 16px;
  outline: none;
  background-color: #ffffff;
  transition: all 0.2s ease;
}
.srs-search-input:focus {
  border-color: #016BB9;
  box-shadow: 0 0 0 2px rgba(1, 107, 185, 0.15);
}

.srs-search-btn {
  background-color: #016BB9;
  color: #ffffff;
  border-radius: 9999px;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease;
}
.srs-search-btn:hover {
  background-color: #005696;
}


/* Solid Blue Sub-Navigation Bar (#016BB9) & Smart Mega Menu */
.srs-subnav {
  background-color: #016BB9;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  position: relative;
}
.srs-subnav-item {
  color: #ffffff;
  padding: 0.65rem 1.15rem;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  border-right: 1px solid rgba(255, 255, 255, 0.18);
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  user-select: none;
  cursor: pointer;
}
.srs-subnav-item:first-child {
  color: #ffffff;
  font-weight: 700;
  background-color: rgba(255, 255, 255, 0.12);
}
.srs-subnav-item:last-child {
  border-right: none;
}
.srs-subnav-item:hover,
.srs-subnav-item.is-active {
  background-color: rgba(255, 255, 255, 0.22);
  color: #ffffff;
}
.srs-subnav-item.is-active .chevron-icon {
  transform: rotate(180deg);
}
.srs-subnav-item .chevron-icon {
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Mega Menu Dropdown Panel (Style 1: Solid Clean White 100% - No Glass, No Blur) */
#ssn-mega-menu-wrapper {
  background-color: #ffffff !important;
  background: #ffffff !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border-bottom: 1px solid #e2e8f0;
  transition: opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1), transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.22s;
  will-change: opacity, transform, visibility;
  box-shadow: 0 20px 45px -10px rgba(15, 23, 42, 0.18), 0 4px 12px -2px rgba(15, 23, 42, 0.06);
}
#ssn-mega-menu-wrapper.is-open {
  opacity: 1 !important;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}
#ssn-mega-menu-backdrop {
  background-color: rgba(15, 23, 42, 0.45) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  transition: opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.22s;
}
#ssn-mega-menu-backdrop.is-open {
  opacity: 1 !important;
  visibility: visible;
  pointer-events: auto;
}

/* Mega Menu Header & Layout */
.ssn-mega-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid #e2e8f0;
}
.ssn-mega-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.01em;
}
.ssn-mega-desc {
  font-size: 0.82rem;
  color: #475569;
  margin-top: 0.2rem;
}
.ssn-mega-close-btn {
  padding: 0.4rem;
  border-radius: 9999px;
  color: #94a3b8;
  transition: all 0.15s ease;
  cursor: pointer;
}
.ssn-mega-close-btn:hover {
  background-color: #f1f5f9;
  color: #334155;
}

/* Mega Menu Column & Links */
.ssn-mega-column {
  display: flex;
  flex-direction: column;
}
.ssn-mega-col-header {
  margin-bottom: 0.75rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid #e2e8f0;
}
.ssn-mega-col-title {
  display: inline-block;
  font-size: 0.88rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.01em;
  border-bottom: 2px solid #016BB9;
  padding-bottom: 0.45rem;
  margin-bottom: -1px;
}
.ssn-mega-clean-link {
  width: 100%;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0.65rem;
  margin-left: -0.65rem;
  margin-right: -0.65rem;
  border-radius: 0.5rem;
  font-size: 0.84rem;
  font-weight: 500;
  color: #1e293b;
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  text-decoration: none;
}
.ssn-mega-clean-link .link-bullet {
  width: 5px;
  height: 5px;
  border-radius: 9999px;
  background-color: #cbd5e1;
  margin-right: 0.6rem;
  shrink: 0;
  transition: all 0.15s ease;
}
.ssn-mega-clean-link .link-label {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ssn-mega-clean-link .link-arrow {
  color: #016BB9;
  font-size: 0.9rem;
  font-weight: 700;
  opacity: 0;
  transform: translateX(-4px);
  transition: all 0.15s ease;
}
.ssn-mega-clean-link:hover {
  background-color: #f0f7fc;
  color: #016BB9;
}
.ssn-mega-clean-link:hover .link-bullet {
  background-color: #016BB9;
  transform: scale(1.3);
}
.ssn-mega-clean-link:hover .link-arrow {
  opacity: 1;
  transform: translateX(0);
}

/* Mega Menu Footer & Brand Pills */
.ssn-mega-footer {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid #e2e8f0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.ssn-mega-brand-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.75rem;
  border-radius: 0.5rem;
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  font-size: 0.78rem;
  font-weight: 600;
  color: #334155;
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
}
.ssn-mega-brand-pill:hover {
  border-color: #016BB9;
  color: #016BB9;
  background-color: #f8fafc;
  box-shadow: 0 2px 6px -1px rgba(1, 107, 185, 0.12);
}
.ssn-mega-all-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: #016BB9;
  transition: all 0.15s ease;
  cursor: pointer;
}
.ssn-mega-all-link:hover {
  color: #005696;
  text-decoration: underline;
}

/* SSN Circular Category Showcase - Full-Bleed Profile Style (FB / LINE) */
.srs-circle-wrap {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background-color: #ffffff;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 2px solid #E2E8F0;
  box-shadow: 0 2px 6px -1px rgba(0, 0, 0, 0.06);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  margin-left: auto;
  margin-right: auto;
  position: relative;
}
@media (min-width: 390px) {
  .srs-circle-wrap {
    width: 72px;
    height: 72px;
  }
}
@media (min-width: 640px) {
  .srs-circle-wrap {
    width: 105px;
    height: 105px;
    border-width: 3px;
  }
}
@media (min-width: 1024px) {
  .srs-circle-wrap {
    width: 115px;
    height: 115px;
  }
}
.srs-circle-wrap img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center !important;
  display: block;
  border-radius: 50%;
  transition: transform 0.35s ease;
}
.srs-circle-item:hover .srs-circle-wrap {
  transform: translateY(-4px) scale(1.05);
  border-color: #016BB9;
  box-shadow: 0 10px 20px -4px rgba(1, 107, 185, 0.28);
}
.srs-circle-item:hover .srs-circle-wrap img {
  transform: scale(1.08);
}

/* SSN Brand Card */
.srs-brand-card {
  background: #ffffff;
  border: 1px solid #E5E7EB;
  border-radius: 0.65rem;
  padding: 0.5rem 0.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  transition: all 0.2s ease;
}
@media (min-width: 640px) {
  .srs-brand-card {
    border-radius: 0.75rem;
    padding: 1rem 1.25rem;
    min-height: 80px;
  }
}
.srs-brand-card:hover {
  border-color: #016BB9;
  box-shadow: 0 4px 12px rgba(1, 107, 185, 0.1);
  transform: translateY(-2px);
}

/* SSN Product Card */
.srs-product-card {
  background: #ffffff;
  border: 1px solid #E5E7EB;
  border-radius: 0.75rem;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}
.srs-product-card:hover {
  border-color: #016BB9;
  box-shadow: 0 4px 12px -2px rgba(1, 107, 185, 0.1);
  transform: translateY(-2px);
}

/* Ensure product grid rows never stretch vertically on single-row or last pages */
#new-products-grid,
[id^="category-row-"] {
  align-content: start;
  align-items: start;
  grid-auto-rows: max-content;
}

.srs-product-img-box {
  position: relative;
  width: 100%;
  padding-top: 100%; /* 1:1 Aspect ratio */
  background: #ffffff;
  border-radius: 0.5rem;
  overflow: hidden;
}
.srs-product-img-box img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 0.5rem;
  transition: transform 0.3s ease;
}
.srs-product-card:hover .srs-product-img-box img {
  transform: scale(1.05);
}

/* Badges on SSN Product Card */
.srs-badge-new {
  position: absolute;
  bottom: 0.5rem;
  left: 0.5rem;
  width: auto;
  min-width: 1.85rem;
  max-width: calc(100% - 3.2rem);
  height: auto;
  min-height: 1.85rem;
  padding: 0.2rem 0.55rem;
  border-radius: 9999px;
  background-color: #F59E0B;
  color: #0f172a;
  font-size: 0.65rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  white-space: nowrap;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
  z-index: 10;
  line-height: 1.15;
  letter-spacing: -0.01em;
  pointer-events: none;
}

.srs-btn-plus {
  position: absolute;
  bottom: 0.5rem;
  right: 0.5rem;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background-color: #016BB9;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  font-weight: 700;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(1, 107, 185, 0.3);
  z-index: 10;
  cursor: pointer;
}
.srs-btn-plus:hover {
  background-color: #005696;
  transform: scale(1.1);
}

/* Category Blue Feature Banner (Left Banner in Featured Category Rows) */
.srs-category-feature-banner {
  background: linear-gradient(145deg, #016BB9, #004b82);
  border-radius: 0.85rem;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  text-align: center;
  padding: 1.5rem 1rem;
  min-height: 320px;
  box-shadow: 0 6px 16px -2px rgba(1, 107, 185, 0.25);
}

/* Pagination Dots */
.srs-dot-active {
  width: 32px;
  height: 6px;
  border-radius: 9999px;
  background-color: #016BB9;
}
.srs-dot-inactive {
  width: 8px;
  height: 6px;
  border-radius: 9999px;
  background-color: #E5E7EB;
  transition: all 0.2s ease;
}
.srs-dot-inactive:hover {
  background-color: #cbd5e1;
}

/* Quotation Print Styles (1-Page Perfect Fit) */
@media print {
  /* 1. Global Reset */
  html, body {
    background: #ffffff !important;
    color: #0f172a !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* 2. Hide ALL direct children of body to prevent multi-page website spillover */
  body > * {
    display: none !important;
  }

  /* 3. Show ONLY active quotation modal directly at page top */
  body > #quotation-modal:not(.hidden) {
    display: block !important;
    position: static !important;
    inset: auto !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
  }

  /* 4. Flatten modal wrapper card */
  body > #quotation-modal:not(.hidden) > div {
    display: block !important;
    position: static !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    box-shadow: none !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    background: #ffffff !important;
  }

  /* 5. Document Area Formatting */
  #printable-quotation {
    display: block !important;
    position: static !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 6mm 8mm !important;
    box-sizing: border-box !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: #ffffff !important;
    page-break-after: avoid !important;
    break-after: avoid !important;
  }

  /* 6. Hide web chrome, action buttons, delete buttons */
  .print\:hidden,
  #quotation-modal button,
  #quotation-modal .print\:hidden {
    display: none !important;
  }

  /* 7. Input fields styling for print */
  #quote-cust-name,
  #quote-cust-phone {
    border: none !important;
    border-bottom: 1px dashed #94a3b8 !important;
    border-radius: 0 !important;
    padding: 2px 0 !important;
    font-size: 11px !important;
    box-shadow: none !important;
    background: transparent !important;
  }

  /* 8. Spacing tuning for perfect 1-page fit */
  #printable-quotation.space-y-6 > :not([hidden]) ~ :not([hidden]) {
    margin-top: 1rem !important;
  }

  #printable-quotation .pt-6 {
    padding-top: 1rem !important;
  }

  /* 9. Crisp table rendering */
  table {
    width: 100% !important;
    border-collapse: collapse !important;
  }

  th, td {
    border-color: #cbd5e1 !important;
  }

  tr {
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  @page {
    size: A4 portrait;
    margin: 8mm 8mm;
  }
}
