/* Shared site styles extracted from the original single-page index.
   Linked by every public page. Tailwind utilities live in styles.css. */

/* ── Page transitions ───────────────────────────────────────────────
   LCP-safe scroll reveal: content is fully visible by default (no-JS,
   crawlers, and above-the-fold content are never hidden). site.js adds
   .reveal only to below-fold sections, then .is-visible via
   IntersectionObserver as they scroll into view. Only transform and
   opacity are animated — no layout or paint work. */

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.55s ease-out, transform 0.55s ease-out;
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ── Header logo hover glow ─────────────────────────────────────────
   Subtle brand-red glow when hovering the logo. Applies on every page
   via the shared header markup (no per-page HTML changes). */

header img[src*="onestop-logo"] {
  transition: filter 0.3s ease, transform 0.3s ease;
}

header img[src*="onestop-logo"]:hover {
  filter: drop-shadow(0 0 8px rgba(220, 38, 38, 0.65));
  transform: scale(1.02);
}

/* Native cross-document View Transitions (Chromium) layered on top —
   a clean cross-fade for browsers that support it. */
@view-transition {
  navigation: auto;
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation: none;
  }
}

/* Sticky footer: keep the footer at the bottom of the viewport on short
   pages. Fixed-position overlays (modals, chat widget) are out of flow,
   so they don't affect this column layout. */
body {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
main {
  flex: 1 0 auto;
}
body > footer {
  flex-shrink: 0;
}

.logo-text {
  font-family: 'Arial Black', sans-serif;
  color: #FFFF00;
  background-color: #000000;
  padding: 0.5rem 1rem;
  display: inline-block;
}

.hero-section {
  position: relative;
  background-size: cover;
  background-position: center -174px;
  background-attachment: scroll; /* Better for mobile */
}
.hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: linear-gradient(rgba(0,0,0,0.7), rgba(0,0,0,0.7)), url('https://images.unsplash.com/photo-1439792675105-701e6a4ab6f0?auto=format&fit=crop&w=1920');
  background-size: cover;
  background-position: center -174px;
  background-attachment: scroll;
  filter: grayscale(100%);
  z-index: -1;
}

/* Desktop background positioning */
@media (min-width: 1024px) {
  .hero-section {
    background-position: center center;
  }
  .hero-section::before {
    background-position: center center;
  }
}
.service-card, .testimonial-card {
  transition: transform 0.25s ease-out, box-shadow 0.25s ease-out;
}
.service-card:hover, .testimonial-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.14);
}

section[id] {
  scroll-margin-top: 108px;
}

.marine-highlight-card {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #050505 0%, #171717 58%, #2a2a2a 100%);
}

.marine-highlight-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 15% 18%, rgba(250, 204, 21, 0.16), transparent 28%),
    radial-gradient(circle at 86% 20%, rgba(220, 38, 38, 0.22), transparent 30%);
  pointer-events: none;
}

.marine-service-chip {
  border: 1px solid rgba(250, 204, 21, 0.35);
  background: rgba(255, 255, 255, 0.06);
  color: #f9fafb;
}

.marine-promo-modal {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
  backdrop-filter: blur(2px);
}

.marine-promo-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.marine-promo-panel {
  position: relative;
  background: linear-gradient(135deg, #07070b 0%, #121722 55%, #1e293b 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 28px 75px rgba(0, 0, 0, 0.55);
  transform: translateY(32px) scale(0.97);
  opacity: 0;
  overflow: hidden;
}

.marine-promo-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 12% 12%, rgba(250, 204, 21, 0.18), transparent 36%),
    radial-gradient(circle at 90% 82%, rgba(220, 38, 38, 0.18), transparent 34%);
  pointer-events: none;
}

.marine-promo-modal.is-open .marine-promo-panel {
  animation: marinePromoExpand 0.9s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.marine-promo-modal.is-open.is-closing .marine-promo-panel {
  animation: marinePromoCollapse 0.28s ease both;
}

@keyframes marinePromoExpand {
  from {
    opacity: 0;
    transform: translateY(32px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes marinePromoCollapse {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(22px) scale(0.98);
  }
}

.marine-promo-content {
  position: relative;
  z-index: 1;
}

.marine-promo-reveal {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.marine-promo-modal.is-open .marine-promo-reveal {
  opacity: 1;
  transform: translateY(0);
}

.marine-promo-reveal.delay-1 { transition-delay: 70ms; }
.marine-promo-reveal.delay-2 { transition-delay: 130ms; }
.marine-promo-reveal.delay-3 { transition-delay: 190ms; }
.marine-promo-reveal.delay-4 { transition-delay: 250ms; }

.marine-promo-energy {
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(220, 38, 38, 0.12), rgba(220, 38, 38, 0.8), rgba(250, 204, 21, 0.35));
  background-size: 170% 100%;
  animation: marinePromoStreak 2.8s linear infinite;
}

@keyframes marinePromoStreak {
  from { background-position: 100% 0; }
  to { background-position: -100% 0; }
}

.marine-promo-image-wrap {
  position: relative;
  width: 210px;
  max-width: 100%;
  aspect-ratio: 1536 / 1024;
  border-radius: 1rem;
  padding: 0;
  background: transparent;
  box-shadow: none;
  transform: translateY(0);
  animation: marineImageFloat 4.6s ease-in-out infinite;
}

.marine-promo-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  border-radius: 1rem;
  filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.5));
}

@keyframes marineImageFloat {
  0% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
  100% {
    transform: translateY(0);
  }
}

.marine-promo-cta-primary {
  box-shadow: 0 10px 28px rgba(220, 38, 38, 0.25);
  transform: translateY(0);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.marine-promo-cta-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 34px rgba(220, 38, 38, 0.32);
}

@media (prefers-reduced-motion: reduce) {
  .marine-promo-modal,
  .marine-promo-panel,
  .marine-promo-energy,
  .marine-promo-image-wrap,
  .marine-promo-reveal {
    animation: none !important;
    transition: none !important;
  }
}

/* Mobile-specific improvements */
@media (max-width: 768px) {
  .hero-section {
    background-attachment: scroll !important;
  }
  .logo-text {
    font-size: 1.25rem !important;
    padding: 0.25rem 0.5rem;
  }
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  /* Ensure mobile menu doesn't interfere with chat */
  #mobileMenu {
    z-index: 40;
  }
  /* Better touch targets */
  button, a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  /* Prevent horizontal scroll on mobile */
  body {
    overflow-x: hidden;
  }
}

/* iOS safe area support */
@supports (padding: max(0px)) {
  .container {
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
  }
}

/* Print styles - only show the coupon */
#couponPrintArea { display: none; }
@media print {
  body > *:not(#couponPrintArea) { display: none !important; }
  #couponPrintArea {
    display: block !important;
    position: static !important;
    font-family: Arial, sans-serif;
    padding: 10px 20px;
    text-align: center;
  }
  #couponPrintArea .coupon-print {
    border: 2px dashed #dc2626;
    padding: 12px 15px;
    max-width: 480px;
    margin: 8px auto;
    page-break-inside: avoid;
  }
  #couponPrintArea .cp-title { font-size: 14px; font-weight: bold; color: #dc2626; margin-bottom: 4px; }
  #couponPrintArea .cp-discount { font-size: 22px; font-weight: bold; color: #000; margin: 6px 0; }
  #couponPrintArea .cp-desc { font-size: 11px; color: #374151; margin-bottom: 6px; }
  #couponPrintArea .cp-code { background: #fee2e2; padding: 4px 10px; border-radius: 6px; font-size: 14px; font-weight: bold; letter-spacing: 2px; display: inline-block; margin: 4px 0; }
  #couponPrintArea .cp-disclaimer { font-size: 9px; color: #9ca3af; font-style: italic; margin-top: 4px; }
  #couponPrintArea .cp-valid { font-size: 10px; color: #6b7280; margin-top: 4px; }
  #couponPrintArea .cp-shop { font-size: 13px; font-weight: bold; margin-top: 6px; }
  #couponPrintArea .cp-phone { color: #dc2626; font-size: 12px; }
}
