/* =========================================================
   HOME PAGE / MENU PAGE
   File: assets/css/home.css
========================================================= */

:root{
  --red: #ff0000;
  --orange: #ff6a00;
  --text: #111111;
  --muted: #666666;
  --line: #e9e9e9;
  --white: #ffffff;
  --bg: #f7f7f7;
}

/* Base */
body{
  font-family: "Poppins", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

/* Main page wrapper from front-page.php */
.public-page{
  background: var(--bg);
}

/* Main container */
.container{
  max-width: 1200px;
  margin: 18px auto;
  background: var(--white);
  padding: 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  box-sizing: border-box;
}

/* Layout */
.menu-layout{
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 16px;
  align-items: start;
}

/* Sidebar */
.cat-side{
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 12px;
  position: sticky;
  top: 110px;
  height: fit-content;
  box-sizing: border-box;
}

.cat-side-title{
  font-weight: 600;
  margin: 6px 6px 10px;
  font-size: 14px;
  color: var(--text);
}

.cat-link{
  display: block;
  padding: 10px 10px;
  border-radius: 12px;
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  font-size: 13.5px;
  border: 1px solid var(--line);
  margin-bottom: 8px;
  background: #fff;
  white-space: nowrap;
  transition: 0.2s ease;
  box-sizing: border-box;
}

.cat-link:hover{
  border-color: rgba(255, 0, 0, 0.35);
  color: var(--red);
}

.cat-link.active{
  background: var(--red);
  color: #fff;
  border-color: var(--red);
}

/* Items area */
.items-area{
  min-width: 0;
  padding-left: 10px;
  padding-right: 10px;
  box-sizing: border-box;
}

/* Head */
.section-head{
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin: 6px 0 14px;
}

.section-titles{
  min-width: 0;
}

.menu-title{
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
}

.result-note{
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 400;
}

.empty-box{
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 14px;
  padding: 16px;
  color: var(--muted);
  font-size: 13px;
}

/* Category blocks */
.cat-block{
  margin-bottom: 18px;
}

.cat-block-head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 14px 0 10px;
}

.cat-block-head h3{
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.cat-viewall{
  font-size: 12.5px;
  font-weight: 600;
  color: var(--red);
  text-decoration: none;
}

.cat-viewall:hover{
  text-decoration: underline;
}

/* Product grid */
.product-grid{
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

/* Product card */
.product-card{
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.product-card:hover{
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.06);
}

.product-img{
  display: block;
  background: #f3f3f3;
  text-decoration: none;
}

.product-img img{
  width: 100%;
  height: 150px;
  object-fit: cover;
  display: block;
}

.product-body{
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1 1 auto;
  align-items: center;
  text-align: center;
  box-sizing: border-box;
}

.product-title{
  font-weight: 600;
  font-size: 14px;
  color: var(--red);
  line-height: 1.25;
  text-align: center;
  margin: 0;
}

.product-desc{
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.4;
  text-align: center;
  margin: 0;
}

.product-actions{
  margin-top: auto;
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.product-price{
  font-weight: 600;
  color: var(--text);
  font-size: 13px;
  text-align: center;
  margin: 0;
}

/* WooCommerce price HTML compatibility */
.product-price ins,
.product-price bdi,
.product-price span,
.product-price .amount{
  color: inherit;
  font-weight: inherit;
  text-decoration: none;
}

.product-price del{
  opacity: 0.65;
  margin-right: 6px;
}

/* Button */
.product-btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 14px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  background: var(--red);
  color: #fff;
  width: auto;
  min-width: 0;
  max-width: 100%;
  white-space: nowrap;
  border: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.product-btn:hover{
  opacity: 0.92;
  color: #fff;
}

.product-btn:focus{
  outline: none;
}

/* Slightly tighter desktop button */
@media (min-width: 521px){
  .product-btn{
    padding: 9px 14px;
  }
}

/* =========================================
   Responsive
========================================= */

@media (max-width: 1100px){
  .product-grid{
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px){
  .menu-layout{
    grid-template-columns: 1fr;
  }

  .cat-side{
    position: relative;
    top: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 10px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }

  .cat-side-title{
    display: none;
  }

  .cat-link{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0;
    flex: 0 0 auto;
    padding: 10px 14px;
  }

  .product-grid{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .items-area{
    padding-left: 14px;
    padding-right: 14px;
  }
}

@media (max-width: 520px){
  .container{
    padding: 12px;
    border-radius: 12px;
    margin: 14px auto;
  }

  .menu-title{
    font-size: 16px;
  }

  .section-head{
    align-items: flex-start;
  }

  .product-grid{
    grid-template-columns: 1fr;
  }

  .product-title{
    font-size: 13.5px;
  }

  .product-desc{
    font-size: 12px;
  }

  .product-btn{
    width: auto !important;
    min-width: 0 !important;
    padding: 9px 14px;
  }

  .product-img img{
    height: 190px;
  }
}

/* FIX CLICK BLOCKING ISSUE */
.product-card {
  position: relative;
}

/* Ensure image does NOT block button */
.product-img {
  position: relative;
  z-index: 1;
}

/* Bring content above image */
.product-body {
  position: relative;
  z-index: 2;
}

/* Ensure button is always clickable */
.product-btn {
  position: relative;
  z-index: 3;
  pointer-events: auto;
}