/* =========================================================
   AquaLife — Global Theme (complete, sticky footer fixed)
   ========================================================= */

/* ---------- Design Tokens ---------- */
:root {
  --radius: 14px;
  --border: #e3e7ef;
  --bg: #f6f8fc;
  --surface: #ffffff;
  --ink: #111827;
  --ink-soft: #5b6b7a;
  --brand: #2563ff;
  --brand-ink: #1743cb;
  --brand-ghost: rgba(37,99,255,.12);
  --danger: #e03131;
  --shadow: 0 8px 24px rgba(17,24,39,.08);

  /* header height (matches fixed header) */
  --header-h: 64px;
}

/* ---------- Base / Layout ---------- */
* { box-sizing: border-box; }

html {
  height: 100%;
  /* anchor jumps land below the fixed header */
  scroll-padding-top: calc(var(--header-h) + env(safe-area-inset-top));
}

/* Sticky footer stack:
   - flex column on body
   - main flexes to fill remaining space
   - footer sits at the bottom via margin-top:auto
   - use modern viewport units to avoid mobile URL-bar gaps
*/
body {
  margin: 0;
  color: var(--ink);
  font-family: ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  background:
    radial-gradient(1200px 600px at 110% -10%, #e7efff 0%, transparent 60%),
    radial-gradient(800px 400px at -10% 120%, #eef5ff 0%, transparent 60%),
    var(--bg);

  display: flex;
  flex-direction: column;

  /* fallbacks for older browsers + modern mobile */
  min-height: 100vh;     /* fallback */
  min-height: 100dvh;    /* desktop dynamic viewport */
  min-height: 100svh;    /* small viewport (mobile URL bar) */
}

main {
  flex: 1 1 auto;
  min-height: 0;               /* prevents overflow issues in flex containers */
  /* content sits below fixed header (single source of truth) */
  padding-top: calc(var(--header-h) + env(safe-area-inset-top));
}

footer { margin-top: auto; flex-shrink: 0; }

img { max-width: 100%; display: block; }

.container { max-width: 1120px; margin: 0 auto; padding: 1.25rem; }

/* =========================================================
   Header & Navigation
   ========================================================= */

/* Fixed top header (supports <header> or .site-header) */
header,
.site-header {
  position: fixed;
  top: 0; left: 0; width: 100%;
  z-index: 1000;
  color: #fff;
  background: linear-gradient(90deg,#2a6bff,#5387ff);
  border-bottom: 1px solid #1f4ed0;
  backdrop-filter: blur(6px);
}

header .container,
.site-header .container {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  min-height: var(--header-h);
}

header h1,
.site-header .logo {
  margin: .25rem 0;
  font-size: 1.1rem;
  letter-spacing: .2px;
  color: #fff;
  transition: transform .25s ease, font-size .25s ease, letter-spacing .25s ease;
}

/* NEW: image logo without breaking layout */
.logo a { display: inline-flex; align-items: center; text-decoration: none; color: inherit; }
.logo img {
  height: 48px;       /* desktop/tablet size */
  width: auto;
  display: block;     /* remove inline spacing */
}
@media (max-width: 600px) {
  .logo img { height: 36px; } /* smaller on phones */
}

header nav a,
.site-header nav a {
  margin: 0 .75rem;
  font-weight: 600;
  color: #eef2ff;
  text-decoration: none;
  transition: transform .25s ease, font-size .25s ease, letter-spacing .25s ease, color .2s ease;
}
header nav a:hover,
.site-header nav a:hover { color: #fff; }

/* Expand-on-scroll (optional; JS toggles .expanded) */
.site-header.expanded {
  padding-block: .35rem;
  box-shadow: 0 10px 25px rgba(17,24,39,.12);
  background: linear-gradient(90deg,#2a6bff,#4679ff);
  backdrop-filter: saturate(140%) blur(2px);
}
.site-header.expanded .logo {
  transform: scale(1.06); /* gently scales the image too */
}
.site-header.expanded nav a {
  transform: translateY(0);
  font-size: 1.05rem;
  letter-spacing: .25px;
}

@media (prefers-reduced-motion: reduce) {
  .site-header,
  .site-header .logo,
  .site-header nav a { transition: none; }
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  padding: .5rem .6rem;
  background: #1f4ed0;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 10px;
  cursor: pointer;
}
.nav-toggle .nav-bar {
  display: block; width: 22px; height: 2px; margin: 4px 0; background: #fff; border-radius: 2px;
}

/* Nav container */
.site-nav { display: flex; gap: .75rem; }
.site-nav a { padding: .4rem .35rem; }

/* =========================================================
   Footer
   ========================================================= */
footer,
.site-footer {
  text-align: center;
  padding: 1.25rem;
  font-size: .9rem;
  color: var(--ink-soft);
  background: linear-gradient(180deg,#eef7ff,#dfefff);
  border-top: 1px solid var(--border);
}

/* =========================================================
   Common Components
   ========================================================= */

.page-title {
  display: flex; align-items: flex-end; gap: .75rem; flex-wrap: wrap;
  padding-bottom: .6rem; margin-bottom: 1rem; border-bottom: 1px solid var(--border);
}
.page-title h1 { margin: 0; font-size: 1.75rem; line-height: 1.2; }
.page-title .subtle { color: var(--ink-soft); font-weight: 600; }

.btn,
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .72rem 1.1rem; font-weight: 700; color: #fff; text-decoration: none;
  border: 0; border-radius: 12px; background: var(--brand);
  box-shadow: 0 6px 16px rgba(37,99,255,.25);
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn-primary:hover { background: var(--brand-ink); transform: translateY(-1px); }
.btn-primary:focus-visible { outline: 3px solid var(--brand-ghost); outline-offset: 2px; }

.btn-success { background: #10b981 !important; box-shadow: 0 6px 16px rgba(16,185,129,.25); }
.btn-success:hover { background: #0ea472 !important; }

.btn.btn-outline {
  padding: .65rem 1rem; font-weight: 700; color: var(--brand);
  background: transparent; border: 1.5px solid var(--brand); border-radius: 12px; box-shadow: none;
}
.btn.btn-outline:hover { background: var(--brand-ghost); }

.actions { text-align: center; margin: 1rem 0 2rem; }

.call-btn {
  background: #2563eb; color: #fff; padding: .4rem .9rem; border-radius: .5rem;
  font-weight: 600; text-decoration: none; transition: background .2s;
}
.call-btn:hover { background: #1d4ed8; }

.notice { margin-top: .6rem; font-weight: 600; font-size: .95rem; }
.notice-success { color: #065f46; }
.notice-error { color: #b42318; }

.link-card { color: inherit; text-decoration: none; }
.tagline { text-align: center; font-weight: 600; }

/* =========================================================
   Hero
   ========================================================= */
.hero {
  position: relative;
  width: 100%;              /* avoid 100vw scrollbars */
  aspect-ratio: 16 / 9;
  max-height: 60vh;
  margin: 0;
  overflow: hidden;
  background: #000;
}
.hero-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero::after { content: ""; position: absolute; inset: 0; background: rgba(0,0,0,.4); z-index: 1; }

.hero-overlay {
  position: absolute; inset: 0; z-index: 2;
  display: grid; place-items: center;
  padding: 1.5rem; color: #fff; text-align: center;
}
.hero-overlay > div {
  max-width: 980px; margin: 0 1rem; padding: 1.25rem 1.5rem;
  background: rgba(0,0,0,.35); border-radius: 12px;
}
.hero-title { margin: 0 0 .5rem; font-size: 2rem; }
.hero-desc  { margin: 0; font-size: 1rem; }

/* =========================================================
   Store / Info Cards
   ========================================================= */
.store-section { margin: 3rem 0 3.5rem; }

.info-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 1.25rem;
}

.info-card {
  padding: 1.25rem 1.25rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.info-head { display: flex; align-items: center; gap: .6rem; margin-bottom: .75rem; }
.info-head h3 { margin: 0; font-size: 1.15rem; letter-spacing: .2px; }

.info-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; color: var(--brand);
  background: var(--brand-ghost); border-radius: 12px;
}

.hours-list { list-style: none; padding: 0; margin: .25rem 0 0; }
.hours-list li {
  display: flex; justify-content: space-between; gap: 1rem;
  padding: .55rem .25rem; font-weight: 600; border-bottom: 1px dashed #e9eef9;
}
.hours-list li:last-child { border-bottom: 0; }

.contact-lines { line-height: 1.7; color: var(--ink); font-style: normal; }
.contact-lines a { color: var(--brand-ink); text-decoration: none; }
.contact-lines a:hover { text-decoration: underline; }

.info-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1rem; }

/* =========================================================
   Products Grid & Card
   ========================================================= */
.products-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 1rem; align-items: stretch; padding: 1rem 0;
}

.product-card {
  position: relative; display: flex; flex-direction: column; gap: .6rem;
  padding: 1rem; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 18px; box-shadow: var(--shadow); isolation: isolate;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;
}
.product-card:hover { transform: translateY(-2px); }
.product-card:focus-within { outline: 3px solid var(--brand-ghost); outline-offset: 2px; }

.product-card.active { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-ghost), var(--shadow); }
.product-card.active::after {
  content: "Selected";
  position: absolute; top: 10px; left: 12px;
  padding: .25rem .5rem; font-size: .75rem; font-weight: 800; letter-spacing: .02em;
  color: #0b2b9b; background: #eaf0ff; border: 1px solid #cfe1ff; border-radius: 999px;
}

.product-media { aspect-ratio: 1 / 1; overflow: hidden; background: #f1f5fe; border-radius: 14px; }
.product-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .2s ease; }
.product-card:hover .product-media img { transform: scale(1.03); }

.product-info { min-height: 72px; }
.product-title { margin: .1rem 0 0; font-size: 1.08rem; }
.product-desc  { margin: .35rem 0 0; font-size: .95rem; color: var(--ink-soft); }

.remove-btn {
  display: none; position: absolute; top: 10px; right: 12px;
  width: 28px; height: 28px; line-height: 26px; text-align: center;
  color: var(--danger); background: #fff; border: 1px solid var(--border);
  border-radius: 50%; box-shadow: 0 4px 10px rgba(0,0,0,.06);
  cursor: pointer; transition: background .15s ease, transform .05s ease, border-color .15s ease; z-index: 2;
}
.product-card.active .remove-btn { display: inline-block; }
.remove-btn:hover { background: #fff5f5; border-color: #f1c9c9; }
.remove-btn:active { transform: scale(.96); }

.controls {
  display: none; align-items: center; justify-content: center; gap: .55rem; margin-top: .1rem;
}
.product-card.active .controls { display: flex; }

.controls button {
  padding: .35rem .6rem; font-size: 1rem; background: #fff;
  border: 1px solid var(--border); border-radius: 12px; cursor: pointer;
  transition: background .15s ease, transform .05s ease, border-color .15s ease;
}
.controls button:hover  { background: #f5f8ff; border-color: #d3dcff; }
.controls button:active { transform: scale(.97); }

.qty {
  min-width: 34px; padding: .25rem .4rem; text-align: center; font-weight: 800; color: var(--ink);
  background: #eef3ff; border: 2px solid var(--brand); border-radius: 10px;
}
.controls input[type="hidden"] { display: none; }

/* =========================================================
   Forms
   ========================================================= */
.order-form {
  padding: 1rem 1.2rem; background: var(--surface);
  border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow);
}

.order-form label { display: grid; gap: .4rem; color: #21314a; font-weight: 800; }

.order-form .form-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1rem;
}

.order-form input[type="text"],
.order-form input[type="email"] {
  padding: .85rem .9rem; color: #0f1a2b; background: #eef4ff;
  border: 2px solid #c4d4ff; border-radius: 12px;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.order-form input::placeholder { color: #7a8aa3; }
.order-form input:focus {
  outline: none; background: #fff; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-ghost);
}

.order-form textarea {
  padding: .85rem .9rem; color: #0f1a2b; background: #eef4ff;
  border: 2px solid #c4d4ff; border-radius: 12px; resize: vertical;
}
.order-form textarea:focus {
  outline: none; background: #fff; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-ghost);
}

.field-error { margin-top: .35rem; font-size: .85rem; color: #b42318; }

.form-error {
  margin: 0 0 1rem; padding: .75rem 1rem; color: #a11b12;
  background: #fff2f0; border: 1px solid #ffd5d1; border-radius: 10px; font-weight: 600;
}

.order-form .form-row .field-error {
  grid-column: 2; display: block; min-height: 1rem; margin-top: .35rem; font-size: .85rem; color: #b42318;
}

/* =========================================================
   Contact Page Helpers
   ========================================================= */
.page-contact .contact-center {
  min-height: calc(100vh - 100px);
  display: grid; align-content: center; justify-items: center; text-align: center; gap: 1rem;
}
.page-contact .order-form { width: 100%; max-width: 640px; margin: 0 auto; text-align: left; }
.page-contact .page-title { border-bottom: 0; margin-bottom: .5rem; }
.page-contact .page-title h1,
.page-contact .page-title .subtle { width: 100%; text-align: center; }

/* Generic center helper */
.contact-center {
  min-height: calc(100dvh - 180px);
  display: grid; place-content: center; gap: 1rem;
}

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 760px) {
  .container { padding: .9rem; }
  .page-title { justify-content: center; text-align: center; }

  /* Mobile nav drawer */
  .nav-toggle { display: inline-flex; flex-direction: column; }
  .site-header .container { align-items: center; }
  .site-nav {
    position: absolute; top: 100%; left: 0; right: 0;
    display: none; flex-direction: column; gap: 0;
    padding: .4rem 1rem .8rem;
    background: linear-gradient(180deg,#2a6bff,#4679ff);
    border-bottom: 1px solid #1f4ed0;
  }
  .site-nav a {
    display: block; margin: 0; padding: .7rem 0; color: #fff;
    border-top: 1px solid rgba(255,255,255,.12);
  }
  .site-nav a:first-child { border-top: 0; }
  .site-nav.open { display: flex; }

  /* Info section → list style */
  .store-section .info-grid { display: block; }
  .store-section .info-card {
    background: transparent; border: 0; border-radius: 0; box-shadow: none;
    padding: .9rem 0; margin: 0; border-bottom: 1px solid var(--border);
  }
  .store-section .info-card:first-child { border-top: 1px solid var(--border); }
  .store-section .info-head { margin: 0 0 .35rem; gap: .5rem; }
  .store-section .info-head h3 { font-size: 1rem; }
  .store-section .info-icon { width: 28px; height: 28px; border-radius: 8px; }
  .store-section .hours-list,
  .store-section .contact-lines { font-size: .95rem; }
  .store-section .hours-list li { padding: .45rem 0; }
  .store-section .info-actions { margin-top: .5rem; gap: .5rem; }
  .store-section .btn,
  .store-section .btn-primary,
  .store-section .btn.btn-outline { width: 100%; justify-content: center; }

  /* Mobile hero override:
     Fill the visible viewport below the fixed header. */
  .hero {
    aspect-ratio: auto;
    max-height: none;
    height: calc(100svh - var(--header-h));
    min-height: 360px;
  }
}

@media (max-width: 900px) { .info-grid { grid-template-columns: 1fr; } }

/* Hero scales down (tablet/desktop defaults kept) */
@media (max-width: 900px) {
  .hero { aspect-ratio: 16 / 9; max-height: 55vh; }
  .hero-title { font-size: 1.6rem; }
  .hero-desc  { font-size: .98rem; }
}
@media (max-width: 520px) {
  /* this is overridden by the 760px block above to use height calc(...) */
  .hero-overlay > div { padding: .9rem 1rem; }
  .hero-title { font-size: 1.35rem; }
  .hero-desc  { font-size: .92rem; }
}

/* Products grid breakpoints */
@media (max-width: 900px) { .products-grid { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 600px) {
  .products-grid { grid-template-columns: 1fr; gap: .75rem; }
  .product-card { padding: .85rem; border-radius: 16px; }
  .product-title { font-size: 1rem; }
  .product-desc  { font-size: .92rem; }
}

/* Forms: single column + prevent iOS zoom */
@media (max-width: 700px) {
  .order-form .form-row { grid-template-columns: 1fr; gap: .75rem; }
  .order-form input[type="text"],
  .order-form input[type="email"],
  .order-form textarea { font-size: 16px; }
  .btn, .btn-primary { padding: .8rem 1rem; border-radius: 12px; }
}

/* --- fixes --- */
/* no hero margin-top; single offset lives on main */

/* improved mobile nav animation + containment */
@media (max-width: 760px){
  .nav-toggle{ display:inline-flex; flex-direction:column; }
  .site-header .container{ align-items:center; }

  .site-nav{
    position:absolute; top:100%; left:0; right:0;
    max-height:0; overflow:hidden;
    background:linear-gradient(180deg,#2a6bff,#4679ff);
    border-bottom:1px solid #1f4ed0;
    transition:max-height .25s ease;
  }
  .site-nav a{
    display:block; padding:.9rem 1rem; color:#fff;
    border-top:1px solid rgba(255,255,255,.12);
  }
  .site-nav a:first-child{ border-top:0; }
  .site-nav.open{ max-height:70vh; overflow:auto; }
}

/* center the call buttons in the info cards */
.store-section .info-actions .btn,
.store-section .info-actions .btn-primary,
.store-section .info-actions .btn.btn-outline{
  width:100%;
  justify-content:center;
  text-align:center;
}

/* optional: center the special "Call Us" nav link */
.site-nav a.call-link{ text-align:center; font-weight:700; }
