/* ============================================================
   MICROSHOP — WooCommerce + theme frontend fixes
   Design: near-black UI, yellow accent (#FACC15)
   Selectors match this theme: ul.grid / ul.grid > li
   ============================================================ */


/* ===== LAYOUT ===== */
.entry-content>.woocommerce,
.page-content>.woocommerce {
  max-width: none !important;
  margin-inline: 0 !important;
}

.woocommerce ul.products li.product {
  padding: 0 !important;
  margin: 0 !important;
  float: none !important;
  width: auto !important;
}


/* ===== PRODUCT CARD IMAGE AREA ===== */
ul.grid>li a.block>div {
  height: 240px !important;
  min-height: 240px !important;
  max-height: 240px !important;
  overflow: hidden !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background-color: #FAFAF9 !important;
}

ul.grid>li a.block>div>img {
  max-height: 180px !important;
  max-width: 85% !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
}

/* Hover action overlay */
ul.grid>li div[class*="opacity-0"] {
  opacity: 0 !important;
  transition: opacity .2s ease !important;
}

ul.grid>li:hover div[class*="opacity-0"] {
  opacity: 1 !important;
}


/* ===== GLOBAL LINK RESET (Preflight not loading) ===== */
main.site-content a,
footer a,
.site-footer a,
header a,
.site-header a {
  color: inherit;
  text-decoration: none;
  background-image: none;
}

main.site-content a[class*="text-"],
footer a[class*="text-"],
.site-footer a[class*="text-"] {
  color: unset;
}

.site-header nav a:hover,
.site-header nav a:focus {
  color: #0b0b0f;
  text-decoration: none;
}


/* ===== PROSE OVERRIDE (legacy) ===== */
.entry-content ul.grid a,
.entry-content .woocommerce a {
  color: inherit !important;
  text-decoration: none !important;
}


/* ===== PRODUCT CARD TITLE ===== */
ul.grid li h3 a,
ul.grid li h2 a,
ul.grid li a.woocommerce-LoopProduct-link {
  color: #0b0b0f !important;
  text-decoration: none !important;
}

ul.grid li h3 a:hover,
ul.grid li h2 a:hover,
ul.grid li a.woocommerce-LoopProduct-link:hover {
  color: #eab308 !important;
}

/* 2-line clamp with clean word wrapping (no mid-word breaks) */
ul.grid li h3,
ul.grid li h2,
.woocommerce-loop-product__title {
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  word-break: normal !important;
  overflow-wrap: break-word !important;
  hyphens: manual !important;
  line-height: 1.4 !important;
  min-height: 2.8em;
  max-height: 2.8em;
}


/* ===== PRIMARY CTA (product card button) ===== */
ul.grid>li a[class*="bg-primary"],
ul.grid>li a.button {
  color: #ffffff !important;
  background-color: #0b0b0f !important;
  text-decoration: none !important;
  border: 1px solid #0b0b0f !important;
  transition: background-color .15s, color .15s, border-color .15s, transform .15s !important;
}

ul.grid>li a[class*="bg-primary"]:hover,
ul.grid>li a.button:hover {
  background-color: #facc15 !important;
  color: #0b0b0f !important;
  border-color: #facc15 !important;
  text-decoration: none !important;
}

ul.grid>li a.added_to_cart {
  display: inline-block;
  margin-top: .5rem;
  font-size: .8125rem;
  font-weight: 600;
  color: #0b0b0f !important;
  text-decoration: underline !important;
  text-underline-offset: 3px;
}


/* ===== HERO CTA / GENERIC BUTTONS ===== */
main.site-content a[class*="bg-accent"],
main.site-content a[class*="bg-brand-dark"],
main.site-content a.btn,
main.site-content button,
main.site-content button a {
  text-decoration: none !important;
}

main.site-content a[class*="bg-accent"] {
  color: #0b0b0f !important;
}

main.site-content a[class*="bg-brand-dark"] {
  color: #ffffff !important;
}


/* ===== CATEGORY CARDS (home) ===== */
main.site-content a[class*="category"],
main.site-content section a[href*="/product-category/"] {
  color: #0b0b0f !important;
  text-decoration: none !important;
  border-color: transparent;
}

main.site-content a[class*="category"]:hover {
  color: #eab308 !important;
}


/* ===== BLOG CARDS ===== */
article a,
.post-card a,
main.site-content section a[href*="/20"] {
  color: #0b0b0f !important;
  text-decoration: none !important;
}

article a:hover,
.post-card a:hover {
  color: #eab308 !important;
}


/* ===== FOOTER ===== */
footer a,
.site-footer a {
  color: rgba(255, 255, 255, 0.75) !important;
  text-decoration: none !important;
}

footer a:hover,
.site-footer a:hover {
  color: #facc15 !important;
}


/* ===== HEADING DEFAULTS — :where() so Tailwind utilities always win ===== */
:where(main.site-content h1:not([class*="text-"])) {
  font-size: 2.25rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: #0b0b0f;
}

:where(main.site-content h2:not([class*="text-"])) {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
  color: #0b0b0f;
}

:where(main.site-content h3:not([class*="text-"])) {
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.3;
  color: #0b0b0f;
}


/* ===== SHOP TOOLBAR ===== */
.woocommerce-result-count {
  float: none !important;
  font-size: .875rem;
  color: #6b7280;
  margin: 0;
  line-height: 2.5rem;
}

.woocommerce-ordering {
  float: none !important;
  margin: 0;
}

.woocommerce-ordering select.orderby {
  appearance: none;
  -webkit-appearance: none;
  background-color: #fff;
  border: 1px solid #e7e5e4;
  border-radius: .625rem;
  padding: .55rem 2.5rem .55rem .875rem;
  font-size: .875rem;
  font-weight: 600;
  font-family: inherit;
  color: #0b0b0f;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%236b7280'%3E%3Cpath fill-rule='evenodd' d='M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .75rem center;
  background-size: 1rem;
  cursor: pointer;
}

.woocommerce-ordering select.orderby:focus {
  outline: none;
  border-color: #0b0b0f;
  box-shadow: 0 0 0 3px rgba(250, 204, 21, 0.35);
}


/* ===== PAGINATION ===== */
.woocommerce-pagination {
  width: 100%;
}

.woocommerce-pagination ul.page-numbers {
  display: flex !important;
  flex-wrap: wrap;
  gap: .375rem;
  justify-content: center;
  list-style: none;
  padding: 0;
  margin: 2rem 0 0;
}

.woocommerce-pagination ul.page-numbers li {
  display: block;
  margin: 0;
  padding: 0;
  float: none !important;
}

.woocommerce-pagination .page-numbers {
  display: flex !important;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  height: 2.5rem;
  padding: 0 .625rem;
  border-radius: .625rem;
  border: 1px solid #e7e5e4;
  background: #fff;
  color: #0b0b0f;
  font-size: .875rem;
  font-weight: 600;
  text-decoration: none;
  transition: all .15s;
}

.woocommerce-pagination .page-numbers:hover:not(.current):not(.dots) {
  border-color: #0b0b0f;
  background: #facc15;
  color: #0b0b0f;
}

.woocommerce-pagination .page-numbers.current {
  background: #0b0b0f;
  border-color: #0b0b0f;
  color: #fff;
}

.woocommerce-pagination .page-numbers.dots {
  border: none;
  background: transparent;
}


/* ===== PRICE ===== */
ul.grid>li .price {
  font-size: 1.0625rem;
  font-weight: 700;
  color: #0b0b0f;
  letter-spacing: -0.01em;
}

ul.grid>li .price del {
  font-size: .8125rem;
  font-weight: 400;
  color: #9ca3af;
  margin-right: .375rem;
}

ul.grid>li .price ins {
  text-decoration: none;
  font-weight: 700;
  color: #0b0b0f;
}


/* ===== NOTICES ===== */
.woocommerce-message,
.woocommerce-info {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-left: 3px solid #facc15;
  border-radius: .625rem;
  padding: .875rem 1.125rem;
  font-size: .875rem;
  color: #78350f;
  margin-bottom: 1rem;
}

.woocommerce-message a,
.woocommerce-info a {
  color: #0b0b0f !important;
  font-weight: 600;
  text-decoration: underline !important;
  text-underline-offset: 3px;
}

.woocommerce-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-left: 3px solid #dc2626;
  border-radius: .625rem;
  padding: .875rem 1.125rem;
  font-size: .875rem;
  color: #991b1b;
  margin-bottom: 1rem;
  list-style: none;
}


/* ===== SHOP PAGE HEADER ===== */
.woocommerce-page .entry-header,
.woocommerce-page h1.entry-title {
  max-width: none;
  margin-inline: 0;
  text-align: left;
}


/* ===== SUPPRESS DEFAULT WOO SALE BADGE ===== */
.woocommerce span.onsale {
  display: none !important;
}

/* Our own sale/new badge (if used) */
ul.grid li .onsale {
  background: #facc15 !important;
  color: #0b0b0f !important;
  text-decoration: none !important;
  font-weight: 700;
}


/* ===== SINGLE PRODUCT — form/qty ===== */
.woocommerce div.product form.cart .button {
  background-color: #0b0b0f !important;
  color: #fff !important;
  border: 1px solid #0b0b0f !important;
  border-radius: .625rem;
  padding: .9rem 1.75rem;
  font-weight: 600;
  font-size: .9375rem;
  font-family: inherit;
  letter-spacing: .01em;
  transition: all .15s;
}

.woocommerce div.product form.cart .button:hover {
  background-color: #facc15 !important;
  color: #0b0b0f !important;
  border-color: #facc15 !important;
}

.woocommerce .quantity .qty {
  width: 4rem;
  padding: .65rem .5rem;
  border: 1px solid #e7e5e4;
  border-radius: .5rem;
  text-align: center;
  font-size: .875rem;
  font-weight: 600;
  font-family: inherit;
}


/* ===== SINGLE PRODUCT — TABS ===== */
.woocommerce-tabs.wc-tabs-wrapper {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid #e7e7ea;
}

ul.tabs.wc-tabs {
  display: flex !important;
  flex-wrap: wrap;
  gap: 0.25rem;
  list-style: none !important;
  padding: 0 !important;
  margin: 0 0 2rem 0 !important;
  border-bottom: 1px solid #e7e7ea;
}

ul.tabs.wc-tabs li {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
}

ul.tabs.wc-tabs li a {
  display: inline-block;
  padding: 0.75rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #6b6b75 !important;
  border-bottom: 2px solid transparent;
  text-decoration: none !important;
  transition: color 0.15s, border-color 0.15s;
  margin-bottom: -1px;
}

ul.tabs.wc-tabs li a:hover {
  color: #0b0b0f !important;
}

ul.tabs.wc-tabs li.active a,
ul.tabs.wc-tabs li a[aria-selected="true"] {
  color: #0b0b0f !important;
  border-bottom-color: #facc15 !important;
}

.woocommerce-Tabs-panel {
  padding: 0 !important;
}

.woocommerce-Tabs-panel>h2 {
  display: none;
}

.woocommerce-Tabs-panel table.shop_attributes {
  width: 100%;
  border-collapse: collapse;
  border-radius: 0.75rem;
  overflow: hidden;
  border: 1px solid #e7e7ea;
}

.woocommerce-Tabs-panel table.shop_attributes th,
.woocommerce-Tabs-panel table.shop_attributes td {
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  border-top: 1px solid #e7e7ea;
  text-align: left;
  vertical-align: middle;
}

.woocommerce-Tabs-panel table.shop_attributes tr:first-child th,
.woocommerce-Tabs-panel table.shop_attributes tr:first-child td {
  border-top: 0;
}

.woocommerce-Tabs-panel table.shop_attributes th {
  background: #f8f8f9;
  color: #0b0b0f;
  font-weight: 600;
  width: 12rem;
}

.woocommerce-Tabs-panel table.shop_attributes td {
  color: #3a3a42;
}


/* ===== RELATED / UPSELLS ===== */
.related.products,
.upsells.products {
  margin-top: 4rem;
  padding-top: 3rem;
  border-top: 1px solid #e7e7ea;
}

.related.products>h2,
.upsells.products>h2 {
  font-size: 1.75rem !important;
  font-weight: 800 !important;
  letter-spacing: -0.01em !important;
  color: #0b0b0f !important;
  margin-bottom: 2rem !important;
  display: block !important;
}

.related.products>h2::after,
.upsells.products>h2::after {
  content: "";
  display: block;
  width: 2.5rem;
  height: 3px;
  background: #facc15;
  margin-top: 0.75rem;
  border-radius: 2px;
}


/* ===== HEADER LIST/LINK RESET ===== */
header nav ul,
header nav ul li {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

header nav ul::marker,
header nav ul li::marker {
  content: none !important;
}

header a,
header nav a {
  text-decoration: none !important;
  color: inherit;
}

header a:hover {
  text-decoration: none !important;
}

header .site-header a,
body>header a {
  color: #0b0b0f;
}


/* ===== HERO SLIDER PAGINATION ===== */
.swiper-pagination-bullet,
.hero-pagination span,
.hero .pagination span {
  display: inline-block !important;
  width: 24px !important;
  height: 6px !important;
  border-radius: 999px !important;
  background: rgba(255, 255, 255, 0.35) !important;
  opacity: 1 !important;
  margin: 0 4px !important;
  transition: background 0.2s, width 0.2s;
  border: 0 !important;
  cursor: pointer;
}

.swiper-pagination-bullet-active,
.hero-pagination span.active,
.hero .pagination span.active {
  background: #facc15 !important;
  width: 36px !important;
}

/* ===== PAGINATION — force the container to span its parent ===== */
.woocommerce-pagination,
nav.woocommerce-pagination {
  display: block !important;
  width: 100% !important;
  text-align: center;
}

.woocommerce-pagination ul.page-numbers,
.woocommerce nav.woocommerce-pagination ul {
  display: inline-flex !important;
  flex-direction: row !important;
  flex-wrap: wrap !important;
  justify-content: center !important;
  gap: .375rem !important;
  width: auto !important;
  max-width: 100% !important;
  white-space: normal !important;
  padding: 0 !important;
  margin: 2rem 0 0 !important;
  list-style: none !important;
  border: 0 !important;
}

.woocommerce-pagination ul.page-numbers li,
.woocommerce nav.woocommerce-pagination ul li {
  display: inline-flex !important;
  margin: 0 !important;
  padding: 0 !important;
  float: none !important;
  border: 0 !important;
}

/* === Mega Menu === */
#mega-menu-dropdown {
  max-height: 80vh;
  overflow-y: auto;
}

#mega-menu-dropdown .grid {
  display: grid !important;
  grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
  gap: 1.5rem !important;
}

@media (max-width: 1024px) {
  #mega-menu-dropdown {
    width: calc(100vw - 48px) !important;
    left: -24px !important;
  }
  #mega-menu-dropdown .grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 640px) {
  #mega-menu-dropdown .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

/* === Mega Menu === */
.mega-menu-dropdown {
  position: absolute;
  left: 0;
  top: 100%;
  width: 900px;
  background: #ffffff;
  border-radius: 0 0 12px 12px;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.15);
  border: 1px solid #e5e7eb;
  border-top: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: all 0.2s ease;
  z-index: 100;
  max-height: 80vh;
  overflow-y: auto;
}

.mega-menu-dropdown.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.mega-menu-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 24px;
}

.mega-menu-parent {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: #1a1a2e;
  letter-spacing: 0.05em;
  margin-bottom: 10px;
  text-decoration: none;
  transition: color 0.15s;
}

.mega-menu-parent:hover {
  color: #FF6B00;
}

.mega-menu-children {
  list-style: none;
  padding: 0;
  margin: 0;
}

.mega-menu-children li {
  margin: 0;
  padding: 0;
}

.mega-menu-children a {
  display: block;
  font-size: 13px;
  color: #6b7280;
  text-decoration: none;
  padding: 3px 0;
  transition: all 0.15s;
  line-height: 1.4;
}

.mega-menu-children a:hover {
  color: #1a1a2e;
  padding-left: 4px;
}

.mega-menu-footer {
  background: #f9fafb;
  border-radius: 0 0 12px 12px;
  padding: 12px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid #f3f4f6;
}

.mega-menu-footer a {
  font-size: 12px;
  font-weight: 600;
  color: #1a1a2e;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color 0.15s;
}

.mega-menu-footer a:hover {
  color: #FF6B00;
}

.mega-menu-footer span {
  font-size: 11px;
  color: #9ca3af;
}

@media (max-width: 1024px) {
  .mega-menu-dropdown {
    width: calc(100vw - 48px);
    left: -24px;
  }
  .mega-menu-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 640px) {
  .mega-menu-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* === Home: category carousel cards === */
.cat-card {
  flex-shrink: 0;
  scroll-snap-align: start;
  width: 190px;
  background: #ffffff;
  border: 1px solid #E7E5E4;
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.cat-card:hover {
  border-color: #0B0B0F;
  box-shadow: 0 10px 25px -12px rgba(11, 11, 15, 0.25);
  transform: translateY(-2px);
}

/* White, like the product photography, so images blend seamlessly */
.cat-card-img {
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  padding: 12px;
  overflow: hidden;
}

.cat-card-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.cat-card:hover .cat-card-img img {
  transform: scale(1.08);
}

.cat-card-text {
  padding: 12px 14px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 2px;
  border-top: 1px solid #F0EFED;
}

.cat-card-text span:first-child {
  font-size: 13px;
  font-weight: 600;
  color: #0B0B0F;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cat-card-text span:last-child {
  font-size: 11px;
  color: #6B7280;
}
