/* ============================================================================
   BRITGOLF.CO.UK - CLEAN FLAT TILE DESIGN (Optimized)
   ============================================================================ */

:root {
  --primary-green: #01481c;
  --secondary-green: #1e5631;
  --accent-red: #d81e24;
  --light-green: #ecf9f0;
  --white: #ffffff;
  --gray: #7f8c8d;
  --dark: #2c3e50;
  --border: #dfe4e8;
  --text-secondary: black;
}

/* RESET & BASE */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  line-height: 1.6;
  color: var(--dark);
  background-color: var(--white);
}

/* HEADER */
.header {
  background: var(--primary-green);
  color: #fff;
  padding: 0.2rem 0;
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
}

.logo {
  font-size: 2.5rem;
  font-weight: 300;
  letter-spacing: 1px;
}

.tagline {
	display: none;
  font-size: 1rem;
  opacity: 0.9;
}

.site-logo {
  max-width: 130px;
  height: auto;
  display: block;
  margin: 0.3rem auto;
}

@media (max-width: 768px) {
  .site-logo {
    max-width: 130px;
  }
}

@media (max-width: 480px) {
  .site-logo {
    max-width: 130px;
  }
}

/* MAIN CONTAINER */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 0.5rem;
}

/* CONTROLS */
.controls {
  background: var(--white);
  padding: 0.5rem;
  margin: 0.5rem 0;
  border: 1px solid var(--border);
  border-radius: 4px;
}

.search-input {
  width: 100%;
  padding: 0.4rem;
  border: 1px solid var(--border);
  font-size: 1rem;
  transition: border-color 0.2s;
	margin-bottom: 0rem;
	border-radius: 4px;
}

.search-input:focus {
  border-color: var(--primary-green);
  outline: none;
}

.section-title {
  font-size: 0.6rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin: 0.2rem 0 0.2rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.category-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
	min-height: 150px;
}

.category-btn {
  padding: 0.5rem 0.5rem;
  border: 1px solid var(--border);
  background: var(--white);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.9rem;
  border-radius: 4px;
  font-weight: bold;
  color: var(--primary-green);
}


.category-btn.active {
  background: var(--primary-green);
  color: #fff;
  border-color: var(--primary-green);
}

.category-btn:hover:not(.active) {
  background: var(--light-green);
  border-color: var(--primary-green);
}

.sort-container {
  margin-top: 0.1rem;
}

.sort-select {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid var(--border);
  background: var(--white);
  font-size: 0.95rem;
  cursor: pointer;
  transition: border-color 0.2s ease;
	min-width: 180px; /* stabilizes size before font renders */
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.2;
}

.sort-select:focus {
  outline: none;
  border-color: var(--primary-green);
}

.filter-section {
  min-height: 60px; /* reserve space */
  padding: 0.2rem 0;
  margin-bottom: 0rem;
}



html { scroll-behavior: smooth; }
.product-card { scroll-margin-top: 80px; } /* match your sticky header height */
.product-card:target,
.target-highlight { outline: 2px solid var(--primary-green); outline-offset: 2px; }

  #scrollTopBtn {
  position: fixed;
  top: 20px;
  right: 20px;
  /* everything else can stay the same */
  z-index: 999;
  background-color: #01481c;
  color: white;
  border: none;
  border-radius: 50%;
  width: 45px;
  height: 45px;
  font-size: 22px;
  cursor: pointer;
  box-shadow: 0 3px 8px rgba(0,0,0,0.3);
  display: none;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s, transform 0.3s;
}

#scrollTopBtn.show {
  display: flex;
  opacity: 0.95;
}

#scrollTopBtn:hover {
  transform: translateY(-3px);
  opacity: 1;
}

#scrollTopBtn:focus {
  outline: 2px solid #fff;
  outline-offset: 2px;
}


/* HAMBURGER */
.hamburger {
  position: absolute;
  top: 18px;
  left: 18px;
  width: 26px;
  height: 20px;
  cursor: pointer;
  z-index: 1101;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.hamburger span {
  display: block;
  height: 3px;
  background: #fff;
  border-radius: 2px;
  transition: 0.3s;
}

/* SIDENAV */
.sidenav {
  position: fixed;
  top: 0;
  left: 0;
  height: 100%;
  width: 300px;                  /* Keep a fixed width now */
  background: var(--dark);
  overflow-x: hidden;
  z-index: 1100;
  color: #fff;
	will-change: transform;

  transform: translateX(-100%);  /* Start hidden off-screen */
  transition: transform 0.3s ease;
}

.sidenav.open {
  transform: translateX(0);      /* Slide in smoothly */
}

.sidenav:not(.open) {
  transform: translateX(-100%) !important;
  visibility: hidden;
}

.closebtn {
  position: absolute;
  top: 15px;
  right: 20px;
  background: none;
  border: none;
  color: #fff;
  font-size: 30px;
  cursor: pointer;
}

.sidenav-content {
  padding: 2rem;
  font-size: 0.8rem;
  line-height: 1.7;
}

.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1099;
  display: none;
}

.overlay.show {
  display: block;
}

/* PRODUCTS GRID */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
  margin-bottom: 2rem;
	min-height: 100px;
}

.product-card {
  background: var(--white);
  border-radius: 4px;
  border: 1px solid var(--border);
  padding: 1rem;
  padding-bottom: 4rem;
  position: relative;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
  min-height: 300px; /* Reserve space to avoid CLS */
}

.product-image {
  width: 100%;
  height: 200px;
  object-fit: contain;
  background: var(--white);
  border-radius: 3px;
  aspect-ratio: 3 / 2; /* Ensures consistent size across devices */
}

.product-card:hover {
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  transform: translateY(-3px);
}

.discount-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--accent-red);
  color: #fff;
  font-weight: 600;
  font-size: 0.8rem;
  padding: 0.25rem 0.6rem;
  border-radius: 3px;
}


.product-title {
  font-size: 0.7rem;
  font-weight: 600;
  margin: 0.4rem 0;
  color: var(--dark);
}

.product-category {
  display: inline-block;
  background: var(--light-green);
  color: var(--primary-green);
  padding: 0.3rem 0.7rem;
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: 3px;
  margin-bottom: 0.4rem;
}

.discount-price {
  color: var(--primary-green);
  font-size: 1.5rem;
  font-weight: 700;
  margin-right: 0.5rem;
}

.original-price {
  text-decoration: line-through;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* BUTTON */
.shop-btn {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 0.9rem;
  border: none;
  background: var(--primary-green);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 0 0 4px 4px;
  transition: background 0.2s ease;
	display: block;
	text-align: center;
	text-decoration: none;
}

.shop-btn:hover {
  background: var(--secondary-green);
}

.category-btn:focus-visible,
.sort-select:focus-visible,
.shop-btn:focus-visible,
.closebtn:focus-visible,
.hamburger:focus-visible {
  outline: 2px solid var(--primary-green);
  outline-offset: 2px;
}

.share-btn {
  position: absolute;
  bottom: 50px;
  right: 8px;
  background: #01481c;
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;              /* icon inherits this */
  transition: background 0.2s ease, transform 0.1s ease;
  z-index: 2;
}

.share-btn svg {
  stroke: currentColor;     /* makes the SVG follow .share-btn color */
}

.share-btn:hover {
  background: var(--primary-green);
  transform: scale(1.05);
}

.share-btn:focus-visible {
  outline: 2px solid var(--primary-green);
  outline-offset: 2px;
}

/* NO RESULTS */
.no-results {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--text-secondary);
}

.footer {
  position: relative;
  width: 100%;
  min-height: 80px;  /* Reserve space for the footer before it renders */
  background: var(--dark);
  color: #fff;
  font-size: 0.9rem;
  text-align: center;
  padding: 1rem 0;
  line-height: 1.4;
  box-sizing: border-box;
}

/* RESPONSIVE */
@media (max-width: 768px) {
  .logo { font-size: 2rem; }
  .products-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
}

@media (max-width: 480px) {
  .products-grid { grid-template-columns: repeat(2, 1fr); gap: 6px; }
  .product-card { padding: 0.5rem; padding-bottom: 3.5rem; }
  .product-image { height: 130px; }
  .discount-price { font-size: 1.2rem; }
  .shop-btn { padding: 0.7rem; font-size: 0.75rem; }
}