/*
Theme Name: HPC-Mart
Theme URI: https://example.com
Author: Callie
Description: Custom marketplace theme with rotating job ads popup.
Version: 2.0 (Full UI Upgrade)
*/

/* =========================
   DESIGN SYSTEM (EYE CATCHY)
   ========================= */

:root {
  --primary: #6c5ce7;
  --primary-dark: #341f97;
  --accent: #00cec9;
  --accent-warm: #fdcb6e;

  --bg-light: #f8f9ff;
  --bg-white: #ffffff;

  --text-main: #2d3436;
  --text-soft: #636e72;

  --radius-lg: 22px;
  --radius-md: 14px;
  --radius-sm: 10px;

  --shadow-soft: 0 10px 30px rgba(0,0,0,0.08);
  --shadow-strong: 0 30px 70px rgba(0,0,0,0.18);
}

/* =========================
   RESET
   ========================= */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Inter", Arial, Helvetica, sans-serif;
}

body {
  background: var(--bg-light);
  color: var(--text-main);
  line-height: 1.6;
}

/* =========================
   HEADER
   ========================= */

.site-header {
  background: linear-gradient(
    135deg,
    var(--primary-dark),
    var(--primary),
    var(--accent)
  );
  padding: 18px 26px;
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-strong);
}

.site-header h1 {
  color: #fff;
  font-size: 26px;
  font-weight: 900;
  letter-spacing: 0.5px;
}

/* =========================
   SEARCH BAR (FIXED & CLEAN)
   ========================= */

.search-bar {
  flex: 1;
  display: flex;
  justify-content: center;
}

.search-bar form {
  width: 100%;
  max-width: 420px;
  position: relative;
}

.site-header input[type="search"] {
  width: 100%;
  padding: 14px 54px 14px 20px;
  border-radius: 40px;
  border: none;
  outline: none;
  font-size: 15px;
  box-shadow: var(--shadow-soft);
}

.search-bar button,
.search-bar input[type="submit"] {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border: none;
  color: #fff;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
}
/* =========================
   MIDDLE PAGE VIDEO
   ========================= */

.mid-page-video {
  padding: 90px 20px;
  display: flex;
  justify-content: center;
}

.mid-video-container {
  position: relative;
  width: 100%;
  max-width: 1400px;
  aspect-ratio: 21 / 9;
  overflow: hidden;
  border-radius: 24px;
  box-shadow: 0 40px 90px rgba(0,0,0,0.45);
}

.mid-video-container iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* SOUND OVERLAY */
.video-sound-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    rgba(0,0,0,0.6),
    rgba(0,0,0,0.4)
  );
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(22px, 4vw, 42px);
  font-weight: 900;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 2px;
  cursor: pointer;
  z-index: 2;
  animation: pulseSound 1.4s infinite;
}

@keyframes pulseSound {
  0% { transform: scale(1); }
  50% { transform: scale(1.06); }
  100% { transform: scale(1); }
}

/* MOBILE */
@media (max-width: 768px) {
  .mid-video-container {
    aspect-ratio: 16 / 9;
  }
}


/* =========================
   CART
   ========================= */

.cart {
  position: relative;
  color: #fff;
  font-size: 22px;
  text-decoration: none;
  transition: transform 0.2s ease;
}

.cart:hover {
  transform: scale(1.1);
}

.cart span {
  position: absolute;
  top: -8px;
  right: -12px;
  background: #ff4757;
  padding: 3px 7px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: bold;
}

/* =========================
   HERO
   ========================= */

.hero {
  background: linear-gradient(120deg, var(--primary), var(--accent));
  padding: 90px 26px;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 44px;
  align-items: center;
  color: #fff;
}

.hero h2 {
  font-size: clamp(30px, 4vw, 46px);
  font-weight: 900;
  margin-bottom: 16px;
}

.hero p {
  font-size: 18px;
  max-width: 540px;
  margin-bottom: 30px;
}

.hero-btn {
  background: linear-gradient(135deg, #ffffff, var(--accent-warm));
  color: var(--primary-dark);
  padding: 14px 38px;
  border-radius: 40px;
  font-weight: 900;
  text-decoration: none;
  box-shadow: var(--shadow-strong);
  transition: transform 0.25s ease;
}

.hero-btn:hover {
  transform: scale(1.08);
}

.hero-image {
  min-height: 280px;
  background-size: cover;
  background-position: center;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-strong);
}

/* =========================
   PRODUCTS
   ========================= */

.section {
  padding: 80px 26px;
}

.section h3 {
  text-align: center;
  font-size: 34px;
  font-weight: 900;
  margin-bottom: 44px;
}

.products {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 32px;
  max-width: 1200px;
  margin: auto;
}

.product {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.product:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-strong);
}

.product img {
  width: 100%;
  height: 170px;
  object-fit: cover;
  border-radius: var(--radius-md);
  margin-bottom: 14px;
}

.product h4 {
  font-size: 18px;
  margin-bottom: 8px;
}

.price {
  font-size: 18px;
  font-weight: 900;
  color: var(--primary);
  margin-bottom: 14px;
}

.add-cart {
  margin-top: auto;
  padding: 13px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  text-align: center;
  border-radius: var(--radius-md);
  font-weight: 800;
  text-decoration: none;
  transition: transform 0.2s ease;
}

.add-cart:hover {
  transform: scale(1.06);
}

/* =========================
   FOOTER
   ========================= */

.site-footer {
  background: var(--primary-dark);
  color: #fff;
  text-align: center;
  padding: 26px;
  font-size: 14px;
}

/* =========================
   RESPONSIVE
   ========================= */

@media (max-width: 768px) {
  .hero {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero p {
    margin-left: auto;
    margin-right: auto;
  }

  .search-bar {
    width: 100%;
    order: 3;
  }

  .search-bar form {
    max-width: 100%;
  }
}

/* =====================================================
   HPC JOB AD POPUP (SAFE – LOGIC UNTOUCHED)
   ===================================================== */

.hpc-jobad-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.85);
  z-index: 999999;
}

.hpc-jobad-box {
  position: relative;
  width: 420px;
  max-width: 92%;
  padding: 38px 32px;
  border-radius: 26px;
  text-align: center;
  background: linear-gradient(135deg, #6c5ce7, #00cec9);
  color: #ffffff;
  box-shadow: 0 30px 70px rgba(0,0,0,0.5);
}

.hpc-jobad-close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.25);
  color: #fff;
  font-size: 22px;
  cursor: pointer;
}

.hpc-jobad-title {
  font-size: 26px;
  font-weight: 900;
  margin-bottom: 14px;
}

.hpc-jobad-text {
  font-size: 17px;
  margin-bottom: 28px;
}

.hpc-jobad-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.hpc-jobad-btn {
  padding: 14px 28px;
  border-radius: 30px;
  font-weight: 800;
  text-decoration: none;
  background: #fff;
  color: var(--primary-dark);
}

/* =========================
   ROTATION ANIMATIONS
   ========================= */

.hpc-jobad-fade-out {
  animation: hpcJobAdFadeOut 0.4s ease forwards;
}

.hpc-jobad-fade-in {
  animation: hpcJobAdFadeIn 0.45s ease forwards;
}

@keyframes hpcJobAdFadeOut {
  to { opacity: 0; transform: translateX(-30px); }
}

@keyframes hpcJobAdFadeIn {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}
