/* ================================
   HAMSK INTERNATIONAL - PHP INTEGRATION OVERRIDES
   These rules bridge the static theme with dynamic PHP output
   ================================ */

/* Search form (was static div in theme, now a form) */
.header .search-box { display: flex; align-items: center; }
.header .search-box input { flex: 1; border: none; outline: none; background: transparent; padding: 8px 12px; font-size: 14px; }
.header .search-box button { border: none; background: var(--primary, #1e3a8a); color: #fff; padding: 8px 14px; cursor: pointer; border-radius: 4px; }
.header .search-box button:hover { background: var(--primary-dark, #172554); }

/* Homepage inquiry form styling */
.home-inquiry { background: #f8fafc; padding: 60px 0; }
.home-inquiry .inquiry-wrap { max-width: 900px; margin: 0 auto; background: #fff; padding: 40px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.08); }
.home-inquiry h2 { text-align: center; margin-bottom: 8px; color: var(--primary, #1e3a8a); }
.home-inquiry .sub { text-align: center; color: #64748b; margin-bottom: 30px; }
.home-inquiry .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 16px; }
.home-inquiry .form-group { display: flex; flex-direction: column; }
.home-inquiry .form-group label { font-weight: 600; font-size: 13px; margin-bottom: 6px; color: #334155; }
.home-inquiry .form-group input,
.home-inquiry .form-group select,
.home-inquiry .form-group textarea {
  border: 1px solid #e2e8f0; padding: 10px 14px; border-radius: 6px; font-size: 14px; font-family: inherit;
  transition: border-color .2s;
}
.home-inquiry .form-group input:focus,
.home-inquiry .form-group select:focus,
.home-inquiry .form-group textarea:focus { outline: none; border-color: var(--primary, #1e3a8a); }
.home-inquiry .form-group.full { grid-column: 1 / -1; }
.home-inquiry .security-code-display {
  background: #f1f5f9; padding: 10px 14px; border-radius: 6px; font-weight: 700;
  font-size: 18px; letter-spacing: 3px; color: var(--primary, #1e3a8a); text-align: center;
  border: 1px dashed #cbd5e1; user-select: all;
}
.home-inquiry .btn-submit {
  background: var(--secondary, #dc2626); color: #fff; border: none; padding: 14px 40px;
  border-radius: 6px; font-size: 15px; font-weight: 700; cursor: pointer; margin-top: 20px;
  display: inline-flex; align-items: center; gap: 10px; transition: background .3s;
}
.home-inquiry .btn-submit:hover { background: #b91c1c; }
.home-inquiry .form-success {
  background: #dcfce7; color: #166534; padding: 14px 20px; border-radius: 6px;
  margin-bottom: 20px; display: flex; align-items: center; gap: 10px; font-weight: 600;
}

@media (max-width: 768px) {
  .home-inquiry .form-row { grid-template-columns: 1fr; }
  .home-inquiry .inquiry-wrap { padding: 24px; }
}

/* Products slider on homepage (uses hero-style cards) */
.featured-products { padding: 60px 0; background: #fff; }
.featured-products .section-title { text-align: center; margin-bottom: 40px; }
.featured-products .section-title span { color: var(--secondary, #dc2626); font-weight: 600; text-transform: uppercase; letter-spacing: 2px; font-size: 13px; }
.featured-products .section-title h2 { margin-top: 8px; }
.featured-products .products-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px;
}
.featured-products .product-card {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; overflow: hidden;
  transition: transform .3s, box-shadow .3s;
}
.featured-products .product-card:hover { transform: translateY(-4px); box-shadow: 0 12px 28px rgba(0,0,0,.1); }
.featured-products .product-card .p-img { height: 220px; overflow: hidden; background: #f1f5f9; }
.featured-products .product-card .p-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.featured-products .product-card:hover .p-img img { transform: scale(1.08); }
.featured-products .product-card .p-info { padding: 16px 18px; }
.featured-products .product-card .p-cat { color: var(--secondary, #dc2626); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; }
.featured-products .product-card h4 { font-size: 15px; margin: 8px 0 6px; color: var(--primary, #1e3a8a); }
.featured-products .product-card .p-code { color: #64748b; font-size: 13px; }
.featured-products .product-card .p-btn {
  display: inline-block; margin-top: 12px; color: var(--primary, #1e3a8a);
  font-weight: 600; font-size: 13px; border-bottom: 2px solid transparent; transition: border-color .3s;
}
.featured-products .product-card:hover .p-btn { border-color: var(--primary, #1e3a8a); }

@media (max-width: 992px) { .featured-products .products-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 768px) { .featured-products .products-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .featured-products .products-grid { grid-template-columns: 1fr; } }

/* Compat: force cart-count to appear even when 0 */
.header-actions .cart-count { display: inline-flex !important; }

/* Category cards - ensure images from DB or fallback fit */
.categories-grid .category-card img { height: 260px; object-fit: cover; width: 100%; }

/* Page hero used by content.php / products.php / etc */
.page-hero-simple {
  background: linear-gradient(135deg, #1e3a8a 0%, #172554 100%);
  color: #fff; padding: 60px 0 50px; text-align: center;
}
.page-hero-simple h1 { color: #fff; font-size: clamp(28px, 4vw, 44px); margin-bottom: 10px; }
.page-hero-simple .breadcrumb { color: rgba(255,255,255,.85); font-size: 14px; }
.page-hero-simple .breadcrumb a { color: #fbbf24; }
.page-hero-simple .breadcrumb a:hover { text-decoration: underline; }

/* Content page body */
.content-page-body { padding: 50px 0; background: #fff; }
.content-page-body .content-wrap { max-width: 1100px; margin: 0 auto; }
.content-page-body .content-wrap img { max-width: 100%; height: auto; border-radius: 8px; margin: 12px 0; }
.content-page-body .content-wrap h1,
.content-page-body .content-wrap h2,
.content-page-body .content-wrap h3 { color: var(--primary, #1e3a8a); margin: 18px 0 12px; }
.content-page-body .content-wrap p { margin-bottom: 14px; line-height: 1.75; color: #334155; }

/* Header active menu state */
.main-nav .menu > li > a.active { color: #ffffff; var(--secondary, #dc2626); }

/* Fix: back-top button visibility */
.back-top {
  position: fixed; bottom: 22px; right: 90px; width: 46px; height: 46px;
  border-radius: 50%; background: var(--primary, #1e3a8a); color: #fff; border: none;
  cursor: pointer; opacity: 0; visibility: hidden; transition: all .3s; z-index: 999;
  display: flex; align-items: center; justify-content: center; font-size: 16px;
}
.back-top.show { opacity: 1; visibility: visible; }
.back-top:hover { background: var(--primary-dark, #172554); }
