/*
Theme Name: All Good Gifts
Theme URI: www.allgoodgifts.co.za
Template: Walleto
Author: Joshua J Heeley
Author URI: www.allgoodgifts.co.za
Description: Child theme of Walleto for All Good Gifts
Version: 2.1
Updated: 2025-06-12
*/

/* ===== CSS Variables ===== */
:root {
  /* Colors */
  --primary-color: #0caab1;
  --primary-dark: #188d88;
  --secondary-color: #20b2aa;
  --accent-color: #f78b42;
  --accent-dark: #e06c20;
  --text-dark: #222;
  --text-medium: #333;
  --text-light: #f2f2f2;
  --bg-light: #f9f9f9;
  --bg-paper: #fdf9f4;
  --white: #fff;
  --black: #000;
  --border-color: #eee;
  --overlay: rgba(0, 0, 0, 0.4);
  
  /* Shadows */
  --shadow: 0 10px 20px rgba(0,0,0,0.1);
  --shadow-light: 0 2px 8px rgba(0,0,0,0.05);
  --shadow-hover: 0 10px 25px rgba(0,0,0,0.1);
  
  /* Typography */
  --font-main: "Poppins", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-size-base: 16px;
  --line-height-base: 1.6;
  
  /* Spacing */
  --space-xs: 5px;
  --space-sm: 10px;
  --space-md: 15px;
  --space-lg: 20px;
  --space-xl: 30px;
  
  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-medium: 0.3s ease;
  --transition-slow: 0.5s ease;
}

/* ===== Base Styles ===== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: local('Poppins Regular'), url('/fonts/poppins-regular.woff2') format('woff2');
}

html {
  scroll-behavior: smooth;
  font-size: var(--font-size-base);
}

body {
  font-family: var(--font-main);
  line-height: var(--line-height-base);
  color: var(--text-medium);
  background-color: var(--bg-light);
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ===== Typography ===== */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: var(--space-md);
  line-height: 1.2;
}

h1 { font-size: clamp(2rem, 5vw, 3rem); }
h2 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h3 { font-size: clamp(1.5rem, 3.5vw, 2rem); }
h4 { font-size: clamp(1.25rem, 3vw, 1.75rem); }

p {
  margin-bottom: var(--space-md);
  color: var(--text-medium);
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

/* ===== Layout ===== */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.site-width {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

/* ===== Header Styles ===== */
.agg-header {
  background: var(--white);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow-light);
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-md);
  padding: var(--space-sm) 0;
}

/* Logo */
.logo a {
  font-size: 1.5rem;
  color: var(--primary-color);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

/* Navigation Group */
.nav-group {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  flex: 1;
  justify-content: flex-end;
}

/* Category Dropdown */
.category-dropdown-container {
  position: relative;
}

.category-btn {
  background: none;
  border: none;
  color: var(--primary-color);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-md);
  border-radius: 4px;
  transition: background var(--transition-fast);
}

.category-btn:hover {
  background: rgba(12, 170, 177, 0.1);
}

.backdrop-blur {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  backdrop-filter: blur(5px);
  background: var(--overlay);
  z-index: 999;
  display: none;
}

.backdrop-blur.active {
  display: block;
}

.category-menu {
  position: absolute;
  top: 100%;
  left: 0;
  width: 260px;
  background: var(--white);
  box-shadow: var(--shadow);
  border-radius: 10px;
  padding: var(--space-sm) 0;
  display: none;
  z-index: 1001;
  max-height: 70vh;
  overflow-y: auto;
}

.category-menu.active {
  display: block;
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.category-menu ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.category-menu li {
  padding: var(--space-sm) var(--space-lg);
  transition: background var(--transition-fast);
}

.category-menu li a {
  color: var(--text-medium);
  display: block;
}

.category-menu li:hover {
  background: rgba(0, 0, 0, 0.03);
}

/* Search Form */
.search-form {
  display: flex;
  border-radius: 30px;
  overflow: hidden;
  border: 1px solid #ccc;
  background: var(--white);
  flex: 1;
  max-width: 400px;
}

.search-form input {
  padding: var(--space-sm) var(--space-md);
  border: none;
  outline: none;
  width: 100%;
  font-size: 0.95rem;
}

.search-btn {
  background: var(--primary-color);
  border: none;
  padding: 0 var(--space-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-medium);
}

.search-btn:hover {
  background: var(--primary-dark);
}

/* User Icons */
.user-icons {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.user-icons a {
  color: var(--text-medium);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  position: relative;
}

.user-icons img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.cart-count {
  background: var(--primary-color);
  color: var(--white);
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: 0.7rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: -5px;
  right: -8px;
}

/* Main Navigation */
.menu-row {
  display: flex;
  justify-content: center;
  gap: var(--space-lg);
  padding: var(--space-sm) 0;
  background: var(--white);
  border-top: 1px solid var(--border-color);
  overflow-x: auto;
  scrollbar-width: none;
}

.menu-row::-webkit-scrollbar {
  display: none;
}

.menu-row a {
  color: var(--text-medium);
  font-weight: 500;
  font-size: 0.95rem;
  padding: var(--space-xs) 0;
  position: relative;
  white-space: nowrap;
}

.menu-row a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary-color);
  transition: width var(--transition-medium);
}

.menu-row a:hover::after {
  width: 100%;
}

/* ===== Main Content ===== */
.agg-main {
  flex: 1;
  padding: var(--space-xl) 0;
}

/* ===== Product Grid ===== */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: var(--space-lg);
  margin: var(--space-xl) 0;
}

.product-card {
  background: var(--white);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow-light);
  transition: all var(--transition-medium);
  will-change: transform, box-shadow;
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
}

.product-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

.product-info {
  padding: var(--space-md);
}

.product-title {
  font-size: 1rem;
  margin-bottom: var(--space-xs);
}

.product-price {
  color: var(--secondary-color);
  font-weight: 600;
  font-size: 1.1rem;
}

/* ===== Buttons ===== */
button, .button, input[type="submit"] {
  background: var(--secondary-color);
  color: var(--white);
  padding: var(--space-sm) var(--space-md);
  border: none;
  border-radius: 6px;
  font-family: var(--font-main);
  font-size: 1rem;
  cursor: pointer;
  transition: all var(--transition-medium);
}

button:hover, .button:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
}

button:active, .button:active {
  transform: scale(0.98);
}

button:focus, .button:focus, input:focus, a:focus {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}

/* ===== Footer ===== */
.site-footer {
  background: var(--text-dark);
  color: var(--white);
  padding: var(--space-xl) 0;
  margin-top: auto;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: var(--space-lg);
  margin-bottom: var(--space-md);
}

.footer-links a {
  color: var(--white);
}

.copyright {
  font-size: 0.9rem;
  opacity: 0.8;
  text-align: center;
}

/* ===== Responsive Styles ===== */
@media (max-width: 992px) {
  .nav-group {
    gap: var(--space-sm);
  }
  
  .search-form {
    max-width: 300px;
  }
}

@media (max-width: 768px) {
  .header-container {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-sm);
  }
  
  .nav-group {
    order: 2;
    flex-wrap: wrap;
    justify-content: space-between;
  }
  
  .search-form {
    order: 3;
    max-width: 100%;
    margin-top: var(--space-sm);
  }
  
  .menu-row {
    display: none;
  }
  
  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }
}

@media (max-width: 576px) {
  .user-icons a span {
    display: none;
  }
  
  .product-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== Dark Mode ===== */
@media (prefers-color-scheme: dark) {
  :root {
    --text-dark: #f2f2f2;
    --text-medium: #e0e0e0;
    --bg-light: #121212;
    --white: #1e1e1e;
    --border-color: #333;
  }
  
  .agg-header {
    background: #1a1a1a;
    border-bottom-color: #333;
  }
  
  .search-form {
    background: #2a2a2a;
    border-color: #444;
  }
  
  input {
    background: #2a2a2a;
    color: #fff;
  }
}

/* ===== Print Styles ===== */
@media print {
  .no-print {
    display: none !important;
  }
  
  body {
    background: white !important;
    color: black !important;
    font-size: 12pt;
  }
  
  a::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    font-weight: normal;
  }
}/* =========================================
   Centre Everything Else in the Page
   ========================================= */

/* Wrap the main content (#main) in the same fixed-width container */
.agg-main,
#main,
#content {
  max-width: 1200px;
  margin: 0 auto;     /* centre horizontally */
  padding: 20px;      /* breathing room */
  box-sizing: border-box;
}

/* Remove default list bullets and tighten up the layout */
#main ul {
  list-style: none;
  padding: 0;
  margin: 0 0 20px 0;
}

/* Style the “Latest Products” heading and product list */
#main h2,
#main h3 {
  margin-top: 0;
}
#main .woocommerce ul.products {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}
#main .woocommerce ul.products li.product {
  flex: 0 0 calc(25% - 20px);
  box-sizing: border-box;
  list-style: none;
  margin: 0;
  padding: 0;
}
@media (max-width: 768px) {
  #main .woocommerce ul.products li.product {
    flex: 0 0 calc(50% - 20px);
  }
}
@media (max-width: 480px) {
  #main .woocommerce ul.products li.product {
    flex: 0 0 100%;
  }
}

/* Clean up fallback “Browse” list */
#main .browse-list {
  max-width: 1200px;
  margin: 40px auto;
  padding: 0 20px;
}
#main .browse-list ul {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
}
#main .browse-list ul li {
  list-style: none;
}
#main .browse-list ul li a {
  color: #0ba7b5;
  text-decoration: none;
  font-weight: 500;
}
#main .browse-list ul li a:hover {
  text-decoration: underline;
}

/* Footer centring */
#footer,
#colophon,
#site-info {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  box-sizing: border-box;
  text-align: center;
}
/* Highlight Categories Button */
.category-btn {
  background-color: #20b2aa !important;  /* solid teal */
  color: #fff !important;               /* white text */
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: 600;
  border: none;
  transition: background 0.3s ease;
}

.category-btn:hover {
  background-color: #188d88 !important; /* darker on hover */
}
