/*
Theme Name: Cubed Theme
Theme URI: https://example.com/cubed-theme
Author: Your Name
Author URI: https://example.com
Description: Classic (non-Gutenberg) theme with extensive color customization using CSS variables exposed in the Customizer.
Version: 1.0.0
Requires at least: 5.0
Tested up to: 6.9
Text Domain: cubed-theme
Tags: custom-colors, custom-logo, custom-menu, accessibility-ready, responsive-layout
*/

:root {
  --site-bg: rgba(255, 255, 255, 0.75);
  --site-text: #222222;
  --link-color: #0066cc;
  --link-hover: #004999;
  --accent: #ff6b6b;
  --header-bg: #ffffff;
  --footer-bg: #ffffff;
  --button-bg: var(--accent);
  --button-text: #ffffff;
}

html,
body {
  height: 100%;
}

body {
  background: var(--site-bg);
  color: var(--site-text);
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.5;
  margin: 0;
  padding: 0;

  /* Ensure the page fills the viewport and allow footer to sit at page bottom. */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a {
  color: var(--link-color);
}

a:hover {
  color: var(--link-hover);
}

header.site-header {
  height: var(--header-height);
  display: flex;
  align-items: center;
  padding: 0 1rem;
  background: var(--header-bg);
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 1020;
}

.site-logo{
    overflow: visible !important; 
}

.site-branding {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-logo {
  height: var(--header-height);
  overflow: hidden;
  display: flex;
  align-items: center;
}
.site-logo .custom-logo-link {
  display: block;
  height: 100%;
}
.site-logo .custom-logo,
.site-logo img,
.site-logo svg {
  height: 100%;
  width: auto;
  max-width: none;
  object-fit: cover;
  display: block;
}

.site-title {
  font-size: 1.25rem;
  margin: 0;
}

.site-navigation {
  margin-left: 1rem;
}

.site-navigation ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 1rem;
}


.site-content {
  max-width: 1200px;
  width: 100%;
  margin: 2rem auto;
  padding: 1.5rem; /* reduced default padding to avoid internal squish */
  box-sizing: border-box;
  flex: 1 0 auto; /* Grow to fill available space so footer is pushed to the bottom. */
  background: var(--site-bg);
  border-radius: 8px;
  text-align: center;
}

/* Larger screens get a bit more breathing room */
@media (min-width: 1200px) {
  .site-content {
    padding: 2rem 2.5rem;
  }
}

/* Reduce margins/padding on small screens to avoid horizontal overflow and squish */
@media (max-width: 600px) {
  .site-content {
    margin: 1rem auto;
    padding: 1rem;
  }
}

/* Legacy inner wrapper kept for compatibility; prefer using .site-content */
.content-inner {
  display: block;
}

.custom-logo-link {
  display: flex;
  align-items: center;
  margin-right: 10px;
}

.custom-logo {
  max-height: 8vh;
  width: auto;
}

.site-footer {
  background: var(--footer-bg);
  color: var(--site-text);
  position: -webkit-sticky;
  position: sticky;
  bottom: 0;
  z-index: 1020;
  min-height: 12vh;
  flex-shrink: 0; /* Prevent footer from shrinking when using flex layout. */
}


.button {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: var(--button-bg);
  color: var(--button-text);
  text-decoration: none;
  border-radius: 4px;
}

/* utility */
.alignwide {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

a.mega-menu-link {
  font-size: 2.5vh !important;
  padding: 0 0.3rem !important;
}

.tabs.wc-tabs {
  display: none;
}

.cart-price {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 1rem;
}

.price {
  font-size: 1.5rem;
  font-weight: bold;
  display: inline-block;
}

.add-to-cart {
  display: inline-block;
}

form.cart {
  margin-bottom: 0 !important;
}

.single_add_to_cart_button {
  padding: 0.5rem 1rem;
  background: var(--button-bg) !important;
}

/* Prevent add-to-cart button from stretching unexpectedly */
.add-to-cart,
.single_add_to_cart_button {
  display: inline-block !important;
  width: auto !important;
  max-width: 100%;
  box-sizing: border-box;
  font-size: 1rem;
  padding: 0.5rem 1rem;
}

/* If some layout forces buttons to stretch via flexbox, avoid stretch */
.single_add_to_cart_button { align-self: flex-start; }

input.input-text.qty.text {
  padding: 0.5rem 0.1rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  width: 1.8rem;
}

/* Menu search toggle styles */
.cubed-menu-search{position:relative;display:inline-flex;align-items:center}
.cubed-menu-search-toggle{background:none;border:0;padding:0;cursor:pointer;font-size:1.1rem}
/* Make the panel absolutely positioned so expanding it does not affect layout */
.cubed-menu-search-panel{position:absolute;left:100%;top:50%;transform:translateY(-50%);overflow:hidden;width:0;transition:width .18s ease;box-sizing:border-box;z-index:200}
.cubed-menu-search.open .cubed-menu-search-panel{width:220px}
.cubed-menu-search-form{display:flex;gap:.5rem;align-items:center}
.cubed-menu-search-form input[type="search"]{padding:.4rem .6rem;border:1px solid #ddd;border-radius:4px;width:100%;box-sizing:border-box}
.cubed-menu-search-form .cubed-menu-search-submit{padding:.4rem .6rem;background:var(--button-bg);color:var(--button-text);border:0;border-radius:4px}

/* (Shop grid styles removed) */

/* Cubed products grid minimal styles */
.cubed-products-grid{display:flex;flex-wrap:wrap;gap:1rem;list-style:none;padding:0;margin:0}
.cubed-products-grid .product{width:calc(25% - 1rem);box-sizing:border-box;border:1px solid #eee;padding:.75rem;background:#fff}
.cubed-product-card .cubed-product-link{color:inherit;text-decoration:none;display:block}
.cubed-product-card img{max-width:100%;height:auto;display:block;margin-bottom:.5rem}
.cubed-product-meta{display:flex;justify-content:space-between;align-items:center;gap:.5rem;margin-top:.5rem}
.cubed-filters-row{display:flex;gap:.5rem;flex-wrap:wrap;align-items:center;margin-bottom:1rem}
.cubed-filters-row input, .cubed-filters-row select{padding:.4rem;border:1px solid #ddd;border-radius:4px}
.cubed-filter-apply{padding:.4rem .6rem;background:var(--button-bg);color:var(--button-text);border:0;border-radius:4px;cursor:pointer;transition:transform .08s ease,opacity .12s ease}
.cubed-filter-apply:hover{opacity:.95;transform:translateY(-1px)}
.cubed-filter-apply:focus{outline:2px solid rgba(0,0,0,0.12);outline-offset:2px}
.cubed-filter-apply[disabled]{cursor:not-allowed;opacity:0.6}

/* Visual feedback for AJAX updates */
.cubed-shop-results.cubed-grid-updated{box-shadow:0 6px 20px rgba(0,0,0,0.09) inset;border-radius:6px;animation:cubed-grid-flash .7s ease}
@keyframes cubed-grid-flash{0%{background:transparent}50%{background:rgba(255,255,0,0.06)}100%{background:transparent}}

/* Hide block-based cart product metadata (mini-cart / cart blocks) */
.wc-block-components-product-metadata,
.wc-block-cart .wc-block-components-product-metadata,
.wc-block-mini-cart__products-table .wc-block-components-product-metadata,
.wc-block-cart-items .wc-block-components-product-metadata {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
}
