/* =========================================================
   CiCA Bazaar Directory Styling
   Applies only to Bazaar WooCommerce pages via body classes
   ========================================================= */



/* =========================================================
   Bazaar Category Header
   Compact full-width archive layout
   ========================================================= */

/* Make Bazaar product-category pages use full available page width */
body.cica-bazaar-archive #content,
body.cica-bazaar-archive .site-content,
body.cica-bazaar-archive .ast-container,
body.cica-bazaar-archive .site-content .ast-container,
body.cica-bazaar-archive .content-area,
body.cica-bazaar-archive .site-main,
body.cica-bazaar-archive .ast-woocommerce-container {
  max-width: none !important;
  width: 100% !important;
}

/* Remove Astra/WooCommerce top spacing on Bazaar archives */
body.cica-bazaar-archive #content,
body.cica-bazaar-archive .site-content,
body.cica-bazaar-archive .site-content .ast-container,
body.cica-bazaar-archive .content-area,
body.cica-bazaar-archive .site-main,
body.cica-bazaar-archive .ast-woocommerce-container {
  padding-top: 0 !important;
  margin-top: 0 !important;
}

/* Final page spacing for Bazaar archive content */
body.cica-bazaar-archive .ast-woocommerce-container {
  padding: 24px 14px 60px !important;
}

/* Hide breadcrumb on Bazaar category archives */
body.cica-bazaar-archive .woocommerce-breadcrumb {
  display: none;
}

/* Category title/description banner */
body.cica-bazaar-archive .woocommerce-products-header {
  background: linear-gradient(to top, #f6a94d 0%, #ffc983 100%);
  border-radius: 10px;
  padding: 12px;
  margin: 0 0 32px;
  color: #ffffff;
}

/* Category title - H3 style */
body.cica-bazaar-archive .woocommerce-products-header__title,
body.cica-bazaar-archive .page-title {
  color: #ffffff !important;
  font-size: 24px;
  line-height: 1.25;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin: 0 0 4px;
}

/* Category description */
body.cica-bazaar-archive .term-description {
  color: #ffffff;
  font-size: 15px;
  line-height: 1.45;
  margin: 0;
}

body.cica-bazaar-archive .term-description p {
  color: #ffffff;
  margin: 0;
}

@media (max-width: 768px) {
  body.cica-bazaar-archive .ast-woocommerce-container {
    padding: 22px 18px 44px !important;
  }

  body.cica-bazaar-archive .woocommerce-products-header {
    padding: 12px;
    margin-bottom: 24px;
  }

  body.cica-bazaar-archive .woocommerce-products-header__title,
  body.cica-bazaar-archive .page-title {
    font-size: 21px;
  }
}


/* Bazaar archive page spacing */
body.cica-bazaar-archive .site-content {
  background: #f7fafc;
}

body.cica-bazaar-archive .woocommerce-products-header,
body.cica-bazaar-archive .woocommerce-notices-wrapper,
body.cica-bazaar-archive .woocommerce-result-count,
body.cica-bazaar-archive .woocommerce-ordering {
  margin-bottom: 20px;
}


/* Product grid as directory cards */
body.cica-bazaar-archive .woocommerce ul.products {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 320px));
  gap: 28px;
  width: 100%;
  max-width: none;
  justify-content: start;
}

body.cica-bazaar-archive .woocommerce ul.products::before,
body.cica-bazaar-archive .woocommerce ul.products::after {
  display: none;
}

body.cica-bazaar-archive .woocommerce ul.products li.product {
  width: auto !important;
  float: none !important;
  clear: none !important;
  background: #ffffff;
  border: 1px solid #d8e3ea;
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

body.cica-bazaar-archive .woocommerce ul.products li.product:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 32px rgba(0,0,0,0.10);
}

body.cica-bazaar-archive ul.products li.product .astra-shop-thumbnail-wrap {
  border: 1px solid #d9dfe5 !important;
  border-radius: 14px !important;
  overflow: hidden !important;
  background: #ffffff;
  line-height: 0;
  margin-bottom: 14px;
}

body.cica-bazaar-archive ul.products li.product .astra-shop-thumbnail-wrap a,
body.cica-bazaar-archive ul.products li.product .woocommerce-loop-product__link {
  display: block;
  border-radius: 14px !important;
  overflow: hidden !important;
}

body.cica-bazaar-archive .woocommerce ul.products li.product a img,
body.cica-bazaar-archive .woocommerce ul.products li.product img,
body.cica-bazaar-archive ul.products li.product .astra-shop-thumbnail-wrap img {
  width: 100% !important;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 13px !important;
  border: 0 !important;
  margin: 0 !important;
  background: #ffffff;
  display: block;
}

body.cica-bazaar-archive .woocommerce ul.products li.product .woocommerce-loop-product__title,
body.cica-bazaar-archive ul.products li.product .woocommerce-loop-product__title,
body.cica-bazaar-archive ul.products li.product h2,
body.cica-bazaar-archive ul.products li.product h2 a,
body.cica-bazaar-archive ul.products li.product .ast-loop-product__link,
body.cica-bazaar-archive ul.products li.product .astra-shop-summary-wrap a:not(.button):not(.cica-bazaar-view-listing) {
  font-size: 22px !important;
  font-weight: 700 !important;
  line-height: 1.25 !important;
  color: #12395a !important;
  padding: 0 !important;
  margin: 4px 0 4px !important;
}

/* Bazaar card short description */
body.cica-bazaar-archive .woocommerce ul.products li.product .cica-bazaar-card-excerpt,
body.cica-bazaar-archive ul.products li.product .cica-bazaar-card-excerpt,
body.cica-bazaar-archive .cica-bazaar-card-excerpt {
  font-size: 13px !important;
  line-height: 1.5 !important;
  color: #3d4f5f !important;
  margin: 0px 0 10px !important;
  text-align: left !important;
}

body.cica-bazaar-archive .woocommerce ul.products li.product .ast-woo-product-category {
  display: inline-block;
  color: #0f6b78;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
}

body.cica-bazaar-archive ul.products li.product .astra-shop-summary-wrap {
  display: flex !important;
  flex-direction: column;
  align-items: stretch;
  text-align: left;
}

/* Hide/neutralize default WooCommerce archive button if it appears */
body.cica-bazaar-archive .woocommerce ul.products li.product .button,
body.cica-bazaar-archive .woocommerce ul.products li.product a.button {
  display: none !important;
}

/* Custom Bazaar archive card button */
.cica-bazaar-view-listing,
a.cica-bazaar-view-listing,
body.cica-bazaar-archive .cica-bazaar-view-listing,
body.cica-bazaar-archive a.cica-bazaar-view-listing,
body.cica-bazaar-archive .woocommerce .cica-bazaar-view-listing,
body.cica-bazaar-archive .woocommerce a.cica-bazaar-view-listing {
  display: block !important;
  width: 100% !important;
  box-sizing: border-box !important;
  background-color: #557CA3 !important;
  color: #ffffff !important;
  border: 0 !important;
  border-radius: 3px !important;
  padding: 10px 20px !important;
  margin-top: 12px !important;
  font-size: 16px !important;
  font-weight: 500 !important;
  line-height: 1.4 !important;
  text-align: center !important;
  text-decoration: none !important;
  cursor: pointer !important;
}

.cica-bazaar-view-listing:hover,
a.cica-bazaar-view-listing:hover,
body.cica-bazaar-archive .cica-bazaar-view-listing:hover,
body.cica-bazaar-archive a.cica-bazaar-view-listing:hover,
body.cica-bazaar-archive .woocommerce .cica-bazaar-view-listing:hover,
body.cica-bazaar-archive .woocommerce a.cica-bazaar-view-listing:hover {
  background-color: #305070 !important;
  color: #ffffff !important;
  text-decoration: none !important;
}

/* Hide price on Bazaar listing cards if any exists */
body.cica-bazaar-archive .woocommerce ul.products li.product .price {
  display: none !important;
}

/* Single Bazaar listing */
body.cica-bazaar-single .site-content {
  background: #f7fafc;
}

body.cica-bazaar-single div.product {
  background: #ffffff;
  border-radius: 18px;
  padding: 28px;
  border: 1px solid #d8e3ea;
  box-shadow: 0 8px 24px rgba(0,0,0,0.05);
}

body.cica-bazaar-single div.product .product_title {
  font-size: 32px;
  font-weight: 800;
  color: #12395a;
  margin-bottom: 12px;
}

body.cica-bazaar-single div.product .woocommerce-product-details__short-description,
body.cica-bazaar-single .woocommerce-Tabs-panel--description,
body.cica-bazaar-single .woocommerce-Tabs-panel--description p,
body.cica-bazaar-single .woocommerce-tabs .panel,
body.cica-bazaar-single .woocommerce-tabs .panel p {
  font-size: 15px;
  line-height: 1.65;
  color: #305070;
  font-weight: 400;
}

body.cica-bazaar-single div.product .woocommerce-product-details__short-description {
  margin-bottom: 20px;
}

body.cica-bazaar-single div.product .woocommerce-product-details__short-description p {
  margin: 0;
}

body.cica-bazaar-single div.product .woocommerce-product-gallery img {
  border-radius: 16px;
}

body.cica-bazaar-single div.product .single_add_to_cart_button,
body.cica-bazaar-single div.product .button.product_type_external {
  background: #0f6b78 !important;
  color: #ffffff !important;
  border-radius: 9px !important;
  padding: 12px 22px !important;
  font-weight: 800 !important;
}

/* Hide Astra/WooCommerce category links above the Bazaar single listing title */
body.cica-bazaar-single .summary .ast-woo-product-category,
body.cica-bazaar-single .summary .posted_in,
body.cica-bazaar-single .summary .product_meta {
  display: none !important;
}

/* Bazaar single listing action area */
body.cica-bazaar-single .cica-bazaar-action-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 22px 0 18px;
  border-top: 1px solid #d8e3ea;
  padding-top: 18px;
}

/* Primary action buttons: full width */
body.cica-bazaar-single .cica-bazaar-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 42px;
  padding: 10px 20px;
  border-radius: 3px;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.4;
  text-decoration: none !important;
  box-sizing: border-box;
}

body.cica-bazaar-single .cica-bazaar-action-primary,
body.cica-bazaar-single .cica-bazaar-action-business-page {
  background: #557CA3;
  color: #ffffff !important;
}

body.cica-bazaar-single .cica-bazaar-action-primary:hover,
body.cica-bazaar-single .cica-bazaar-action-business-page:hover {
  background: #305070;
  color: #ffffff !important;
}

/* Contact rows below buttons */
body.cica-bazaar-single .cica-bazaar-contact-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 16px 0 18px;
}

body.cica-bazaar-single .cica-bazaar-contact-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #305070 !important;
  font-size: 15px;
  line-height: 1.5;
  text-decoration: none !important;
}

body.cica-bazaar-single .cica-bazaar-contact-row:hover {
  color: #557CA3 !important;
}

body.cica-bazaar-single .cica-bazaar-contact-icon {
  width: 22px;
  min-width: 22px;
  text-align: center;
  font-size: 17px;
  line-height: 1;
  color: #305070 !important;
}

body.cica-bazaar-single .cica-bazaar-contact-icon svg {
  fill: #305070 !important;
}

body.cica-bazaar-single .cica-bazaar-contact-row:hover .cica-bazaar-contact-icon,
body.cica-bazaar-single .cica-bazaar-contact-row:hover .cica-bazaar-contact-icon svg {
  color: #12395a !important;
  fill: #12395a !important;
}

/* Product description spacing */
body.cica-bazaar-single .woocommerce-tabs {
  padding-top: 34px;
}

body.cica-bazaar-single .woocommerce-tabs .panel {
  display: block !important;
  border-top: 1px solid #d8e3ea;
  padding-top: 24px !important;
}

body.cica-bazaar-single .woocommerce-tabs .panel p:first-child {
  margin-top: 0 !important;
}


/* Hide price/SKU/category/tag clutter on Bazaar single listings */
body.cica-bazaar-single div.product .price,
body.cica-bazaar-single div.product .sku_wrapper,
body.cica-bazaar-single div.product .posted_in,
body.cica-bazaar-single div.product .tagged_as,
body.cica-bazaar-single div.product .product_meta {
  display: none !important;
}

/* Hide product tags on Bazaar single listings */
body.cica-bazaar-single div.product .tagged_as {
  display: none !important;
}

/* Tabs cleanup */
body.cica-bazaar-single .woocommerce-tabs ul.tabs {
  display: none !important;
}

body.cica-bazaar-single .woocommerce-tabs {
  padding-top: 24px;
}



body.cica-bazaar-single .woocommerce-tabs .panel h2 {
  display: none;
}


/* Mobile */
@media (max-width: 768px) {
  body.cica-bazaar-single div.product {
    padding: 18px;
  }

  body.cica-bazaar-single div.product .product_title {
    font-size: 26px;
  }

  body.cica-bazaar-archive .woocommerce ul.products {
    grid-template-columns: 1fr;
  }
}


/* Pull title up if hidden category output leaves small vertical residue */
body.cica-bazaar-single .summary .product_title {
  margin-top: 0 !important;
}


/* Keep WooCommerce breadcrumb visible and untouched */
body.cica-bazaar-single .woocommerce-breadcrumb {
  display: block !important;
}

/* Hide only the duplicate Astra category line above Bazaar single listing title */
body.cica-bazaar-single div.product .summary.entry-summary .ast-woo-product-category,
body.cica-bazaar-single div.product .entry-summary .ast-woo-product-category {
  display: none !important;
}

/* Hide standard WooCommerce product meta on Bazaar listings */
body.cica-bazaar-single div.product .summary.entry-summary .product_meta,
body.cica-bazaar-single div.product .summary.entry-summary .posted_in,
body.cica-bazaar-single div.product .summary.entry-summary .tagged_as {
  display: none !important;
}

/* Keep title aligned after removing duplicate category line */
body.cica-bazaar-single .summary .product_title {
  margin-top: 0 !important;
}


/* =========================================================
   Farsi / RTL Bazaar support
   ========================================================= */

body.cica-bazaar-rtl.cica-bazaar-archive,
body.cica-bazaar-rtl.cica-bazaar-single {
  direction: rtl;
}

/* Archive category banner */
body.cica-bazaar-rtl.cica-bazaar-archive .woocommerce-products-header,
body.cica-bazaar-rtl.cica-bazaar-archive .woocommerce-products-header__title,
body.cica-bazaar-rtl.cica-bazaar-archive .page-title,
body.cica-bazaar-rtl.cica-bazaar-archive .term-description,
body.cica-bazaar-rtl.cica-bazaar-archive .term-description p {
  direction: rtl;
  text-align: right;
}

body.cica-bazaar-rtl.cica-bazaar-archive .woocommerce-products-header__title,
body.cica-bazaar-rtl.cica-bazaar-archive .page-title {
  text-transform: none;
  letter-spacing: 0;
}

/* Archive cards */
body.cica-bazaar-rtl.cica-bazaar-archive ul.products li.product,
body.cica-bazaar-rtl.cica-bazaar-archive ul.products li.product .astra-shop-summary-wrap,
body.cica-bazaar-rtl.cica-bazaar-archive ul.products li.product .woocommerce-loop-product__title,
body.cica-bazaar-rtl.cica-bazaar-archive ul.products li.product .ast-woo-product-category,
body.cica-bazaar-rtl.cica-bazaar-archive .cica-bazaar-card-excerpt {
  direction: rtl;
  text-align: right !important;
}

body.cica-bazaar-rtl.cica-bazaar-archive .cica-bazaar-view-listing {
  direction: rtl;
  text-align: center !important;
}

/* Single listing layout */
body.cica-bazaar-rtl.cica-bazaar-single div.product,
body.cica-bazaar-rtl.cica-bazaar-single .summary.entry-summary,
body.cica-bazaar-rtl.cica-bazaar-single .woocommerce-product-details__short-description,
body.cica-bazaar-rtl.cica-bazaar-single .woocommerce-tabs,
body.cica-bazaar-rtl.cica-bazaar-single .woocommerce-tabs .panel,
body.cica-bazaar-rtl.cica-bazaar-single .woocommerce-Tabs-panel--description {
  direction: rtl;
  text-align: right;
}

body.cica-bazaar-rtl.cica-bazaar-single .woocommerce-breadcrumb {
  direction: rtl;
  text-align: right;
}

/* Single listing buttons */
body.cica-bazaar-rtl.cica-bazaar-single .cica-bazaar-action-btn {
  direction: rtl;
  text-align: center;
}

/* Contact rows */
body.cica-bazaar-rtl.cica-bazaar-single .cica-bazaar-contact-row {
  direction: rtl;
  text-align: right;
}

body.cica-bazaar-rtl.cica-bazaar-single .cica-bazaar-contact-value {
  direction: ltr;
  unicode-bidi: embed;
  text-align: left;
}

/* Product description headings/lists in Farsi */
body.cica-bazaar-rtl.cica-bazaar-single .woocommerce-Tabs-panel--description h2,
body.cica-bazaar-rtl.cica-bazaar-single .woocommerce-Tabs-panel--description h3,
body.cica-bazaar-rtl.cica-bazaar-single .woocommerce-Tabs-panel--description h4,
body.cica-bazaar-rtl.cica-bazaar-single .woocommerce-tabs .panel h2,
body.cica-bazaar-rtl.cica-bazaar-single .woocommerce-tabs .panel h3,
body.cica-bazaar-rtl.cica-bazaar-single .woocommerce-tabs .panel h4,
body.cica-bazaar-rtl.cica-bazaar-single .woocommerce-tabs .panel p,
body.cica-bazaar-rtl.cica-bazaar-single .woocommerce-tabs .panel li {
  direction: rtl;
  text-align: right;
}

body.cica-bazaar-rtl.cica-bazaar-single .woocommerce-tabs .panel ul,
body.cica-bazaar-rtl.cica-bazaar-single .woocommerce-tabs .panel ol {
  padding-right: 1.4em;
  padding-left: 0;
}



/* Farsi archive card excerpt: keep all wrapped lines right-aligned */
body.cica-bazaar-rtl.cica-bazaar-archive ul.products li.product .cica-bazaar-card-excerpt,
body.cica-bazaar-rtl.cica-bazaar-archive .woocommerce ul.products li.product .cica-bazaar-card-excerpt {
  direction: rtl !important;
  text-align: right !important;
  unicode-bidi: plaintext !important;
  display: block !important;
  max-width: 100% !important;
}


/* =========================================================
   Bazaar landing cards: inactive/empty categories
   ========================================================= */

.bazaar-card.bazaar-card-disabled {
  position: relative;
  opacity: 0.48;
  filter: grayscale(0.35);
  cursor: not-allowed !important;
}

.bazaar-card.bazaar-card-disabled a,
.bazaar-card.bazaar-card-disabled .bazaar-card-link,
.bazaar-card.bazaar-card-disabled .bazaar-card-link a {
  pointer-events: none !important;
  cursor: not-allowed !important;
}

.bazaar-card.bazaar-card-disabled::after {
  content: attr(data-cica-empty-label);
  position: absolute;
  top: 12px;
  inset-inline-end: 12px;
  z-index: 20;
  background: rgba(36, 60, 90, 0.9);
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  padding: 8px 10px;
  border-radius: 999px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.16);
}

.bazaar-card.bazaar-card-disabled:hover {
  transform: none !important;
  box-shadow: none !important;
}



/* =========================================================
   Bazaar archive toolbar: search, filters, sort, display mode
   ========================================================= */

body.cica-bazaar-archive .cica-bazaar-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin: 18px 0 22px;
  padding: 14px;
  background: #ffffff;
  border: 1px solid #d9e3ec;
  border-radius: 14px;
  box-shadow: 0 8px 22px rgba(36, 60, 90, 0.06);
}

body.cica-bazaar-archive .cica-bazaar-toolbar-form {
  display: grid;
  grid-template-columns: minmax(220px, 1.5fr) repeat(3, minmax(150px, 1fr)) auto;
  gap: 12px;
  align-items: end;
  width: 100%;
}

body.cica-bazaar-archive .cica-bazaar-toolbar-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

body.cica-bazaar-archive .cica-bazaar-toolbar-field label {
  font-size: 12px;
  font-weight: 700;
  color: #305070;
}

body.cica-bazaar-archive .cica-bazaar-toolbar input[type="search"],
body.cica-bazaar-archive .cica-bazaar-toolbar select {
  width: 100%;
  min-height: 42px;
  border: 1px solid #cbd8e4;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 14px;
  color: #12395a;
  background: #ffffff;
}

body.cica-bazaar-archive .cica-bazaar-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

body.cica-bazaar-archive .cica-bazaar-toolbar-submit,
body.cica-bazaar-archive .cica-bazaar-toolbar-reset,
body.cica-bazaar-archive .cica-bazaar-display-toggle a {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  padding: 9px 14px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none !important;
  line-height: 1.2;
}

body.cica-bazaar-archive .cica-bazaar-toolbar-submit {
  border: 0;
  background: #557CA3;
  color: #ffffff;
  cursor: pointer;
}

body.cica-bazaar-archive .cica-bazaar-toolbar-submit:hover {
  background: #305070;
  color: #ffffff;
}

body.cica-bazaar-archive .cica-bazaar-toolbar-reset {
  border: 1px solid #cbd8e4;
  background: #ffffff;
  color: #305070;
}

body.cica-bazaar-archive .cica-bazaar-toolbar-reset:hover {
  border-color: #557CA3;
  color: #12395a;
}

body.cica-bazaar-archive .cica-bazaar-display-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

body.cica-bazaar-archive .cica-bazaar-display-toggle a {
  border: 1px solid #cbd8e4;
  background: #ffffff;
  color: #305070;
}

body.cica-bazaar-archive .cica-bazaar-display-toggle a.is-active {
  border-color: #557CA3;
  background: #557CA3;
  color: #ffffff;
}

/* List view */
body.cica-bazaar-archive.cica-bazaar-view-list .woocommerce ul.products,
body.cica-bazaar-archive.cica-bazaar-view-list ul.products {
  display: block !important;
}

body.cica-bazaar-archive.cica-bazaar-view-list .woocommerce ul.products li.product,
body.cica-bazaar-archive.cica-bazaar-view-list ul.products li.product {
  width: 100% !important;
  max-width: 100% !important;
  display: grid !important;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  margin: 0 0 12px !important;
  padding: 12px !important;
  background: #ffffff;
  border: 1px solid #d9e3ec;
  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(36, 60, 90, 0.05);
}

body.cica-bazaar-archive.cica-bazaar-view-list ul.products li.product a img,
body.cica-bazaar-archive.cica-bazaar-view-list .woocommerce ul.products li.product a img {
  width: 110px !important;
  height: 110px !important;
  aspect-ratio: 1 / 1 !important;
  object-fit: cover !important;
  margin: 0 !important;
  border-radius: 12px !important;
  border: 1px solid #d9e3ec !important;
}

body.cica-bazaar-archive.cica-bazaar-view-list ul.products li.product .astra-shop-summary-wrap {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-height: 110px;
}

body.cica-bazaar-archive.cica-bazaar-view-list .cica-bazaar-view-listing {
  margin-top: auto !important;
}

/* RTL/Farsi toolbar */
body.cica-bazaar-rtl.cica-bazaar-archive .cica-bazaar-toolbar,
body.cica-bazaar-rtl.cica-bazaar-archive .cica-bazaar-toolbar-form,
body.cica-bazaar-rtl.cica-bazaar-archive .cica-bazaar-toolbar-field,
body.cica-bazaar-rtl.cica-bazaar-archive .cica-bazaar-display-toggle {
  direction: rtl;
}

body.cica-bazaar-rtl.cica-bazaar-archive .cica-bazaar-toolbar-field label,
body.cica-bazaar-rtl.cica-bazaar-archive .cica-bazaar-toolbar input,
body.cica-bazaar-rtl.cica-bazaar-archive .cica-bazaar-toolbar select {
  text-align: right;
}

/* Mobile */
@media (max-width: 991px) {
  body.cica-bazaar-archive .cica-bazaar-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  body.cica-bazaar-archive .cica-bazaar-toolbar-form {
    grid-template-columns: 1fr 1fr;
  }

  body.cica-bazaar-archive .cica-bazaar-toolbar-search,
  body.cica-bazaar-archive .cica-bazaar-toolbar-actions {
    grid-column: 1 / -1;
  }

  body.cica-bazaar-archive .cica-bazaar-display-toggle {
    justify-content: stretch;
  }

  body.cica-bazaar-archive .cica-bazaar-display-toggle a {
    flex: 1;
  }
}

@media (max-width: 640px) {
  body.cica-bazaar-archive .cica-bazaar-toolbar-form {
    grid-template-columns: 1fr;
  }

  body.cica-bazaar-archive .cica-bazaar-toolbar-actions {
    flex-direction: column;
    align-items: stretch;
  }

  body.cica-bazaar-archive .cica-bazaar-toolbar-submit,
  body.cica-bazaar-archive .cica-bazaar-toolbar-reset {
    width: 100%;
  }

  body.cica-bazaar-archive.cica-bazaar-view-list .woocommerce ul.products li.product,
  body.cica-bazaar-archive.cica-bazaar-view-list ul.products li.product {
    display: block !important;
  }

  body.cica-bazaar-archive.cica-bazaar-view-list ul.products li.product a img,
  body.cica-bazaar-archive.cica-bazaar-view-list .woocommerce ul.products li.product a img {
    width: 100% !important;
    height: auto !important;
    margin-bottom: 12px !important;
  }
}


/* =========================================================
   Bazaar toolbar refinements: icons, count message, mobile collapse
   ========================================================= */

body.cica-bazaar-archive .cica-bazaar-toolbar-shell {
  display: block;
  margin: 18px 0 8px;
}

body.cica-bazaar-archive .cica-bazaar-toolbar-summary {
  display: none;
}

body.cica-bazaar-archive .cica-bazaar-toolbar {
  margin: 0;
}

body.cica-bazaar-archive .cica-bazaar-results-summary {
  margin: 8px 0 18px;
  padding: 9px 12px;
  border: 1px solid #d9e3ec;
  border-radius: 10px;
  background: #ffffff;
  color: #305070;
  font-size: 13px;
  font-weight: 600;
}

body.cica-bazaar-archive .cica-bazaar-display-toggle {
  gap: 8px;
}

body.cica-bazaar-archive .cica-bazaar-display-toggle a {
  width: 42px;
  min-width: 42px;
  height: 42px;
  min-height: 42px;
  padding: 0 !important;
}

body.cica-bazaar-archive .cica-bazaar-display-toggle svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

body.cica-bazaar-archive .screen-reader-text {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Bazaar-specific no-result notice */
body.cica-bazaar-archive .woocommerce-info {
  border-top-color: #557CA3;
  color: #305070;
}

/* RTL/Farsi results summary */
body.cica-bazaar-rtl.cica-bazaar-archive .cica-bazaar-results-summary {
  direction: rtl;
  text-align: right;
}

/* Mobile: make toolbar collapsible */
@media (max-width: 640px) {
  body.cica-bazaar-archive .cica-bazaar-toolbar-shell {
    margin: 12px 0 8px;
  }

  body.cica-bazaar-archive .cica-bazaar-toolbar-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    cursor: pointer;
    list-style: none;
    padding: 12px 14px;
    border: 1px solid #d9e3ec;
    border-radius: 12px;
    background: #ffffff;
    color: #12395a;
    font-size: 14px;
    font-weight: 800;
    box-shadow: 0 6px 18px rgba(36, 60, 90, 0.06);
  }

  body.cica-bazaar-archive .cica-bazaar-toolbar-summary::-webkit-details-marker {
    display: none;
  }

  body.cica-bazaar-archive .cica-bazaar-toolbar-summary-icon {
    font-size: 18px;
    line-height: 1;
    transition: transform 0.2s ease;
  }

  body.cica-bazaar-archive .cica-bazaar-toolbar-shell[open] .cica-bazaar-toolbar-summary-icon {
    transform: rotate(180deg);
  }

  body.cica-bazaar-archive .cica-bazaar-toolbar {
    margin-top: 10px;
  }

  body.cica-bazaar-archive .cica-bazaar-results-summary {
    font-size: 12px;
    margin: 8px 0 14px;
  }
}

/* Bazaar toolbar: match Apply/Reset height with fields */
body.cica-bazaar-archive .cica-bazaar-toolbar-submit,
body.cica-bazaar-archive .cica-bazaar-toolbar-reset {
  height: 42px !important;
  min-height: 42px !important;
  max-height: 42px !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  line-height: 1 !important;
  box-sizing: border-box !important;
  align-self: flex-end !important;
}

/* Compact Bazaar list mode */
body.cica-bazaar-archive.cica-bazaar-view-list ul.products li.product .woocommerce-loop-product__title,
body.cica-bazaar-archive.cica-bazaar-view-list ul.products li.product h2,
body.cica-bazaar-archive.cica-bazaar-view-list ul.products li.product h2 a {
  font-size: 18px !important;
  line-height: 1.25 !important;
  margin: 2px 0 6px !important;
}

body.cica-bazaar-archive.cica-bazaar-view-list ul.products li.product .ast-woo-product-category {
  font-size: 12px !important;
  margin: 0 0 4px !important;
}

body.cica-bazaar-archive.cica-bazaar-view-list ul.products li.product .cica-bazaar-card-excerpt {
  font-size: 12px !important;
  line-height: 1.4 !important;
  margin: 4px 0 8px !important;
}

body.cica-bazaar-archive.cica-bazaar-view-list ul.products li.product .cica-bazaar-view-listing {
  margin-top: 6px !important;
  padding: 8px 12px !important;
}


/* =========================================================
   Bazaar list mode: compact clickable rows
   ========================================================= */

/* Hide View Listing button in list mode */
body.cica-bazaar-archive.cica-bazaar-view-list ul.products li.product .cica-bazaar-view-listing,
body.cica-bazaar-archive.cica-bazaar-view-list .woocommerce ul.products li.product .cica-bazaar-view-listing {
  display: none !important;
}

/* Make list rows feel clickable */
body.cica-bazaar-archive.cica-bazaar-view-list ul.products li.product,
body.cica-bazaar-archive.cica-bazaar-view-list .woocommerce ul.products li.product {
  cursor: pointer !important;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

body.cica-bazaar-archive.cica-bazaar-view-list ul.products li.product:hover,
body.cica-bazaar-archive.cica-bazaar-view-list .woocommerce ul.products li.product:hover {
  border-color: #557CA3 !important;
  box-shadow: 0 10px 24px rgba(36, 60, 90, 0.10) !important;
  transform: translateY(-1px);
}

body.cica-bazaar-archive.cica-bazaar-view-list ul.products li.product:focus,
body.cica-bazaar-archive.cica-bazaar-view-list .woocommerce ul.products li.product:focus {
  outline: 2px solid #557CA3;
  outline-offset: 3px;
}

/* Keep list rows compact after removing the button */
body.cica-bazaar-archive.cica-bazaar-view-list ul.products li.product .astra-shop-summary-wrap,
body.cica-bazaar-archive.cica-bazaar-view-list .woocommerce ul.products li.product .astra-shop-summary-wrap {
  justify-content: center;
}

/* =========================================================
   Bazaar mobile: no grid/list toggle, one listing per row
   ========================================================= */

@media (max-width: 640px) {
  /* Hide grid/list display mode on mobile */
  body.cica-bazaar-archive .cica-bazaar-display-toggle {
    display: none !important;
  }

  /* Force all mobile archive layouts to one full-width listing per row */
  body.cica-bazaar-archive .woocommerce ul.products,
  body.cica-bazaar-archive ul.products {
    display: block !important;
  }

  body.cica-bazaar-archive .woocommerce ul.products li.product,
  body.cica-bazaar-archive ul.products li.product,
  body.cica-bazaar-archive.cica-bazaar-view-grid .woocommerce ul.products li.product,
  body.cica-bazaar-archive.cica-bazaar-view-grid ul.products li.product,
  body.cica-bazaar-archive.cica-bazaar-view-list .woocommerce ul.products li.product,
  body.cica-bazaar-archive.cica-bazaar-view-list ul.products li.product {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 0 18px !important;
  }

  /* On mobile, keep the normal card button visible because full-card click is less obvious */
  body.cica-bazaar-archive.cica-bazaar-view-list ul.products li.product .cica-bazaar-view-listing,
  body.cica-bazaar-archive.cica-bazaar-view-list .woocommerce ul.products li.product .cica-bazaar-view-listing {
    display: flex !important;
  }
}