/* =========================================================
   ASHE SHOP CSS
   Clean compiled version - Square Aspect Ratio Update
   ========================================================= */


/* =========================================================
   1. GLOBAL SHOP / ARCHIVE LAYOUT
   ========================================================= */



#secondary,
.widget-area,
.sidebar,
.right-sidebar #secondary,
.left-sidebar #secondary,
.post-type-archive-product #secondary,
.tax-product_cat #secondary,
.tax-product_tag #secondary,
.woocommerce-page #secondary,
.woocommerce #secondary {
  display: none !important;
}

#primary,
.content-area,
.right-sidebar #primary,
.left-sidebar #primary,
.full-width #primary,
.post-type-archive-product #primary,
.tax-product_cat #primary #primary,
.tax-product_tag #primary,
.woocommerce-page #primary,
.woocommerce #primary,
.post-type-archive-product .content-area,
.tax-product_cat .content-area,
.tax-product_tag .content-area,
.woocommerce-page .content-area,
.woocommerce .content-area {
  width: 100% !important;
  max-width: 100% !important;
  float: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

.site-content,
.site-main,
.post-type-archive-product .site-main,
.tax-product_cat .site-main,
.tax-product_tag .site-main {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
}

.right-sidebar .content-area,
.left-sidebar .content-area,
.right-sidebar .widget-area,
.left-sidebar .widget-area {
  margin: 0 !important;
}


/* =========================================================
   2. SHOP LANDING PAGE
   ========================================================= */

.ashe-shop-landing {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 18px 40px;
}

.ashe-shop-landing__hero {
  margin-bottom: 30px;
}

.ashe-shop-landing__hero h1 {
  margin: 0 0 8px;
  font-size: 2rem;
}

.ashe-shop-landing__hero p {
  margin: 0;
  color: #5a5a5a;
  font-size: 1rem;
  line-height: 1.6;
}

.ashe-shop-landing__categories,
.ashe-shop-landing__featured,
.ashe-shop-landing__brands {
  margin-bottom: 34px;
}

.ashe-shop-landing__categories h2,
.ashe-shop-landing__featured h2,
.ashe-shop-landing__brands h2 {
  margin-bottom: 14px;
  font-size: 1.35rem;
}

.ashe-shop-landing__highlights {
  margin-bottom: 34px;
}

.ashe-shop-landing__card {
  height: 100%;
  background: #ffffff;
  border: 1px solid #e7e7e7;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.04);
}

.ashe-shop-landing__card h3 {
  margin: 0 0 8px;
  font-size: 1.05rem;
}

.ashe-shop-landing__card p {
  margin: 0;
  color: #5d5d5d;
  line-height: 1.55;
  font-size: 0.92rem;
}

.ashe-shop-landing .wp-block-button__link {
  background: #1b16e6;
  color: #fff;
  border-radius: 4px;
  font-weight: 700;
  text-decoration: none;
}


/* =========================================================
   3. SHORTCODE PRODUCT / CATEGORY GRIDS ON LANDING PAGE
   ========================================================= */

.ashe-shop-landing ul.products {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ashe-shop-landing ul.products li.product,
.ashe-shop-landing ul.products li.product-category {
  width: 100% !important;
  float: none !important;
  clear: none !important;
  margin: 0 !important;
}


/* =========================================================
   4. PRODUCT ARCHIVE / CATEGORY TILE GRID
   Matches the visual style of the reference image
   ========================================================= */

.ashe-shop-archive-categories {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0;
}

.ashe-shop-archive-categories ul.products,
.woocommerce .ashe-shop-archive-categories ul.products {
  display: grid !important;
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  gap: 12px !important;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
}

/* kill old WooCommerce float/first/last behaviour */
.woocommerce ul.products[class*="columns-"] li.product,
.woocommerce ul.products[class*="columns-"] li.product-category,
.ashe-shop-archive-categories ul.products li.product,
.ashe-shop-archive-categories ul.products li.product-category {
  float: none !important;
  clear: none !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}

.woocommerce ul.products li.first,
.woocommerce ul.products li.last,
.ashe-shop-archive-categories ul.products li.first,
.ashe-shop-archive-categories ul.products li.last {
  clear: none !important;
}

/* tile card container */
.ashe-shop-archive-categories ul.products li.product-category,
.woocommerce .ashe-shop-archive-categories ul.products li.product-category {
  border: 2px solid #1f73ea !important;
  border-radius: 18px !important;
  overflow: hidden !important;
  background: #f3f3f3 !important;
  position: relative !important;
  box-sizing: border-box !important;
  /* Ensure the entire card maintains a square shape */
  aspect-ratio: 1 / 1 !important;
}

/* link wrapper */
.ashe-shop-archive-categories ul.products li.product-category > a,
.woocommerce .ashe-shop-archive-categories ul.products li.product-category > a {
  display: block !important;
  height: 100% !important;
  width: 100% !important;
  position: relative !important;
  text-decoration: none !important;
  color: inherit !important;
}

/* category image - UPDATED FOR SQUARE RATIO */
.ashe-shop-archive-categories ul.products li.product-category img,
.woocommerce .ashe-shop-archive-categories ul.products li.product-category img {
  width: 100% !important;
  height: 100% !important; /* Forces height to match the square container */
  object-fit: cover !important; /* Crops image to fill square without stretching */
  display: block !important;
  margin: 0 !important;
  border: 0 !important;
  padding: 0 !important;
  background: #e9e9e9 !important;
}

/* title overlay */
.ashe-shop-archive-categories ul.products li.product-category .woocommerce-loop-category__title,
.woocommerce .ashe-shop-archive-categories ul.products li.product-category .woocommerce-loop-category__title {
  position: absolute !important;
  left: 14px !important;
  right: 14px !important;
  bottom: 18px !important;
  margin: 0 !important;
  padding: 12px 10px !important;
  background: rgba(255, 255, 255, 0.88) !important;
  backdrop-filter: blur(2px);
  text-align: center !important;
  color: #111 !important;
  font-size: 14px !important;
  font-weight: 800 !important;
  line-height: 1.15 !important;
  text-transform: uppercase !important;
  box-sizing: border-box !important;
  z-index: 2;
}

/* count */
.ashe-shop-archive-categories ul.products li.product-category .woocommerce-loop-category__title mark,
.woocommerce .ashe-shop-archive-categories ul.products li.product-category .woocommerce-loop-category__title mark {
  display: block !important;
  margin-top: 4px !important;
  background: transparent !important;
  color: #666 !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
}

/* hover */
.ashe-shop-archive-categories ul.products li.product-category:hover,
.woocommerce .ashe-shop-archive-categories ul.products li.product-category:hover {
  transform: translateY(-2px);
  transition: transform 0.18s ease;
}

/* optional class for logo-heavy tiles */
.ashe-shop-archive-categories ul.products li.product-category.logo-tile img,
.woocommerce .ashe-shop-archive-categories ul.products li.product-category.logo-tile img {
  object-fit: contain !important;
  background: #f3f3f3 !important;
  padding: 18px !important;
}


/* =========================================================
   5. WOOCOMMERCE BLOCK PRODUCT GRID
   ========================================================= */

.wp-block-woocommerce-product-template {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}

.wc-block-grid__product {
  background: #fff;
  border: 1px solid #eee;
  padding: 12px;
  transition: all 0.2s ease;
}

.wc-block-grid__product:hover {
  border-color: #ddd;
  transform: translateY(-2px);
}

.wc-block-grid__product-title {
  font-size: 0.9rem;
  margin: 8px 0;
}

.wc-block-grid__product-price {
  font-weight: 600;
  font-size: 0.9rem;
}

.wc-block-grid__product-add-to-cart {
  margin-top: 8px;
}


/* =========================================================
   6. RESPONSIVE
   ========================================================= */

@media (max-width: 1100px) {
  .ashe-shop-archive-categories ul.products,
  .woocommerce .ashe-shop-archive-categories ul.products {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }
  /* Height auto-calculated by aspect-ratio 1/1 */
}

@media (max-width: 900px) {
  .ashe-shop-landing ul.products {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .wp-block-woocommerce-product-template {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ashe-shop-archive-categories ul.products,
  .woocommerce .ashe-shop-archive-categories ul.products {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 640px) {
  .ashe-shop-landing {
    padding-left: 14px;
    padding-right: 14px;
  }

  .ashe-shop-landing ul.products,
  .wp-block-woocommerce-product-template {
    grid-template-columns: 1fr;
  }

  .ashe-shop-archive-categories ul.products,
  .woocommerce .ashe-shop-archive-categories ul.products {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }

  .ashe-shop-archive-categories ul.products li.product-category,
  .woocommerce .ashe-shop-archive-categories ul.products li.product-category {
    border-width: 3px !important;
    border-radius: 14px !important;
  }

  .ashe-shop-archive-categories ul.products li.product-category .woocommerce-loop-category__title,
  .woocommerce .ashe-shop-archive-categories ul.products li.product-category .woocommerce-loop-category__title {
    left: 10px !important;
    right: 10px !important;
    bottom: 12px !important;
    padding: 10px 8px !important;
    font-size: 11px !important; /* Slightly smaller for mobile */
  }

  .ashe-shop-archive-categories ul.products li.product-category .woocommerce-loop-category__title mark,
  .woocommerce .ashe-shop-archive-categories ul.products li.product-category .woocommerce-loop-category__title mark {
    font-size: 10px !important;
  }
}


/* Ensure the first category always fills the first grid cell */
.ashe-shop-archive-categories ul.products li.product-category:first-child {
    grid-column-start: 1 !important;
    margin-top: 0 !important;
}

/* Remove any WooCommerce "before" spacers that might be causing the gap */
.ashe-shop-archive-categories ul.products::before,
.ashe-shop-archive-categories ul.products::after {
    display: none !important;
    content: none !important;
}


/* =========================================================
   BRAND ARCHIVE STYLING (The results after clicking a brand)
   ========================================================= */

/* Targets the specific category archive pages */
.tax-product_cat ul.products {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 15px !important;
    padding: 20px 0 !important;
}

/* Re-applying the premium blue border logic to brand results */
.tax-product_cat ul.products li.product {
    border: 2px solid #1f73ea !important;
    border-radius: 12px !important;
    padding: 0 !important;
    background: #fff !important;
    position: relative !important;
    overflow: hidden !important;
}

/* Ensure images are square and clean */
.tax-product_cat ul.products li.product a img {
    padding: 15px !important;
    aspect-ratio: 1/1 !important;
    object-fit: contain !important;
}

/* Mobile Responsive adjustment for Brand Archives */
@media (max-width: 768px) {
    .tax-product_cat ul.products {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

.ashe-archive-header {
    text-align: center;
    padding: 40px 0 20px;
    background: #fdfdfd;
}

.ashe-archive-title {
    font-size: 2.5rem !important;
    text-transform: uppercase;
    color: #1a1a1a;
    letter-spacing: 2px;
}