/* SRSound 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;
}

/* SRSound 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: 3.5rem;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  font-size: 0.875rem;
  outline: none;
  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;
}

/* SRSound Category Sub-Nav */
.srs-subnav {
  background-color: #016BB9;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}
.srs-subnav-item {
  color: #ffffff;
  padding: 0.55rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  border-right: 1px solid rgba(255, 255, 255, 0.25);
  transition: background-color 0.15s ease;
  display: inline-flex;
  align-items: center;
}
.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 {
  background-color: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

/* SRSound Circular Category Showcase - Full-Bleed Profile Style (FB / LINE) */
.srs-circle-wrap {
  width: 90px;
  height: 90px;
  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;
}
.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;
}
@media (min-width: 640px) {
  .srs-circle-wrap {
    width: 105px;
    height: 105px;
    padding: 0;
  }
}
@media (min-width: 1024px) {
  .srs-circle-wrap {
    width: 115px;
    height: 115px;
    padding: 0;
  }
}
.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);
}

/* SRSound Brand Card */
.srs-brand-card {
  background: #ffffff;
  border: 1px solid #E5E7EB;
  border-radius: 0.75rem;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80px;
  transition: all 0.2s ease;
}
.srs-brand-card:hover {
  border-color: #016BB9;
  box-shadow: 0 4px 12px rgba(1, 107, 185, 0.1);
  transform: translateY(-2px);
}

/* SRSound 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;
  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);
}

.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 SRSound 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;
  }
}
