body { font-family: 'Inter', sans-serif; background: #ffffff; color: #1f2937; }
.dark body { background: #111827; color: #e5e7eb; }
.glass {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.18);
}
.dark .glass {
  background: rgba(17, 24, 39, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.05);
}
#loader {
  position: fixed;
  inset: 0;
  background: #ffffff;
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: opacity 0.5s ease;
}
.dark #loader { background: #111827; }
.spinner {
  width: 50px;
  height: 50px;
  border: 5px solid #dbeafe;
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin { 100% { transform: rotate(360deg); } }
.fade-up {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.fade-up.visible { opacity: 1; transform: translateY(0); }
.floating { animation: float 6s ease-in-out infinite; }
@keyframes float { 0%,100% { transform: translateY(0px); } 50% { transform: translateY(-20px); } }
details>summary { list-style: none; }
details>summary::-webkit-details-marker { display: none; }
.admin-card { transition: all 0.2s ease; }
.admin-card:hover { transform: translateY(-3px); box-shadow: 0 10px 25px -5px rgba(0,0,0,0.1); }
#adminPanel { display: none; }
#adminPanel.show { display: block; }

.service-card {
  background: white;
  border-radius: 16px;
  padding: 0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  transition: transform 0.2s, box-shadow 0.2s;
  border: 1px solid rgba(0,0,0,0.04);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.service-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(0,0,0,0.08);
}
.dark .service-card {
  background: #1f2937;
  border-color: rgba(255,255,255,0.05);
}
.service-card .card-image {
  width: 100%;
  height: 200px;
  display: block;
  overflow: hidden;
  background: #f3f4f6;
}
.service-card .card-image img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center center;
}
.dark .service-card .card-image {
  background: #374151;
}
.service-card .card-image:empty {
  display: none;
}
.service-card .visit-link {
  color: #2563eb;
  font-weight: 500;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  transition: color 0.2s;
}
.service-card .visit-link:hover {
  color: #1d4ed8;
  text-decoration: underline;
}
.dark .service-card .visit-link {
  color: #60a5fa;
}
.dark .service-card .visit-link:hover {
  color: #93bbfc;
}
.product-card {
  background: white;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  transition: transform 0.2s, box-shadow 0.2s;
}
.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(0,0,0,0.08);
}
.dark .product-card {
  background: #1f2937;
}
.product-card .full-img {
  width: 100%;
  height: 200px;
  display: block;
  overflow: hidden;
  background: #f3f4f6;
}
.product-card .full-img img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center center;
}
.dark .product-card .full-img {
  background: #374151;
}
.product-card .full-img:empty {
  display: none;
}
#messagesList::-webkit-scrollbar,
#adminItemList::-webkit-scrollbar {
  width: 4px;
}
#messagesList::-webkit-scrollbar-track,
#adminItemList::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}
#messagesList::-webkit-scrollbar-thumb,
#adminItemList::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 4px;
}
.dark #messagesList::-webkit-scrollbar-track,
.dark #adminItemList::-webkit-scrollbar-track {
  background: #374151;
}
.dark #messagesList::-webkit-scrollbar-thumb,
.dark #adminItemList::-webkit-scrollbar-thumb {
  background: #4b5563;
}
section {
  scroll-margin-top: 80px;
}
.admin-tab {
  transition: all 0.2s;
  cursor: pointer;
}
.admin-tab.active {
  color: #2563eb;
  border-bottom: 2px solid #2563eb;
  font-weight: 600;
}
.admin-tab:not(.active) {
  color: #6b7280;
  border-bottom: 2px solid transparent;
}
.admin-tab:hover:not(.active) {
  color: #374151;
  border-bottom: 2px solid #d1d5db;
}
.dark .admin-tab:not(.active) {
  color: #9ca3af;
}
.dark .admin-tab:hover:not(.active) {
  color: #e5e7eb;
  border-bottom: 2px solid #4b5563;
}
.admin-content {
  display: none;
}
.admin-content.active {
  display: block;
}
#currentLogoPreview {
  transition: all 0.3s ease;
}
.team-member-img {
  width: 96px;
  height: 96px;
  border-radius: 9999px;
  object-fit: cover;
  border: 4px solid white;
  background: #e5e7eb;
  display: block;
  margin: -48px auto 0 auto;
}
.dark .team-member-img {
  border-color: #1f2937;
  background: #374151;
}
/* popup overlay */
#popupOverlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 9998;
  display: none;
  justify-content: center;
  align-items: center;
  padding: 20px;
}
#popupOverlay.active {
  display: flex;
}
#popupBox {
  max-width: 600px;
  width: 100%;
  background: white;
  border-radius: 24px;
  box-shadow: 0 25px 60px rgba(0,0,0,0.3);
  overflow: hidden;
  animation: popIn 0.4s ease;
  position: relative;
}
.dark #popupBox {
  background: #1f2937;
}
@keyframes popIn {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
#popupBox .popup-img {
  width: 100%;
  max-height: 300px;
  object-fit: cover;
  display: block;
}
#popupBox .popup-content {
  padding: 30px;
}
#popupBox .popup-content h3 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 12px;
}
#popupBox .popup-content p {
  color: #4b5563;
  line-height: 1.7;
}
.dark #popupBox .popup-content p {
  color: #d1d5db;
}
#popupClose {
  position: absolute;
  top: 16px;
  right: 20px;
  font-size: 28px;
  cursor: pointer;
  color: #6b7280;
  transition: 0.2s;
  background: rgba(255,255,255,0.7);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
}
#popupClose:hover { background: rgba(255,255,255,0.95); color: #1f2937; }
.dark #popupClose { background: rgba(0,0,0,0.5); color: #d1d5db; }
.dark #popupClose:hover { background: rgba(0,0,0,0.8); color: white; }
.popup-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.popup-toggle label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
  cursor: pointer;
}

/* ==================================================================
 | LOGO BOXES (header + footer share one system)
 |
 | Both logos sit inside the same white rounded card. The white card
 | keeps a dark or coloured logo readable on any background, which is
 | why the footer version already looked good on the dark footer.
 | In dark mode the whole card grows a little so the logo stays clear
 | against the dark page.
 | ================================================================== */
.logo-container,
.footer-logo-container {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  height: 52px;
  max-width: 200px;
  transition: height 0.3s ease, padding 0.3s ease, box-shadow 0.3s ease,
    background-color 0.3s ease;
}

/*
 * The white card. The header is on a light background in light mode, so no
 * card is needed there - it only appears in dark mode. The footer is always
 * dark, so it always keeps the card.
 */
.footer-logo-container,
.dark .logo-container {
  padding: 6px 12px;
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.10);
}

/* Light mode header: no box at all, just the logo. */
.logo-container {
  padding: 0;
  background: transparent;
  box-shadow: none;
}
.logo-container img,
.footer-logo-container img {
  width: auto;
  height: 100%;
  max-width: 100%;
  object-fit: contain;
  display: block;
  transition: opacity 0.3s ease;
}
/* Without a card the header logo should sit flush with the page edge. */
.logo-container img {
  object-position: left center;
}
.dark .logo-container img,
.footer-logo-container img {
  object-position: center;
}
/* Never print the brand name as text beside or below the footer logo. */
.footer-logo-container span {
  display: none;
}

/*
 * When no logo image is uploaded the header falls back to the site name.
 * In dark mode that name sits on the white card, so it must stay dark or it
 * would be white-on-white and invisible.
 */
.dark .logo-container span {
  color: #111827;
}

/* Dark mode: a bigger card with a soft glow so the logo stands out. */
.dark .logo-container,
.dark .footer-logo-container {
  height: 60px;
  padding: 7px 14px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
}

@media (min-width: 768px) {
  .logo-container,
  .footer-logo-container {
    height: 58px;
    max-width: 260px;
    padding: 7px 14px;
  }
  .dark .logo-container,
  .dark .footer-logo-container {
    height: 66px;
    padding: 8px 16px;
  }
}

/* ------------------------------------------------------------------
 | Responsive hardening (phones, tablets, small laptops)
 | ------------------------------------------------------------------ */
html {
  -webkit-text-size-adjust: 100%;
}
body {
  overflow-x: hidden;
}
img,
video,
iframe {
  max-width: 100%;
}
/* Never let a long word or URL widen the page */
h1, h2, h3, p, a, li, td {
  overflow-wrap: break-word;
}
/* Comfortable tap targets on touch screens */
@media (hover: none) and (pointer: coarse) {
  a, button, [role="button"], input[type="submit"] {
    min-height: 40px;
  }
}
@media (max-width: 640px) {
  section {
    scroll-margin-top: 88px;
  }
  .service-card .card-image,
  .product-card .full-img {
    height: 180px;
  }
  /* Stop wide tables and card rows from causing sideways scroll */
  table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}
/* Mobile navigation links */
.mobile-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1rem;
  font-weight: 600;
  padding: 0.75rem 0.875rem;
}
.mobile-link i {
  width: 1.25rem;
  text-align: center;
  font-size: 0.95rem;
  opacity: 0.85;
}
