/* ==========================================================================
   NextPo Medical - Premium CSS Design System
   ========================================================================== */

/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Sarabun:wght@300;400;500;600;700&display=swap');

:root {
  /* HSL Colors */
  --primary-h: 215;
  --primary-s: 68%;
  --primary-l: 15%;
  --primary: hsl(var(--primary-h), var(--primary-s), var(--primary-l));
  --primary-dark: hsl(var(--primary-h), var(--primary-s), 10%);
  --primary-light: hsl(205, 100%, 36%);
  --primary-tint: hsl(var(--primary-h), 40%, 94%);
  
  --secondary-h: 208;
  --secondary-s: 36%;
  --secondary-l: 45%;
  --secondary: hsl(var(--secondary-h), var(--secondary-s), var(--secondary-l));
  --secondary-dark: hsl(var(--secondary-h), var(--secondary-s), 35%);
  --secondary-tint: hsl(var(--secondary-h), 30%, 93%);
  
  --accent-h: 85;
  --accent-s: 55%;
  --accent-l: 51%;
  --accent: hsl(var(--accent-h), var(--accent-s), var(--accent-l));
  --accent-tint: hsl(var(--accent-h), 50%, 94%);
  
  --warning-h: 36;
  --warning-s: 100%;
  --warning-l: 45%;
  --warning: hsl(var(--warning-h), var(--warning-s), var(--warning-l));
  --warning-tint: hsl(var(--warning-h), 100%, 95%);
  
  --dark-h: 215;
  --dark-s: 28%;
  --dark-l: 17%;
  --dark: hsl(var(--dark-h), var(--dark-s), var(--dark-l));
  
  --light-h: 210;
  --light-s: 20%;
  --light-l: 97%;
  --light: hsl(var(--light-h), var(--light-s), var(--light-l));
  --light-darker: hsl(var(--light-h), var(--light-s), 90%);
  
  --white: #ffffff;
  --muted: hsl(0, 0%, 46%);
  --border: hsl(215, 15%, 88%);
  
  /* Fonts */
  --font-en: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-th: 'Sarabun', sans-serif;
  
  /* Layout & Shadows */
  --radius-sm: 6px;
  --radius: 12px;
  --radius-lg: 20px;
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.02);
  --shadow: 0 10px 30px rgba(18, 38, 63, 0.06);
  --shadow-lg: 0 20px 40px rgba(18, 38, 63, 0.12);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --container-width: 1200px;
}

/* Reset and Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-th);
  color: var(--dark);
  background-color: var(--light);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6, .font-en {
  font-family: var(--font-en);
  font-weight: 600;
  line-height: 1.25;
}

/* For Thai Headings, let's keep font-family but adjust weights */
h1, h2, h3, h4 {
  color: var(--primary-dark);
}

a {
  color: var(--primary-light);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--secondary);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.container {
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  font-family: var(--font-th);
  font-weight: 600;
  font-size: 15px;
  border-radius: var(--radius);
  border: 2px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  gap: 8px;
}

.btn-primary {
  background-color: var(--primary);
  color: var(--white);
}

.btn-primary:hover {
  background-color: var(--primary-dark);
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 74, 173, 0.2);
}

.btn-secondary {
  background-color: var(--secondary);
  color: var(--white);
}

.btn-secondary:hover {
  background-color: var(--secondary-dark);
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(13, 148, 136, 0.2);
}

.btn-outline {
  background-color: transparent;
  border-color: var(--primary);
  color: var(--primary);
}

.btn-outline:hover {
  background-color: var(--primary-tint);
  transform: translateY(-2px);
}

.btn-danger {
  background-color: #ef4444;
  color: var(--white);
}

.btn-danger:hover {
  background-color: #dc2626;
  transform: translateY(-2px);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 13px;
  border-radius: var(--radius-sm);
}

.btn:active {
  transform: translateY(0);
}

/* Header & Navigation */
header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 80px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-weight: bold;
  font-size: 18px;
  box-shadow: 0 4px 10px rgba(0, 74, 173, 0.2);
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 32px;
  align-items: center;
}

.nav-links a {
  color: var(--dark);
  font-weight: 500;
  font-size: 16px;
  position: relative;
  padding: 6px 0;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--secondary);
  transition: var(--transition);
}

.nav-links a:hover {
  color: var(--secondary);
}

.nav-links a:hover::after, .nav-links a.active::after {
  width: 100%;
}

.nav-links a.active {
  color: var(--primary);
  font-weight: 600;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

.cart-icon-btn {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: var(--light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--dark);
  border: none;
  cursor: pointer;
  transition: var(--transition);
}

.cart-icon-btn:hover {
  background-color: var(--primary-tint);
  color: var(--primary);
}

.cart-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background-color: #ef4444;
  color: var(--white);
  font-size: 11px;
  font-weight: bold;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid var(--white);
}

/* Hero Section */
.hero {
  padding: 80px 0;
  background: radial-gradient(circle at 80% 20%, var(--secondary-tint) 0%, var(--light) 50%);
  position: relative;
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}

.hero-badge {
  display: inline-block;
  padding: 6px 14px;
  background-color: var(--primary-tint);
  color: var(--primary-light);
  border-radius: 50px;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 16px;
}

.hero h1 {
  font-size: 44px;
  font-weight: 700;
  margin-bottom: 20px;
  line-height: 1.2;
}

.hero p {
  font-size: 18px;
  color: var(--muted);
  margin-bottom: 32px;
}

.hero-ctas {
  display: flex;
  gap: 16px;
}

.hero-image-container {
  position: relative;
}

.hero-img {
  width: 100%;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 6px solid var(--white);
  transition: var(--transition);
}

.hero-img:hover {
  transform: translateY(-8px);
}

.hero-floating-card {
  position: absolute;
  bottom: 24px;
  left: -24px;
  background-color: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  padding: 16px 20px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 12px;
  animation: float 4s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.hero-floating-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: var(--accent-tint);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.hero-floating-text h4 {
  font-size: 15px;
  color: var(--dark);
}
.hero-floating-text p {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

/* Trust Badges / Info Cards */
.features-section {
  padding: 60px 0;
  background-color: var(--white);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.feature-card {
  padding: 24px;
  border-radius: var(--radius);
  background-color: var(--light);
  border: 1px solid var(--border);
  transition: var(--transition);
}

.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow);
  border-color: var(--secondary);
}

.feature-icon {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-sm);
  background-color: var(--primary-tint);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: 16px;
}

.feature-card h3 {
  font-size: 18px;
  margin-bottom: 8px;
  color: var(--primary-dark);
}

.feature-card p {
  font-size: 14px;
  color: var(--muted);
}

/* Product Catalog Sections */
.section-title {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 32px;
}

.section-title h2 {
  font-size: 32px;
  font-weight: 700;
  position: relative;
  padding-bottom: 10px;
}

.section-title h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 60px;
  height: 4px;
  background: linear-gradient(to right, var(--primary), var(--secondary));
  border-radius: 2px;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 30px;
}

/* Product Card styling */
.product-card {
  background-color: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: var(--transition);
}

.product-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
  border-color: var(--secondary-tint);
}

.product-img-wrapper {
  position: relative;
  background-color: #f8fafc;
  padding-top: 75%; /* 4:3 Aspect Ratio */
  overflow: hidden;
}

.product-img-wrapper img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

.product-card:hover .product-img-wrapper img {
  transform: scale(1.05);
}

.product-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 10px;
  border-radius: 50px;
  font-size: 11px;
  font-weight: 600;
  z-index: 10;
  box-shadow: var(--shadow-sm);
}

.badge-homecare { background-color: var(--primary-tint); color: var(--primary-light); }
.badge-diagnostics { background-color: var(--secondary-tint); color: var(--secondary-dark); }
.badge-rehab { background-color: var(--accent-tint); color: var(--accent); }

.product-info {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.product-model {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.product-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 10px;
  line-height: 1.4;
  height: 44px; /* Limit height to 2 lines */
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.product-desc {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 16px;
  height: 60px; /* Limit height to 3 lines */
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.product-certs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  margin-top: auto;
}

.cert-tag {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  background-color: var(--light);
  color: var(--muted);
  border: 1px solid var(--border);
}

.product-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

.product-price {
  display: flex;
  flex-direction: column;
}

.price-label {
  font-size: 11px;
  color: var(--muted);
}

.price-amount {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
  font-family: var(--font-en);
}

.price-quote {
  font-size: 14px;
  font-weight: 600;
  color: var(--secondary);
}

/* Category Filter Bar */
.filter-bar {
  background-color: var(--white);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
  gap: 16px;
  flex-wrap: wrap;
}

.category-filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background-color: var(--light);
  color: var(--dark);
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  transition: var(--transition);
}

.filter-btn:hover {
  background-color: var(--primary-tint);
  color: var(--primary);
}

.filter-btn.active {
  background-color: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}

.search-box {
  position: relative;
  min-width: 280px;
}

.search-input {
  width: 100%;
  padding: 10px 16px 10px 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 14px;
  outline: none;
  font-family: var(--font-th);
  transition: var(--transition);
}

.search-input:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px var(--primary-tint);
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 16px;
}

/* Product Detail Page */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  margin-top: 40px;
  margin-bottom: 60px;
}

.detail-gallery {
  background-color: var(--white);
  border-radius: var(--radius-lg);
  padding: 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.detail-main-img {
  width: 100%;
  border-radius: var(--radius);
  object-fit: cover;
  background-color: #f8fafc;
}

.detail-info-box {
  display: flex;
  flex-direction: column;
}

.detail-category {
  font-size: 14px;
  font-weight: 600;
  color: var(--secondary);
  margin-bottom: 8px;
}

.detail-title {
  font-size: 30px;
  font-weight: 700;
  margin-bottom: 4px;
  line-height: 1.3;
}

.detail-sub {
  font-size: 16px;
  color: var(--muted);
  margin-bottom: 20px;
  font-family: var(--font-en);
}

.detail-price-panel {
  background-color: var(--primary-tint);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.detail-price-label {
  font-size: 14px;
  color: var(--primary-dark);
  font-weight: 500;
}

.detail-price-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--primary);
  font-family: var(--font-en);
}

.detail-price-quote {
  font-size: 20px;
  font-weight: 700;
  color: var(--secondary);
}

.detail-action-row {
  display: flex;
  gap: 16px;
  margin-bottom: 32px;
  align-items: center;
}

.quantity-selector {
  display: flex;
  align-items: center;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  height: 48px;
  background-color: var(--white);
  overflow: hidden;
}

.qty-btn {
  width: 40px;
  height: 100%;
  background: none;
  border: none;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  color: var(--dark);
  transition: var(--transition);
}

.qty-btn:hover {
  background-color: var(--light);
}

.qty-input {
  width: 50px;
  height: 100%;
  border: none;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  text-align: center;
  font-size: 16px;
  font-weight: 600;
  outline: none;
  font-family: var(--font-en);
}

.detail-action-row .btn {
  height: 48px;
  flex-grow: 1;
}

.detail-features {
  margin-bottom: 32px;
}

.detail-features h4 {
  font-size: 16px;
  margin-bottom: 12px;
}

.detail-features ul {
  list-style: none;
}

.detail-features li {
  position: relative;
  padding-left: 24px;
  margin-bottom: 8px;
  font-size: 14px;
}

.detail-features li::before {
  content: '✓';
  position: absolute;
  left: 0;
  top: 0;
  color: var(--accent);
  font-weight: bold;
}

.detail-certs-row {
  display: flex;
  gap: 12px;
  align-items: center;
  border-top: 1px solid var(--border);
  padding-top: 20px;
}

.detail-certs-row span {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

/* Specs Tab / Table */
.specs-section {
  background-color: var(--white);
  border-radius: var(--radius-lg);
  padding: 32px;
  border: 1px solid var(--border);
  margin-bottom: 60px;
}

.specs-section h3 {
  font-size: 20px;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--light);
  padding-bottom: 12px;
}

.specs-table {
  width: 100%;
  border-collapse: collapse;
}

.specs-table tr {
  border-bottom: 1px solid var(--light-darker);
}

.specs-table tr:last-child {
  border-bottom: none;
}

.specs-table td {
  padding: 12px 16px;
  font-size: 14px;
}

.specs-label {
  font-weight: 600;
  color: var(--primary-dark);
  width: 30%;
  background-color: var(--light);
}

.specs-value {
  color: var(--dark);
}



/* Footer */
footer {
  background-color: var(--dark);
  color: hsl(215, 15%, 80%);
  padding: 60px 0 30px;
  border-top: 1px solid hsl(215, 15%, 25%);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-col h3 {
  color: var(--white);
  font-size: 18px;
  margin-bottom: 20px;
}

.footer-col p {
  font-size: 14px;
  line-height: 1.6;
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 10px;
}

.footer-links a {
  color: hsl(215, 15%, 75%);
  font-size: 14px;
}

.footer-links a:hover {
  color: var(--white);
  padding-left: 4px;
}

.footer-bottom {
  border-top: 1px solid hsl(215, 15%, 25%);
  padding-top: 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}



/* Responsive adjustments */
@media (max-width: 992px) {
  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }
  
  .hero-ctas {
    justify-content: center;
  }
  
  .hero-floating-card {
    left: 24px;
  }
  
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .detail-grid {
    grid-template-columns: 1fr;
  }
  

}

@media (max-width: 768px) {
  .navbar {
    height: auto;
    padding: 16px 0;
    flex-direction: column;
    gap: 16px;
  }
  
  .nav-links {
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .features-grid {
    grid-template-columns: 1fr;
  }
  
  .section-title {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .footer-grid {
    grid-template-columns: 1fr;
  }
}
