/*
 Theme Name: Astra Child
 Template: astra
*/

/* ========== CSS CUSTOM PROPERTIES ========== */
:root {
  --mm-primary: #2b64ff;
  --mm-primary-hover: #1e4fd9;
  --mm-text-primary: #1a1a1a;
  --mm-text-secondary: #666666;
  --mm-text-muted: #999999;
  --mm-bg-primary: #ffffff;
  --mm-bg-secondary: #f8f9fa;
  --mm-bg-tertiary: #f1f3f4;
  --mm-border: #e1e5e9;
  --mm-border-light: #f0f0f0;
  --mm-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  --mm-shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.12);
  --mm-radius: 12px;
  --mm-radius-sm: 8px;
  --mm-radius-lg: 16px;
  --mm-transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --mm-font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* ========== GLOBAL STYLES ========== */
body {
  font-family: var(--mm-font-family);
  background-color: var(--mm-bg-primary);
  color: var(--mm-text-primary);
  line-height: 1.6;
}

/* ========== STICKY HEADER INTEGRATION ========== */
/* Don't interfere with Astra's header - let it handle its own positioning */
.site-header,
.ast-header,
header,
#masthead,
.ast-mobile-header-wrap {
  z-index: 999 !important;
}

/* Ensure header dropdowns appear above everything */
.site-header .sub-menu,
.ast-header .sub-menu,
header .sub-menu,
.site-header .dropdown-menu,
.ast-header .dropdown-menu,
header .dropdown-menu,
#masthead .sub-menu,
#masthead .dropdown-menu {
  z-index: 1000 !important;
}

/* Ensure proper stacking order - tabs below header */
.mm-sticky-nav {
  z-index: 50 !important;
}

/* ========== PAGE CONTAINER ========== */
.mm-page-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ========== PAGE HEADER ========== */
.mm-page-header {
  padding: 20px 0 0;
  border-bottom: none;
  margin-bottom: 0;
  margin-top: 0;
}

.mm-header-content {
  max-width: 1200px;
  margin: 0 auto;
}

.mm-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 14px;
  color: var(--mm-text-secondary);
}

.mm-breadcrumb__link {
  color: var(--mm-text-secondary);
  text-decoration: none;
  transition: var(--mm-transition);
}

.mm-breadcrumb__link:hover {
  color: var(--mm-primary);
}

.mm-breadcrumb__separator {
  color: var(--mm-text-muted);
}

.mm-breadcrumb__current {
  color: var(--mm-text-primary);
  font-weight: 500;
}

.mm-page-title {
  font-size: 32px;
  font-weight: 700;
  color: var(--mm-text-primary);
  margin: 0 0 12px 0;
  line-height: 1.2;
}

.mm-page-description {
  font-size: 16px;
  color: var(--mm-text-secondary);
  margin: 0;
  max-width: 600px;
}

/* ========== MODERN STICKY NAVIGATION ========== */
.mm-sticky-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100vw;
  z-index: 50;
  background: #282433;
  border-bottom: 1px solid #3a3447;
  margin-top: 0;
}

/* Tabs Row */
.mm-tabs-row {
  background: #282433;
  border-bottom: 1px solid #3a3447;
}

.mm-tabs-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Filters Row */
.mm-filters-row {
  background: #211d2b;
  border-bottom: 1px solid #3a3447;
}

.mm-filters-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 20px;
}

/* ========== TABS ========== */
.mm-tabs-container {
  flex: 1;
  min-width: 0;
}

.mm-tabs-scroll {
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.mm-tabs-scroll::-webkit-scrollbar {
  display: none;
}

.mm-tabs {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: max-content;
  padding: 4px 0;
}

.mm-tab {
  display: inline-flex;
  align-items: center;
  padding: 12px 24px;
  border: none;
  background: transparent;
  color: #b8b5c1;
  font-weight: 500;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  position: relative;
  text-decoration: none;
}

.mm-tab:hover {
  color: white;
  text-decoration: none;
}

.mm-tab:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(43, 100, 255, 0.1);
}

.mm-tab.is-active {
  color: white;
  font-weight: 600;
}

.mm-tab.is-active::after {
  content: '';
  position: absolute;
  bottom: -16px;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  height: 2px;
  background: #ffd700;
  border-radius: 1px;
}

.mm-tab.is-active:hover {
  background: var(--mm-primary-hover) !important;
  transform: translateY(-1px);
  text-decoration: none;
}

.mm-tab__label {
  pointer-events: none;
}

/* ========== MODERN FILTERS ========== */
.mm-search-filter {
  flex: 1;
  min-width: 0;
}

.mm-sort-filter {
  flex-shrink: 0;
}

.mm-clear-filters {
  flex-shrink: 0;
}

.mm-clear-link {
  color: #b8b5c1;
  text-decoration: underline;
  font-size: 14px;
  transition: color 0.2s ease;
}

.mm-clear-link:hover {
  color: white;
  text-decoration: underline;
}

.mm-sort__select {
  background: #332e3f;
  border: 1px solid #4a4554;
  border-radius: 6px;
  color: white;
  padding: 10px 12px;
  font-size: 14px;
  min-width: 180px;
  cursor: pointer;
  transition: all 0.2s ease;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 40px;
}

.mm-sort__select:focus {
  outline: none;
  border-color: #ffd700;
  box-shadow: 0 0 0 2px rgba(255, 215, 0, 0.2);
}

.mm-sort__select option {
  background: #332e3f;
  color: white;
  padding: 8px;
}

/* Override any conflicting styles */
.mm-search input[type="search"],
.mm-search input[type="text"],
.mm-search .mm-search__input {
  width: 200px !important;
  max-width: 200px !important;
  min-width: 200px !important;
  background: transparent !important;
  background-color: transparent !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  box-sizing: border-box !important;
  flex: none !important;
}

.mm-search {
  position: relative;
}

.mm-search__wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 200px !important;
  max-width: 200px !important;
}

.mm-search__icon {
  position: absolute;
  left: 12px;
  color: #b8b5c1;
  z-index: 2;
  pointer-events: none;
  width: 18px;
  height: 18px;
}

.mm-search__input {
  width: 100% !important;
  max-width: 300px !important;
  min-width: 200px !important;
  height: 40px !important;
  padding: 10px 12px 10px 40px !important;
  border: 1px solid #4a4554 !important;
  border-radius: 6px !important;
  background: #332e3f !important;
  background-color: #332e3f !important;
  color: white !important;
  font-size: 14px !important;
  transition: all 0.2s ease !important;
  box-sizing: border-box !important;
  flex: none !important;
}

.mm-search__input:focus {
  outline: none;
  border-color: var(--mm-primary);
  background: rgba(255, 255, 255, 0.1) !important;
  box-shadow: 0 0 0 3px rgba(43, 100, 255, 0.1);
}

.mm-search__input::placeholder {
  color: rgba(255, 255, 255, 0.7);
}

.mm-search__clear {
  position: absolute;
  right: 8px;
  width: 18px;
  height: 18px;
  border: none;
  background: none;
  color: rgba(102, 102, 102, 0.7);
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: var(--mm-transition);
}

.mm-search__clear:hover {
  background: rgba(255, 255, 255, 0.2);
  color: var(--mm-text-primary);
}

.mm-search__clear.is-visible {
  display: flex;
}

/* ========== MAIN CONTENT ========== */
.mm-main-content {
  padding: 140px 0 64px; /* Add top padding for fixed header */
  background: rgba(0, 0, 0, 0.05);
}

.mm-grid-container {
  max-width: 1200px;
  margin: 0 auto;
}

/* ========== PRODUCTS GRID ========== */
.mm-products-grid {
  position: relative;
}

.mm-products-grid.is-loading {
  opacity: 0.6;
  pointer-events: none;
}

.mm-products-grid.is-loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 32px;
  height: 32px;
  margin: -16px 0 0 -16px;
  border: 3px solid var(--mm-border);
  border-top: 3px solid var(--mm-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Fix WooCommerce grid layout */
ul.products {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px !important;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
}

ul.products.columns-4 {
  grid-template-columns: repeat(4, 1fr) !important;
}

/* Product cards */
ul.products li.product {
  background: transparent;
  border: none;
  border-radius: var(--mm-radius-lg);
  padding: 24px;
  transition: var(--mm-transition);
  position: relative;
  overflow: hidden;
}

ul.products li.product:hover {
  transform: translateY(-4px);
  box-shadow: var(--mm-shadow-hover);
  background: rgba(0, 0, 0, 0.02);
}

ul.products li.product img {
  width: 100%;
  height: auto;
  border-radius: var(--mm-radius-sm);
  margin-bottom: 16px;
}

ul.products li.product .woocommerce-loop-product__title {
  font-size: 16px;
  font-weight: 600;
  color: white;
  margin: 16px 0 8px 0;
  line-height: 1.4;
  padding: 0 4px;
}

ul.products li.product .price {
  font-size: 18px;
  font-weight: 700;
  color: var(--mm-primary);
  margin: 0;
  padding: 0 4px;
}

/* Make all product text white */
ul.products li.product,
ul.products li.product * {
  color: white !important;
}

ul.products li.product .price {
  color: var(--mm-primary) !important;
}

/* Remove add-to-cart buttons on archives */
ul.products .button,
ul.products .add_to_cart_button,
ul.products a.ajax_add_to_cart {
  display: none !important;
}

/* ========== MAIN CATEGORIES GRID (SHOP PAGE) ========== */
body.woocommerce-shop ul.products li.product-category {
  overflow: hidden;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  position: relative;
}

body.woocommerce-shop ul.products li.product-category a {
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  display: flex;
  flex-direction: column;
  text-decoration: none;
}

/* Remove all custom styling from category images - let theme handle them */

/* Category title styling - below image */
body.woocommerce-shop ul.products li.product-category .woocommerce-loop-category__title,
body.woocommerce-shop ul.products li.product-category h2,
body.woocommerce-shop ul.products li.product-category h3 {
  color: black !important;
  background: white !important;
  padding: 12px 16px !important;
  margin: 0 !important;
  font-size: 16px !important;
  font-weight: 600 !important;
  text-align: center !important;
  border-radius: 0 0 var(--mm-radius-sm) var(--mm-radius-sm);
  position: relative;
  z-index: 2;
}

/* Remove any overlay positioning */
body.woocommerce-shop ul.products li.product-category .woocommerce-loop-category__title,
body.woocommerce-shop ul.products li.product-category h2,
body.woocommerce-shop ul.products li.product-category h3 {
  position: static !important;
  transform: none !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
}

body.woocommerce-shop ul.products {
  display: grid !important;
  gap: 24px !important;
  grid-template-columns: repeat(6, 1fr) !important;
}

/* Additional category card styling */
body.woocommerce-shop ul.products li.product-category {
  border-radius: var(--mm-radius-sm);
  overflow: hidden;
  background: white;
  box-shadow: var(--mm-shadow);
  transition: var(--mm-transition);
}

body.woocommerce-shop ul.products li.product-category:hover {
  transform: translateY(-4px);
  box-shadow: var(--mm-shadow-hover);
}

/* Ensure no overlay effects */
body.woocommerce-shop ul.products li.product-category::before,
body.woocommerce-shop ul.products li.product-category::after {
  display: none !important;
}

/* Remove any absolute positioning from category titles */
body.woocommerce-shop ul.products li.product-category * {
  position: static !important;
  transform: none !important;
}

/* ========== RESPONSIVE DESIGN ========== */
@media (max-width: 1200px) {
  .mm-page-container {
    padding: 0 20px;
  }
  
  .mm-nav-container {
    gap: 20px;
  }
  
  .mm-search__input {
    width: 180px !important;
    max-width: 180px !important;
  }
  
  ul.products {
    grid-template-columns: repeat(3, 1fr);
  }
  
  body.woocommerce-shop ul.products {
    grid-template-columns: repeat(5, 1fr) !important;
  }
}

@media (max-width: 900px) {
  .mm-page-title {
    font-size: 28px;
  }
  
  .mm-filters-container {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  
  .mm-sort__select {
    min-width: 100%;
  }
  
  .mm-search__input {
    max-width: 100% !important;
  }
  
  ul.products {
    grid-template-columns: repeat(2, 1fr);
  }
  
  body.woocommerce-shop ul.products {
    grid-template-columns: repeat(3, 1fr) !important;
  }
}

@media (max-width: 600px) {
  .mm-page-container {
    padding: 0 16px;
  }
  
  .mm-page-header {
    padding: 24px 0 20px;
  }
  
  .mm-page-title {
    font-size: 24px;
  }
  
  .mm-main-content {
    padding: 140px 0 40px; /* Add top padding for fixed header with controls on mobile */
  }
  
  ul.products {
    grid-template-columns: 1fr !important;
    gap: 16px;
  }
  
  body.woocommerce-shop ul.products {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 420px) {
  body.woocommerce-shop ul.products {
    grid-template-columns: 1fr !important;
  }
}

/* Force search bar styling - highest specificity */
.mm-page-container .mm-sticky-nav .mm-nav-container .mm-search-container .mm-search .mm-search__wrapper .mm-search__input {
  width: 200px !important;
  max-width: 200px !important;
  min-width: 200px !important;
  background: transparent !important;
  background-color: transparent !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  box-sizing: border-box !important;
  flex: none !important;
  display: block !important;
}

/* Additional override for any theme conflicts */
input.mm-search__input[type="search"] {
  width: 200px !important;
  max-width: 200px !important;
  background: transparent !important;
  background-color: transparent !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

/* Force tab transparency - highest specificity */
.mm-page-container .mm-sticky-nav .mm-nav-container .mm-tabs-container .mm-tabs .mm-tab {
  background: transparent !important;
  background-color: transparent !important;
  color: rgba(255, 255, 255, 0.8) !important;
}

.mm-page-container .mm-sticky-nav .mm-nav-container .mm-tabs-container .mm-tabs .mm-tab.is-active {
  background: var(--mm-primary) !important;
  background-color: var(--mm-primary) !important;
  color: white !important;
}

/* Override any Astra theme styles that might interfere */
#page .mm-tab,
#page .mm-sticky-nav .mm-tab,
.ast-container .mm-tab {
  background: transparent !important;
  background-color: transparent !important;
  color: rgba(255, 255, 255, 0.8) !important;
}

#page .mm-tab.is-active,
#page .mm-sticky-nav .mm-tab.is-active,
.ast-container .mm-tab.is-active {
  background: var(--mm-primary) !important;
  background-color: var(--mm-primary) !important;
  color: white !important;
}
