/*
Theme Name: TEWYAG Custom
Author: TEWYAG
Description: Custom theme for TEWYAG - B2B Craft & Packaging Supplies
Version: 1.0.0
*/

/* === CSS Variables === */
:root {
  --green: #2D6A4F;
  --green-dark: #1B4332;
  --terracotta: #E07A5F;
  --terracotta-dark: #C16245;
  --cream: #FAF5EF;
  --dark: #1A1A2E;
  --body: #4A4A4A;
  --border: #E8E0D4;
  --white: #FFFFFF;
  --font-heading: 'Playfair Display', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.7;
  color: var(--body);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--dark);
  margin: 0 0 12px;
  line-height: 1.3;
  font-weight: 700;
}
h1 { font-size: 36px; }
h2 { font-size: 28px; }
h3 { font-size: 22px; }
p { margin: 0 0 16px; }
a { color: var(--green); text-decoration: none; transition: color .2s; }
a:hover { color: var(--green-dark); }
img { max-width: 100%; height: auto; }

/* === Layout === */
.site-container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.site-content { display: flex; gap: 40px; padding: 30px 0; }
.site-main { flex: 1; min-width: 0; }
.site-sidebar { width: 280px; flex-shrink: 0; }
@media (max-width: 768px) {
  .site-content { flex-direction: column; }
  .site-sidebar { width: 100%; }
}

/* === Header === */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
}
.header-inner {
  display: flex; align-items: center;
  max-width: 1200px; margin: 0 auto; padding: 0 20px;
  height: 64px;
}
.site-branding { display: flex; align-items: center; }
.site-title {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 700;
  color: var(--dark);
  text-decoration: none;
  line-height: 1;
}
.site-title:hover { color: var(--green); }
.site-description { display: none; }

/* Navigation */
.header-nav {
  display: flex; align-items: center;
  margin-left: auto;
  gap: 4px;
}
.header-nav .menu {
  display: flex; list-style: none; margin: 0; padding: 0; gap: 2px;
}
.header-nav .menu li { position: relative; }
.header-nav .menu a {
  display: block; padding: 8px 14px;
  font-size: 13px; font-weight: 500;
  color: var(--dark); text-decoration: none;
  border-radius: 6px; transition: all .2s;
}
.header-nav .menu a:hover { background: var(--cream); color: var(--green); }
.header-nav .current-menu-item > a { color: var(--green); font-weight: 600; }

/* Header Actions */
.header-actions { display: flex; align-items: center; gap: 6px; margin-left: 12px; }

/* Search */
.search-toggle {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border: none; background: none;
  cursor: pointer; border-radius: 6px; color: var(--dark);
  transition: all .2s;
}
.search-toggle:hover { background: var(--cream); color: var(--green); }
.search-dropdown {
  display: none; position: absolute; top: 100%; right: 0; z-index: 999;
  background: var(--white); padding: 16px; border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12); width: 300px; margin-top: 4px;
}
.search-dropdown.active { display: block; }
.search-dropdown input {
  width: 100%; padding: 10px 14px; border: 2px solid var(--border);
  border-radius: 6px; font-size: 14px; outline: none;
  font-family: var(--font-body);
}
.search-dropdown input:focus { border-color: var(--green); }

/* Cart */
.cart-link {
  position: relative; display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 6px; color: var(--dark);
  transition: all .2s;
}
.cart-link:hover { background: var(--cream); color: var(--green); }
.cart-count {
  position: absolute; top: 2px; right: 2px;
  background: var(--terracotta); color: var(--white);
  font-size: 9px; font-weight: 700; min-width: 16px; height: 16px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  padding: 0 3px;
}
.menu-toggle {
  display: none; align-items: center; justify-content: center;
  width: 36px; height: 36px; border: none; background: none;
  cursor: pointer; border-radius: 6px; color: var(--dark); margin-left: auto;
}
.menu-toggle:hover { background: var(--cream); }
@media (max-width: 768px) {
  .menu-toggle { display: flex; }
  .header-nav .menu { 
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    background: var(--white); flex-direction: column; padding: 12px;
    border-bottom: 2px solid var(--border); box-shadow: 0 4px 12px rgba(0,0,0,.08);
  }
  .header-nav .menu.active { display: flex; }
  .header-actions { gap: 4px; }
}

/* === Homepage Hero === */
.home-hero {
  background: linear-gradient(135deg, var(--dark) 0%, var(--green-dark) 100%);
  padding: 48px 24px; border-radius: 12px; text-align: center; margin: 20px auto;
  max-width: 1200px;
}
.home-hero h1 {
  font-size: 36px; color: var(--white); margin: 0 auto 10px;
  max-width: 600px; line-height: 1.15;
}
.home-hero p {
  color: rgba(255,255,255,.7); font-size: 15px;
  max-width: 500px; margin: 0 auto 20px; line-height: 1.6;
}
.home-hero .subtitle {
  font-size: 12px; letter-spacing: 3px; text-transform: uppercase;
  color: rgba(255,255,255,.5); margin-bottom: 14px;
}
.hero-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

/* Buttons */
.btn { 
  display: inline-block; padding: 10px 24px; border-radius: 6px;
  font-size: 14px; font-weight: 600; text-decoration: none;
  transition: all .25s; cursor: pointer;
}
.btn-primary { background: var(--terracotta); color: var(--white); }
.btn-primary:hover { background: var(--terracotta-dark); color: var(--white); transform: translateY(-1px); }
.btn-green { background: var(--green); color: var(--white); }
.btn-green:hover { background: var(--green-dark); color: var(--white); transform: translateY(-1px); }
.btn-wa { background: #25D366; color: var(--white); }
.btn-wa:hover { background: #1DA851; color: var(--white); transform: translateY(-1px); }
.btn-outline-light { background: transparent; border: 1.5px solid rgba(255,255,255,.3); color: var(--white); }
.btn-outline-light:hover { border-color: rgba(255,255,255,.6); color: var(--white); }

/* === Home Features === */
.features-grid {
  display: grid; grid-template-columns: repeat(4,1fr);
  gap: 12px; max-width: 1200px; margin: 0 auto 28px;
}
.feature-card {
  background: var(--cream); padding: 16px; border-radius: 8px; text-align: center;
}
.feature-card .icon { font-size: 22px; display: block; margin-bottom: 4px; }
.feature-card h3 { font-size: 13px; font-weight: 600; color: var(--dark); margin: 0 0 2px; font-family: var(--font-body); }
.feature-card p { font-size: 12px; color: #666; margin: 0; }
@media (max-width: 768px) { .features-grid { grid-template-columns: repeat(2,1fr); } }

/* === CATEGORY CARDS - FIXED === */
.cat-grid-new {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 16px !important;
  max-width: 1200px !important;
  margin: 0 auto 32px !important;
}
.cat-grid-new br {
  display: none !important;
}
a.cat-card-new {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 32px 20px !important;
  border-radius: 12px !important;
  text-decoration: none !important;
  min-height: 160px !important;
  transition: all .3s ease !important;
  position: relative !important;
  overflow: hidden !important;
  color: #fff !important;
}
a.cat-card-new::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(255,255,255,.08);
  opacity: 0;
  transition: opacity .3s;
}
a.cat-card-new:hover::before { opacity: 1; }
a.cat-card-new:hover {
  transform: translateY(-4px) !important;
  box-shadow: 0 12px 30px rgba(0,0,0,.15) !important;
}
.cat-icon {
  font-size: 40px !important;
  margin-bottom: 8px !important;
  position: relative;
  z-index: 1;
  line-height: 1;
}
.cat-name {
  font-family: 'Playfair Display', Georgia, serif !important;
  font-size: 18px !important;
  font-weight: 700 !important;
  color: #fff !important;
  position: relative;
  z-index: 1;
  text-align: center;
  line-height: 1.3;
}
.cat-count {
  font-size: 12px !important;
  color: rgba(255,255,255,.7) !important;
  margin-top: 4px !important;
  position: relative;
  z-index: 1;
  text-align: center;
  line-height: 1.3;
}
@media (max-width: 768px) {
  .cat-grid-new { grid-template-columns: repeat(2, 1fr) !important; gap: 12px !important; }
  a.cat-card-new { padding: 24px 16px !important; min-height: 130px !important; }
  .cat-icon { font-size: 32px !important; }
  .cat-name { font-size: 16px !important; }
}
@media (max-width: 480px) {
  .cat-grid-new { grid-template-columns: 1fr !important; }
}

/* === Section Titles === */
.section-title {
  text-align: center; font-size: 22px; margin-bottom: 14px;
  max-width: 1200px; margin-left: auto; margin-right: auto;
}

/* === WooCommerce === */
.woocommerce ul.products { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; }
.woocommerce ul.products li.product { 
  background: var(--white); border: 1px solid var(--border); border-radius: 8px;
  overflow: hidden; transition: all .25s; width: auto !important; margin: 0 !important;
}
.woocommerce ul.products li.product:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,.08); border-color: var(--green); }
.woocommerce ul.products li.product .woocommerce-loop-product__title {
  font-family: var(--font-body); font-size: 14px !important; font-weight: 600 !important;
  color: var(--dark); padding: 12px 14px 4px !important;
}
.woocommerce ul.products li.product .price {
  font-size: 15px !important; font-weight: 700 !important;
  color: var(--green) !important; padding: 0 14px 12px !important;
}
.woocommerce ul.products li.product .button {
  background: var(--green) !important; color: var(--white) !important;
  border-radius: 6px !important; font-size: 12px !important;
  font-weight: 600 !important; padding: 8px 16px !important;
  margin: 0 14px 14px !important;
}
@media (max-width: 768px) { .woocommerce ul.products { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 480px) { .woocommerce ul.products { grid-template-columns: 1fr; } }

/* === CTA === */
.home-cta {
  background: var(--dark); padding: 28px 24px; border-radius: 8px;
  text-align: center; max-width: 1200px; margin: 0 auto;
}
.home-cta h2 { font-size: 20px; color: var(--white); margin-bottom: 8px; }
.home-cta p { font-size: 13px; color: rgba(255,255,255,.6); margin-bottom: 14px; }

/* === Sidebar === */
.widget { margin-bottom: 24px; }
.widget-title {
  font-family: var(--font-heading); font-size: 18px;
  color: var(--dark); margin-bottom: 12px;
  padding-bottom: 8px; border-bottom: 2px solid var(--border);
}
.widget ul { list-style: none; margin: 0; }
.widget ul li { padding: 8px 0; border-bottom: 1px solid var(--cream); }
.widget ul li a { font-size: 14px; color: var(--body); }
.widget ul li a:hover { color: var(--green); }
.widget ul li.current-cat a { color: var(--green); font-weight: 600; }
.widget ul .count { float: right; color: #999; font-size: 12px; }

/* === Footer === */
.site-footer {
  background: var(--dark); color: rgba(255,255,255,.7);
  padding: 40px 20px 24px; margin-top: 40px;
}
.footer-inner { max-width: 1200px; margin: 0 auto; }
.footer-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 30px; margin-bottom: 24px; }
.footer-col h3 {
  font-family: var(--font-heading); font-size: 16px;
  color: var(--white); margin-bottom: 12px;
}
.footer-col p, .footer-col a { font-size: 13px; color: rgba(255,255,255,.6); }
.footer-col a:hover { color: var(--white); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.1);
  padding-top: 16px; text-align: center; font-size: 13px;
}
@media (max-width: 768px) { .footer-grid { grid-template-columns: 1fr; } }

/* === Page Content === */
.page-content { padding: 20px 0; }
.page-content h1 { font-size: 32px; margin-bottom: 20px; }

/* === Utility === */
.text-center { text-align: center; }
.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }

