:root{
  --am-primary:#780048;
  --am-dark:#303030;
  --am-bg:#F8F8F8;
  --am-card:#FFFFFF;
  --am-border:#E8E8EA;
  --am-radius:16px;
  --am-shadow:0 10px 30px rgba(0,0,0,.06);
}

/* =========================
   Base
========================= */
body{ color:var(--am-dark); background:var(--am-bg); }
a{ color:var(--am-primary); }
a:hover{ opacity:.9; }

button,
input[type="submit"],
.wp-block-button__link,
.button,
.hp-button,
button.button,
a.button{
  border-radius:999px !important;
}

.button--primary,
.hp-button--primary,
.wp-block-button__link,
button.button--primary,
a.button.button--primary{
  background:var(--am-primary) !important;
  border-color:var(--am-primary) !important;
  color:#fff !important;
  box-shadow:0 10px 20px rgba(120,0,72,.18);
}

.button--primary:hover,
.hp-button--primary:hover,
.wp-block-button__link:hover{
  filter:brightness(.95);
}

/* Cards radius */
.hp-listing,
.hp-vendor,
.hp-message,
.hp-result,
.hp-form,
.hp-page__content > .hp-block,
.elementor-widget-container,
.wp-block-group,
.wp-block-columns{
  border-radius:var(--am-radius);
}

/* Page spacing */
.hp-page__content,
.site-content{
  padding-top:28px !important;
  padding-bottom:56px !important;
}
.hp-page__content > * + *{
  margin-top:16px !important;
}

/* Header */
.site-header{
  background:#FFFFFF;
  border-bottom:1px solid #EEE;
}

/* =========================
   Search (Hero bar)
========================= */
form.hp-form--listing-search{
  background: var(--am-card) !important;
  border: 1px solid var(--am-border) !important;
  box-shadow: var(--am-shadow);
  border-radius: 999px !important;
  padding: 12px 12px !important;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Inputs inside search */
form.hp-form--listing-search input,
form.hp-form--listing-search select{
  border: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  height: 46px !important;
}

/* Search submit button */
form.hp-form--listing-search button,
form.hp-form--listing-search input[type="submit"]{
  background: var(--am-primary) !important;
  border-color: var(--am-primary) !important;
  color: #fff !important;
  border-radius: 999px !important;
  padding: 12px 18px !important;
  box-shadow: 0 10px 20px rgba(120,0,72,.18);
}

@media (max-width: 768px){
  form.hp-form--listing-search{
    border-radius: 18px !important;
    flex-wrap: wrap;
  }
}

/* =========================
   Categories grid
========================= */
.hp-listing-categories.hp-grid{
  display:flex !important;
  flex-wrap:wrap !important;
  gap:14px !important;
}

.hp-listing-categories.hp-grid .hp-grid__item{
  width:auto !important;
  max-width:none !important;
  flex: 0 0 100% !important;
}

@media (min-width: 768px){
  .hp-listing-categories.hp-grid .hp-grid__item{
    flex-basis: calc(50% - 7px) !important;
  }
}

@media (min-width: 1100px){
  .hp-listing-categories.hp-grid .hp-grid__item{
    flex-basis: calc(25% - 11px) !important;
  }
}

.hp-listing-category.hp-listing-category--view-block{
  background: var(--am-card);
  border: 1px solid var(--am-border);
  box-shadow: var(--am-shadow);
  border-radius: var(--am-radius);
  padding: 16px;
  transition: transform .15s ease, box-shadow .15s ease;
}

.hp-listing-category.hp-listing-category--view-block:hover{
  transform: translateY(-2px);
  box-shadow: 0 16px 36px rgba(0,0,0,.08);
}

.hp-listing-category__header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

.hp-listing-category__name{
  font-weight: 900 !important;
  font-size: 18px !important;
  margin: 0 !important;
}

.hp-listing-category__count{
  opacity:.75;
}

/* =========================
   Listings grid + cards
========================= */
.hp-listings.hp-grid{
  display:flex !important;
  flex-wrap:wrap !important;
  gap:14px !important;
}

/* sometimes wrapped in .hp-row */
.hp-listings.hp-grid > .hp-row{
  display:flex !important;
  flex-wrap:wrap !important;
  gap:14px !important;
  width:100% !important;
}

.hp-listings.hp-grid > .hp-row > .hp-grid__item,
.hp-listings.hp-grid > .hp-grid__item{
  width:auto !important;
  max-width:none !important;
  flex: 0 0 100% !important;
}

@media (min-width: 768px){
  .hp-listings.hp-grid > .hp-row > .hp-grid__item,
  .hp-listings.hp-grid > .hp-grid__item{
    flex-basis: calc(50% - 7px) !important;
  }
}

@media (min-width: 1100px){
  .hp-listings.hp-grid > .hp-row > .hp-grid__item,
  .hp-listings.hp-grid > .hp-grid__item{
    flex-basis: calc(33.333% - 10px) !important;
  }
}

article.hp-listing.hp-listing--view-block{
  background: var(--am-card);
  border: 1px solid var(--am-border);
  box-shadow: var(--am-shadow);
  border-radius: var(--am-radius);
  overflow: hidden;
  padding: 16px;
  transition: transform .15s ease, box-shadow .15s ease;

  display:flex !important;
  flex-direction:column !important;
  min-height: 190px;
}

article.hp-listing.hp-listing--view-block:hover{
  transform: translateY(-2px);
  box-shadow: 0 16px 36px rgba(0,0,0,.08);
}

/* clamp title */
article.hp-listing--view-block .hp-listing__title{
  font-weight: 900;
  letter-spacing: .2px;
  display:-webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow:hidden;
}

/* price */
article.hp-listing--view-block .hp-listing__price,
article.hp-listing--view-block .hp-listing__attribute--price{
  color: var(--am-primary);
  font-weight: 900;
}
article.hp-listing--view-block .hp-listing__price{
  font-size:16px;
}

article.hp-listing.hp-listing--view-block .hp-listing__content{
  flex:1 1 auto !important;
}
article.hp-listing.hp-listing--view-block .hp-listing__footer{
  margin-top:auto !important;
}

/* =========================
   Vendors grid + cards
========================= */
.hp-vendors.hp-grid,
.hp-vendors.hp-block.hp-grid{
  display:flex !important;
  flex-wrap:wrap !important;
  gap:14px !important;
}

.hp-vendors.hp-grid > .hp-row{
  display:flex !important;
  flex-wrap:wrap !important;
  gap:14px !important;
  width:100% !important;
}

.hp-vendors.hp-grid > .hp-grid__item,
.hp-vendors.hp-grid > .hp-row > .hp-grid__item{
  width:auto !important;
  max-width:none !important;
  flex: 0 0 100% !important;
}

@media (min-width: 768px){
  .hp-vendors.hp-grid > .hp-grid__item,
  .hp-vendors.hp-grid > .hp-row > .hp-grid__item{
    flex-basis: calc(50% - 7px) !important;
  }
}

@media (min-width: 1100px){
  .hp-vendors.hp-grid > .hp-grid__item,
  .hp-vendors.hp-grid > .hp-row > .hp-grid__item{
    flex-basis: calc(33.333% - 10px) !important;
  }
}

article.hp-vendor.hp-vendor--view-block{
  width:100% !important;
  background: var(--am-card);
  border: 1px solid var(--am-border);
  box-shadow: var(--am-shadow);
  border-radius: var(--am-radius);
  overflow:hidden;
  padding: 18px;
  transition: transform .15s ease, box-shadow .15s ease;

  display:flex !important;
  flex-direction:column !important;
  min-height: 230px;
}

article.hp-vendor.hp-vendor--view-block:hover{
  transform: translateY(-2px);
  box-shadow: 0 16px 36px rgba(0,0,0,.08);
}

.hp-vendor__header{
  display:flex;
  align-items:center;
  gap:12px;
}

.hp-vendor__image,
.hp-vendor__avatar,
.hp-vendor__header img{
  width:52px !important;
  height:52px !important;
  border-radius: 999px !important;
  object-fit: cover;
  background:#f2f2f2;
}

.hp-vendor__name{
  font-weight: 900;
  letter-spacing:.2px;
  display:-webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow:hidden;
}

.hp-vendor__registered{
  opacity:.7;
  font-size: 12px;
}

article.hp-vendor.hp-vendor--view-block .hp-vendor__content{
  flex:1 1 auto !important;
}
article.hp-vendor.hp-vendor--view-block .hp-vendor__footer{
  margin-top:auto !important;
}

/* message action */
.hp-vendor__action--message{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:44px;
  height:44px;
  border-radius:999px;
  background: rgba(120,0,72,.08);
  color: var(--am-primary) !important;
  border: 1px solid rgba(120,0,72,.16);
}
.hp-vendor__action--message:hover{
  background: rgba(120,0,72,.12);
}

/* =========================
   Sidebar filter panel + button
========================= */
.hp-page__sidebar .hp-form--filter,
.hp-page__sidebar .hp-block{
  background: var(--am-card);
  border:1px solid var(--am-border);
  box-shadow: var(--am-shadow);
  border-radius: var(--am-radius);
  padding: 16px;
}

/* EXACT FIX: button-primary alt button--secondary ... */
.hp-form__footer .hp-form__button.button--secondary,
.hp-form__footer button.hp-form__button.button--secondary,
.hp-page__sidebar .hp-form__button.button--secondary{
  background: var(--am-primary) !important;
  border-color: var(--am-primary) !important;
  color: #fff !important;
  border-radius: 999px !important;
  box-shadow: 0 10px 20px rgba(120,0,72,.18) !important;
}

.hp-form__footer .hp-form__button.button--secondary::before,
.hp-page__sidebar .hp-form__button.button--secondary::before{
  color:#fff !important;
  opacity: 1 !important;
  filter: none !important;
}

.hp-form__footer .hp-form__button.button--secondary:hover,
.hp-page__sidebar .hp-form__button.button--secondary:hover{
  filter: brightness(.95);
}

/* =========================
   Container width
========================= */
@media (min-width: 1200px){
  .site-content .container{
    max-width: 1180px !important;
  }
}

/* =========================
   Home section headers (works only if you add Gutenberg groups with these classes)
========================= */
.am-section{
  position: relative;
  margin: 22px 0 !important;
  padding-top: 18px;
}

.am-section h2, .am-section h3{
  display:flex;
  align-items:center;
  gap:12px;
}

.am-section h2::after,
.am-section h3::after{
  content:"";
  height:1px;
  background: var(--am-border);
  flex:1;
  opacity:.9;
}
/* =========================
   SCOPE FIX: apply vendors-page layout only on /vendors/
   HivePress ?????? ???? body class: post-type-archive-hp_vendor
========================= */

body.post-type-archive-hp_vendor .hp-page__content.hp-col-sm-8{
  width: 75% !important;
  max-width: 75% !important;
  flex: 0 0 75% !important;
}

body.post-type-archive-hp_vendor .hp-page__sidebar.hp-col-sm-4{
  width: 25% !important;
  max-width: 25% !important;
  flex: 0 0 25% !important;
}

/* ???? forced flex ???? ??? ????? */
body.post-type-archive-hp_vendor .hp-vendors.hp-grid,
body.post-type-archive-hp_vendor .hp-vendors.hp-block.hp-grid,
body.post-type-archive-hp_vendor .hp-vendors.hp-grid > .hp-row{
  display: block !important;
}

/* Stretch cards nicely */
body.post-type-archive-hp_vendor .hp-vendors .hp-grid__item{
  display:flex !important;
}
body.post-type-archive-hp_vendor .hp-vendors .hp-grid__item > article.hp-vendor{
  width:100% !important;
}
/* =========================
   HOME: Categories fill row properly
========================= */

/* ??? ???? ?????? flex ????? ????? */
.hp-listing-categories.hp-grid{
  display:flex !important;
  flex-wrap:wrap !important;
  justify-content:flex-start !important;
  gap:14px !important;
}

/* ?? ???? ??? */
.hp-listing-categories.hp-grid .hp-grid__item{
  width:auto !important;
  max-width:none !important;
  flex: 0 0 calc(50% - 7px) !important; /* ??????/????? = 2 */
}

/* Desktop = 5 ?? ???? (?? 5 ????) */
@media (min-width: 1100px){
  .hp-listing-categories.hp-grid .hp-grid__item{
    flex-basis: calc(20% - 12px) !important; /* 5 cols */
  }
}

/* ?? ????? ???? ?? ???????? ????? 4 ????? ??? 5 */
@media (min-width: 1400px){
  .hp-listing-categories.hp-grid .hp-grid__item{
    flex-basis: calc(25% - 11px) !important; /* 4 cols */
  }
}
/* =========================
   HOME: Categories = Responsive Grid (Auto-Fit)
========================= */
.hp-listing-categories.hp-grid{
  display:grid !important;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) !important;
  gap:14px !important;
  align-items:stretch !important;
}

/* ????? ?? ????? HivePress ?? ????? widths */
.hp-listing-categories.hp-grid .hp-grid__item{
  width:auto !important;
  max-width:none !important;
  flex:none !important;
}

/* ?? ???? 5 ????? ??? ??????? ??????? ??? */
@media (min-width: 1300px){
  .hp-listing-categories.hp-grid{
    grid-template-columns: repeat(5, 1fr) !important;
  }
}
@media (min-width: 1200px){
  .site-content .container{
    max-width: 1280px !important;
  }
}
/* ===== FIX: categories became one column (force full width + grid on row) ===== */

/* ???? ???? ??? ?????? */
.hp-listing-categories.hp-grid{
  width: 100% !important;
  max-width: 100% !important;
}

/* ??? ??????? ???? ??????? ???? .hp-row */
.hp-listing-categories.hp-grid > .hp-row{
  width: 100% !important;
  max-width: 100% !important;

  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) !important;
  gap: 14px !important;
}

/* ?? ??????? ?? ??? row (??????) */
.hp-listing-categories.hp-grid{
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) !important;
  gap: 14px !important;
}

/* ???? ?? widths ?? ???????? ????? HivePress */
.hp-listing-categories.hp-grid .hp-grid__item{
  width: auto !important;
  max-width: none !important;
  flex: none !important;
  float: none !important;
}

/* ?? ?? col-12 ??????? */
.hp-listing-categories.hp-grid .hp-col-sm-12,
.hp-listing-categories.hp-grid .hp-col-xs-12{
  width: auto !important;
}
/* =========================
   FOOTER – remove Archives/Categories blocks only
========================= */

/* ???? ?????? Footer Widgets ???? ???? Archives/Categories */
.site-footer .footer-widgets h2.wp-block-heading{
  display:none !important;
}

.site-footer .footer-widgets ul.wp-block-archives,
.site-footer .footer-widgets ul.wp-block-categories,
.site-footer .footer-widgets .wp-block-archives-list,
.site-footer .footer-widgets .wp-block-categories-list{
  display:none !important;
}

/* ?? ?????? ??? ???? ??? ???????: ????? (???????) */
.site-footer .footer-widgets .widget:has(ul.wp-block-archives),
.site-footer .footer-widgets .widget:has(ul.wp-block-categories){
  display:none !important;
}

/* ??? footer-navbar (???????? ???? ???) ?????? ??????? */
.site-footer{
  background:#fff !important;
  border-top:1px solid var(--am-border);
  padding: 24px 0 16px;
}

.site-footer .footer-navbar{
  margin-top: 10px;
}

.site-footer .footer-navbar a{
  color: var(--am-dark);
  opacity:.75;
  text-decoration:none;
  font-size:14px;
}

.site-footer .footer-navbar a:hover{
  color: var(--am-primary);
  opacity:1;
}
/* =========================
   AM FOOTER – Clean MVP
========================= */

.site-footer{
  background:#fff;
  border-top:1px solid var(--am-border);
  padding: 24px 0;
  margin-top: 40px;
}

/* wrapper */
.am-footer{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  font-size:14px;
  color:#777;
}

/* copyright */
.am-footer__left{
  font-size:13px;
  color:#777;
}

/* nav */
.am-footer__nav{
  display:flex;
  align-items:center;
  gap:18px;
}

.am-footer__nav a{
  color:#777;
  text-decoration:none;
  font-size:13px;
}

.am-footer__nav a:hover{
  color:var(--am-primary);
}

/* Mobile */
@media (max-width: 768px){
  .am-footer{
    flex-direction:column;
    text-align:center;
    gap:12px;
  }
}
