/* Minimal, accessible, no-JS styles (responsive) */
* { box-sizing: border-box; }
:root {
  --bg: #fff;
  --fg: #111;
  --muted: #666;
  --brand: #111;
  --brand-alt: #333;
  --card: #fff;
  --border: #ddd;
  --radius: .5rem;
  --container-pad: 1rem;
}

html, body { overflow-x: clip; }
html { font-size: 16px; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  line-height: 1.5;
  background: var(--bg);
  color: var(--fg);
}

/* Fluid container */
.container {
  width: 100%;
  max-width: min(100% - 2rem, 980px);
  margin: 0 auto;
  padding: var(--container-pad);
}
.nav-container { width: 100%; margin: 0 auto; }
.nav-container img { max-width: 100%; width: 100%; height: auto; }

/* Header & footer */
.site-header { background: #111; color: #eee; }
.site-footer {
  background: #FFC83D;
  color: #000;
  text-align: center; /* mobile default */
}

/* Layout */
.site-footer .container {
  display: flex;
  flex-wrap: wrap;          /* lets items wrap to new rows */
  align-items: left;
  justify-content: space-between;
  gap: 16px;                /* space between columns/rows */
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 16px;
}

/* Mobile-first: stack all to full width */
.site-footer > .container > .grid-col:first-of-type {
    flex: 0 1 calc(30% - 12px);  /* subtract half the gap to avoid wrapping */
    text-align: left;
  }

  /* Second column (text) = 70% */
  .site-footer > .container > .grid-col:nth-of-type(2) {
    flex: 1 1 calc(70% - 12px);
    text-align: left;
  }

  /* Ensure text inside is left-aligned */
  .site-footer .grid-col h3,
  .site-footer .grid-col p {
    text-align: left;
  }
.site-footer .copyrights{
	margin: 0 auto;
	font-weight: 700;
}

/* Logo sizing */
.site-footer .grid-col img {
  max-width: 300px;
  width: 100%;
  height: auto;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  flex-wrap: wrap; /* allow wrapping on small screens */
}
.site-header .top {
    background: #FFC83D;
    color: #000;
    font-weight: 700;
    padding: 5px 50px;
}
.top p{
	text-transform: uppercase;
	text-align: center;
}
.site-header a.brand {
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: clamp(1rem, 2vw + .5rem, 1.25rem);
}
/* header row: brand + burger + nav */
.inner {
  display: flex;
  align-items: center;
  /*justify-content: space-between;*/
  gap: 1rem;
  width: 100%;
  flex-wrap: nowrap;
  margin-left: 0;
  overflow-x: clip;               /* belt-and-braces */
  min-width: 0;  
}

/* brand image */
.site-header .brand img,
/*.brand { flex: 0 0 auto; }*/
.brand img {
  max-width: clamp(160px, 22vw, 280px);
  width: 300px;
  height: auto;
  margin: 10px 0;
}

/* base nav (desktop) */
.nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
	margin-left: 0;
  flex: 1 1 auto;
  min-width: 0;   
}
.menu { position: relative; }
.menu > li { position: relative; }

.menu > li.has-sub > a::after {
  content: "▾";
  font-size: .8em;
  margin-left: .4em;
  opacity: .7;
}

/* The dropdown */
.submenu {
  position: absolute;
  left: 0;
  top: 100%;
  min-width: 200px;
  z-index: 1001;

  display: none;                 /* hidden by default */
  margin: 0; padding: .5rem 0;
  list-style: none;

  background: #000;              /* match your header/nav palette */
  border: 1px solid #222;
  border-radius: .5rem;
  box-shadow: 0 6px 18px rgba(0,0,0,.25);
}

.submenu li { margin: 0; }
.submenu a {
  display: block;
  padding: .5rem .9rem;
  white-space: nowrap;
  color: #ddd;                   /* readable on black */
  text-decoration: none;
}
.submenu a:hover { color: #FFC83D; }

/* Reveal on hover OR keyboard focus */
.menu > li.has-sub:hover > .submenu,
.menu > li.has-sub:focus-within > .submenu {
  display: block;
}

/* Prevent overflow issues */
.menu, .submenu { min-width: 0; }

/* cart link */
.cart-link { text-decoration: none; }

/* burger button (hidden on desktop) */
.nav-toggle { display: none; }
.nav-burger {
  display: none; /* shown on mobile only */
  width: 50px; height: 40px;
  padding: 6px; box-sizing: border-box;
  border: 0 solid #ddd; border-radius: 8px;
  cursor: pointer;
  align-items: center; justify-content: center;
}
.nav-burger span {
  display: block;
  width: 22px; height: 2px;
  background: #FFC83D;
  margin: 4px 0;
}
/* vertical list inside nav */
.nav > ul.menu {
  display: inline;
  flex-direction: column;       /* stack items vertically */
  gap: 0.5rem;                  /* space between <li> */
  list-style: none;
  margin: 0;
  padding: 0;
}

/* each li is a row; no inline */
.nav > ul.menu li {
	display: inline;
    align-items: center;
    margin: 10px;
	text-transform: uppercase;
}
/* text styles belong on links, not li */
.inner nav a { 
  text-decoration: none; 
}

.inner nav a:hover{
	color: #FFC83D;
}
.site-header .nav-container nav a { color: #ddd; text-decoration: none; }
.site-header .banner {
    background: #FFC83D;
    color: #000;
    font-weight: 700;
    padding: 5px 50px;
}
/* Cards & grid */
.grid {
  display: grid;
  /*grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); /* tighter base for small phones */
   grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.card {
  border: 1px solid var(--border);
  padding: 1rem;
  border-radius: var(--radius);
  background: var(--card);
}

.card img { width: 100%; height: auto; display: block; }
.card a {
    text-decoration: none;
    color: #FFC83D;
}
.card .button {
    text-align: center;
    display: block;
    background: #000;
    border: solid 1px;
}
.card form button {
    margin-left: 30px;
}
/* Typography helpers */
.price { font-weight: 700; }
.muted { color: var(--muted); font-size: .9rem; }

/* Product media */
.product-image { max-width: 480px; width: 100%; height: auto; display: block; }

/* Buttons & form elements */
.button,
button {
  display: inline-flex;            /* consistent box model */
  align-items: center;
  justify-content: center;
  gap: .5rem;

  font: inherit;                   /* same font family/size */
  line-height: 1.2;                /* normalize line-height */
  padding: .65rem 1rem;            /* identical padding */
  border: 1px solid transparent;   /* same border width */
  border-radius: .375rem;

  background: var(--brand);
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  vertical-align: middle;
	margin-top: 10px;
}

/* Remove native OS button styling that changes height */
button {
  -webkit-appearance: none;
  appearance: none;
}

.cart-actions{

	margin: 0 auto;
}
.cart-actions .button,
.cart-actions button {
  min-width: 11rem;
}
.checkout-btn {
	text-align: center;
    background: #000;
    border: solid 1px;
	color: #FFC83D !important;
}
.checkout-btn:hover {
	background: #FFC83D !important;
    border: solid 1px;
	color: #000 !important;
}
/* Keep your existing hover/focus styles */
.button:hover, button:hover { background: var(--brand-alt); }

.form input,
.form textarea,
input[type="text"],
input[type="email"],
input[type="number"],
textarea {
  width: 100%;
  padding: .5rem;
  border: 1px solid #ccc;
  border-radius: .375rem;
  font: inherit;
}
input[type="checkbox"] { width: 20px; }
input[type="number"] { width: 80px; }

/* Accessible focus */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid #5aa7ff;
  outline-offset: 2px;
}

/* Tables */
.cart-table,
table.admin {
  width: 100%;
  border-collapse: collapse;
}
.cart-table th, .cart-table td,
table.admin th, table.admin td {
  border: 1px solid var(--border);
  padding: .5rem;
  text-align: left;
}
.flash .error{
	background: red;
}

/* Two-column layout */
.product-layout {
  display: grid;
  grid-template-columns: 1.1fr 1fr; /* image a bit wider */
  gap: 2rem;
  align-items: start;
}
@media (max-width: 860px) {
  .product-layout { grid-template-columns: 1fr; }
}

/* Image */
.product-media figure { margin: 0; }
.product-image {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
  object-fit: contain;
  background: #fafafa;
}
.product-image.placeholder {
  aspect-ratio: 1/1;
  display: grid;
  place-items: center;
  color: #999;
  border: 1px solid #eee;
}

/* Right column */
.product-title { margin-bottom: .5rem; }
.price {
  font-size: 1.25rem;
  font-weight: 600;
  margin: .25rem 0 1rem;
}
.price.muted { color: #888; font-weight: 400; }

/* Form */
.buy-form .field { display: block; margin: .75rem 0; }
.buy-form .field > span { display: block; font-size: .9rem; margin-bottom: .25rem; color: #555; }
.buy-form select,
.buy-form input[type="number"] {
  width: 100%;
  max-width: 320px;
  padding: .5rem .6rem;
  border: 1px solid #ddd;
  border-radius: 6px;
}
.buy-form .qty input { max-width: 120px; }
.buy-form .button {
  margin-top: .75rem;
}

/* Description */
.product-description {
  margin-top: 1.25rem;
  line-height: 1.6;
}


/* ================== Mobile ================== */
@media (max-width: 768px) {
  .inner {
    align-items: center;
    gap: .75rem;
  }
  .brand img { width: 200px; max-width: 60vw; }

  /* show burger on mobile */
  .nav-burger { display: block; margin-left: auto; }

  /* stack nav, hidden by default */
  .nav {
    position: absolute;
    top: 100%;               /* directly under header row */
    left: 0; right: 0;
    background: #000;
    border-top: 1px solid #eee;
    padding: .75rem 1rem;
    display: none;
    flex-direction: column;
    gap: .75rem;
    z-index: 1000;
  }
	.nav > ul.menu li {
		display: block;
	}

  /* make the header row relatively positioned so nav can anchor under it */
  .nav-container .inner { position: relative; }

  .submenu {
    position: static;            /* no absolute on mobile */
    display: none;               /* collapsed by default */
    border: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 0 0 .25rem 0;
    background: transparent;
  }

  /* Show submenu when the parent <li> is focused via keyboard or tapped (focus-within) */
  .menu > li.has-sub:focus-within > .submenu,
  .menu > li.has-sub:hover > .submenu {
    display: block;
  }

  /* Indent subitems a bit for hierarchy */
  .submenu a {
    padding: .4rem 0 .4rem 1rem;
  }

  /* Optional: rotate arrow on open (pure CSS, no JS) */
  .menu > li.has-sub:focus-within > a::after,
  .menu > li.has-sub:hover > a::after {
    content: "▴";
  }
	.nav > ul.menu > li.has-sub > a {
  pointer-events: none;
  cursor: default;
}
  .cart-link { margin-top: .25rem; }

  /* checkbox toggle: show nav when checked */
  .nav-toggle:checked ~ .nav { display: flex; }
	.site-header .top{
		padding: 1px;
		font-size: 10px;
	}
	input[type="number"] { width: 80% }
	.card form button{ margin: 15px auto }

	.site-footer .grid-col {
    flex: 1 1 100%; /* two columns */
  }
	.site-footer > .container > .grid-col:first-of-type {
    flex: 0 1 100%;  /* subtract half the gap to avoid wrapping */
    text-align: center;
  }

  /* Second column (text) = 70% */
  .site-footer > .container > .grid-col:nth-of-type(2) {
    flex: 1 1 100%;
    text-align: left;
  }
  .site-footer .copyrights {
    flex-basis: 100%;          /* force its own row */
    text-align: center;
	  font-size: 12px;
  }
  /* Optional: left-align text on desktop while keeping mobile centered */
  .site-footer .grid-col h3,
  .site-footer .grid-col p {
    text-align: center;
  }
	.nav-container img {
		height: 60vh;
	}
}

/* Optional: slightly tighter tablet layout */
@media (min-width: 769px) and (max-width: 1024px) {
  .brand img { width: 240px; }
  .menu { gap: .75rem; }
}
/* Make wide tables usable on phones (horizontal scroll) */
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
@media (max-width: 640px) {
  .cart-table, table.admin { display: block; width: max-content; min-width: 100%; }
}

/* Layout niceties on very small screens */
@media (max-width: 480px) {
  .site-header .container { flex-direction: column; align-items: flex-start; }
  .button, button { width: 100%; text-align: center; }
	.grid { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
}
/* Scale grid columns up on larger screens */
@media (min-width: 640px) {
  .grid { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
}
@media (min-width: 768px) {
  .grid { grid-template-columns: repeat(3, minmax(220px, 1fr)); }
	

}

/* Improve spacing around main content & footer */
main.container { padding-top: 1rem; padding-bottom: 2rem; }
.site-footer .container { padding-block: 1rem; }

/* Utility: constrain images in admin previews */
img.max-240 { max-width: 240px; height: auto; display: block; }

/* Optional: dark mode (respects user preference) */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000;
    --fg: #eaeaea;
    --muted: #9aa0a6;
    --card: #121212;
    --border: #2a2a2a;
    --brand: #e0e0e0;
    --brand-alt: #cfcfcf;
  }
  .button, button { color: #111; }
  .button:hover, button:hover { background: #bbb; }
  .site-header { background: #000; color: #eaeaea; }
  
	.site-header nav a { color: #cfcfcf; }
}


/* Fix: iOS Safari sometimes blocks vertical scroll when using overflow-x: clip */
html, body { overflow-x: hidden; }         /* replace `clip` with `hidden` */
html { width: 100%; }
body { -webkit-overflow-scrolling: touch; overscroll-behavior-y: auto; }

/* Headings with a trailing rule */
h1.rule {
  display: flex;
  align-items: center;
  gap: .6rem;              /* space between text and line */
  white-space: nowrap;     /* keep the title on one line */
}

h1.rule::after {
  content: "";
  flex: 1 1 auto;          /* fill the remaining width */
  height: 1px;
  background: #fff;/* line matches text color */
  opacity: 1;            /* soften if you like */
}
