/*
Theme Name: Olshop Cilacap
Theme URI: https://wp.timku.xyz/
Description: Child theme Ollie untuk Pusat Oleh-Oleh Khas Cilacap. Palet oranye #FF6B35 + teal #004E64 sesuai mockup desain.
Author: Chartiva
Template: ollie
Version: 1.3.0
Requires at least: 6.5
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: olshop-cilacap
*/

/* ============ Palet & tipografi dari mockup ============ */
:root {
  --oc-primary: #FF6B35;
  --oc-secondary: #004E64;
  --oc-accent: #FFD166;
  --oc-surface: #F8F9FA;
}

/* ============ Header: cegah menu terlalu padat ============ */
.wp-site-blocks > header .wp-block-navigation {
  font-size: 0.82rem;
}
.wp-site-blocks > header .wp-block-navigation-item__content {
  padding-left: 0.35rem;
  padding-right: 0.35rem;
  white-space: nowrap;
}
/* Tombol header jangan terlalu lebar */
.wp-site-blocks > header .wp-block-button__link {
  padding: 0.6rem 1.15rem;
  font-size: 0.85rem;
  white-space: nowrap;
}
/* Ikon keranjang sejajar */
.wp-site-blocks > header .wc-block-mini-cart__button {
  padding: 0.5rem;
}

/* ============ Katalog: hapus gap & rapikan grid ============ */
/* Kolom filter kategori jangan menyisakan ruang mati */
.wc-block-product-categories.is-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  padding: 0;
  margin: 0 0 2rem 0;
  list-style: none;
}
.wc-block-product-categories-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  list-style: none;
  padding: 0;
  margin: 0;
}
.wc-block-product-categories-list-item {
  background: var(--oc-surface);
  border: 1px solid #EAEAEF;
  border-radius: 1rem;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
}
.wc-block-product-categories-list-item:hover {
  background: #FFF0E9;
}
.wc-block-product-categories-list-item-count {
  color: var(--oc-primary);
  font-weight: 700;
}

/* ============ Kartu produk: tinggi seragam & rapi ============ */
.wp-block-post-template.is-layout-grid {
  align-items: stretch;
  row-gap: 2rem;
}
.wp-block-post-template.is-layout-grid > li,
.wp-block-post-template.is-layout-grid .wp-block-post {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.wp-block-post-template .wp-block-post > .wp-block-group {
  display: flex;
  flex-direction: column;
  height: 100%;
  gap: 0.5rem;
}
.wp-block-post-template .wp-block-post-featured-image {
  margin-bottom: 0.5rem;
  /* Latar kontras: ilustrasi produk berwarna terang, butuh bingkai agar terlihat */
  background: linear-gradient(135deg, #FFF1E8 0%, #FDE8DA 100%);
  border-radius: 1rem;
  padding: 0;
  overflow: hidden;
  border: 1px solid #F3D9C7;
}
.wp-block-post-template .wp-block-post-featured-image img {
  border-radius: 1rem;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  width: 100%;
  mix-blend-mode: normal;
  filter: saturate(1.12) contrast(1.06);
}
.wp-block-post-template .wp-block-post-title {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.35;
  margin: 0;
}
.wp-block-post-template .wp-block-post-title a {
  text-decoration: none;
}
.wp-block-post-template .woocommerce-Price-amount {
  color: var(--oc-primary);
  font-weight: 800;
}
/* Harga coret lebih kecil & abu */
.wp-block-post-template del .woocommerce-Price-amount {
  color: #9AA0A6;
  font-weight: 500;
  font-size: 0.85em;
}
.wp-block-post-template ins {
  text-decoration: none;
}

/* ============ Kartu gaya WooCommerce klasik ============ */
ul.products li.product {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
}
ul.products li.product img {
  border-radius: 1rem;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}
ul.products li.product .price {
  color: var(--oc-primary);
  font-weight: 800;
}
.woocommerce span.onsale {
  background-color: var(--oc-primary);
  border-radius: 0.75rem;
  padding: 0.35rem 0.75rem;
  font-weight: 700;
}

/* ============ MOBILE: grid 2 kolom, bukan 1 ============ */
@media (max-width: 781px) {
  .wp-block-post-template.is-layout-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    column-gap: 0.75rem;
    row-gap: 1.25rem;
  }
  .wp-block-post-template .wp-block-post-title {
    font-size: 0.9rem;
  }
  ul.products {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
  }
  /* Tombol jangan terlalu lebar di header mobile */
  .wp-site-blocks > header .wp-block-button__link {
    padding: 0.55rem 0.85rem;
    font-size: 0.78rem;
  }
}

/* ============ Target sentuh nyaman ============ */
.wp-block-button__link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ============ Hilangkan gap berlebih sebelum footer ============ */
.wp-site-blocks {
  gap: 0;
}
.wp-site-blocks > main {
  margin-top: 0;
  margin-bottom: 0;
}


/* ============ Header: nav statis & logo badge ============ */
.oc-logo-badge {
  line-height: 1;
  letter-spacing: 0.02em;
}
/* Nav desktop: flex manual (tanpa class is-layout-flex dari blok) */
div.oc-nav-static,
.wp-block-group.oc-nav-static,
.oc-nav-static {
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: center !important;
  align-items: center !important;
  gap: 2px;
}
.oc-nav-item {
  margin: 0 !important;
  line-height: 1;
}
.oc-nav-item a {
  color: var(--oc-secondary);
  text-decoration: none;
}
.oc-nav-item a:hover {
  color: var(--oc-primary);
}
/* sembunyikan nav statis di layar kecil, ganti ke ringkas */
@media (max-width: 900px) {
  .wp-site-blocks > header .wp-block-group.oc-nav-static,
  header .wp-block-group.oc-nav-static,
  .wp-block-group.oc-nav-static,
  .wp-site-blocks > header .oc-nav-static,
  header .oc-nav-static,
  .oc-nav-static {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    overflow: hidden !important;
  }
  /* Header jadi satu baris ringkas di mobile */
  .wp-site-blocks > header > div > div > div {
    flex-wrap: wrap;
  }
  .wp-site-blocks > header .wp-block-site-title {
    font-size: 1rem !important;
  }
  .wp-site-blocks > header p.has-secondary-color {
    display: none !important;
  }
}
/* Logo & tombol jangan melar di mobile */
@media (max-width: 781px) {
  .wp-site-blocks > header .wp-block-site-title {
    font-size: 1rem !important;
  }
  .wp-site-blocks > header .wp-block-site-title + p {
    display: none;
  }
  .wp-site-blocks > header .wc-block-mini-cart__button {
    padding: 0.45rem 0.6rem;
  }
}
