/* ==========================================================================
   Coolmate Race Photo Search — KV cloned from coolmate.me
   ========================================================================== */

:root {
  --cm-black:      #1A1A1A;
  --cm-ink:        #2A2A2A;
  --cm-text:       #333333;
  --cm-muted:      #707070;
  --cm-line:       #E5E5E5;
  --cm-bg:         #F5F5F5;
  --cm-bg-soft:    #FAFAFA;
  --cm-white:      #FFFFFF;

  --cm-orange:     #FF4742;
  --cm-orange-2:   #FF6A40;
  --cm-yellow:     #FFD400;
  --cm-blue:       #1F50FF;

  --cm-radius:     10px;
  --cm-radius-sm:  6px;
  --cm-shadow:     0 4px 14px rgba(0,0,0,.06);
  --cm-shadow-lg:  0 10px 30px rgba(0,0,0,.10);

  --cm-header-h:        80px;
  --cm-header-h-shrink: 60px;

  --cm-container: 1280px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  color: var(--cm-text);
  background: var(--cm-white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

.container {
  width: 100%;
  max-width: var(--cm-container);
  margin: 0 auto;
  padding: 0 24px;
}

/* ==========================================================================
   BLOCK 1 — HEADER (logo + Trang chủ only)
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--cm-white);
  border-bottom: 1px solid transparent;
  transition: box-shadow .25s ease, border-color .25s ease;
}
.site-header.is-scrolled {
  box-shadow: 0 2px 10px rgba(0,0,0,.06);
  border-bottom-color: var(--cm-line);
}

.nav-wrap {
  height: var(--cm-header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  transition: height .25s ease;
}
.site-header.is-scrolled .nav-wrap {
  height: var(--cm-header-h-shrink);
}

.brand {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  transition: transform .25s ease;
}
.site-header.is-scrolled .brand { transform: scale(.9); }

.brand-logo {
  height: 56px;
  width: auto;
  display: block;
  transition: height .25s ease;
}
.site-header.is-scrolled .brand-logo { height: 44px; }

.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}
.main-nav a {
  position: relative;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  color: var(--cm-black);
  letter-spacing: .2px;
  text-transform: uppercase;
  border-radius: 999px;
  transition: color .15s ease, background .15s ease;
}
.main-nav a:hover { color: var(--cm-orange); background: var(--cm-bg); }

/* ==========================================================================
   BLOCK 2 — INPUT / SEARCH
   ========================================================================== */



.search-section {
  background-image: url('uploads/banner_pc.png');
  background-size: 100% 90%;
  background-position: center;
  background-repeat: no-repeat;
  padding: 56px 0 48px;
  position: relative;
  overflow: hidden;
}

@media (max-width: 767px) {
  .search-section {
    background-image: url('uploads/banner_mobile.png');
    background-size: contain;
    background-position: bottom center;
  }
}

.search-head {
  text-align: center;
  margin-bottom: 32px;
  position: relative;
  z-index: 1;
}
.search-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--cm-black);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 16px;
}
.search-eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  background: var(--cm-orange);
  border-radius: 50%;
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(1.5); opacity: .5; }
}

.search-title {
  font-size: clamp(28px, 4.5vw, 44px);
  font-weight: 800;
  margin: 0 0 10px;
  letter-spacing: -.5px;
  line-height: 1.15;
}
.search-title .accent { color: var(--cm-orange); }
.search-sub {
  font-size: 15px;

  max-width: 560px;
  margin: 40px auto;
}

.search-card {
  background: rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: 1px solid var(--cm-line);
  border-radius: 16px;
  box-shadow: var(--cm-shadow-lg);
  padding: 24px;
  max-width: 880px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.search-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.field { display: flex; flex-direction: column; gap: 8px; }
.field-label {
  font-size: 13px; font-weight: 600; color: var(--cm-black);
  display: flex; align-items: center; gap: 6px;
}
.field-label .req { color: var(--cm-orange); }
.field-help { font-size: 12px; color: var(--cm-muted); }

.bib-input {
  height: 56px;
  border: 1.5px solid var(--cm-line);
  border-radius: var(--cm-radius);
  padding: 0 18px;
  font-size: 18px;
  font-weight: 700;
  color: var(--cm-black);
  letter-spacing: 1px;
  background: #fff;
  transition: border-color .15s ease, box-shadow .15s ease;
  font-family: inherit;
  width: 100%;
}
.bib-input::placeholder { color: #BDBDBD; font-weight: 500; letter-spacing: 0; }
.bib-input:focus {
  outline: 0;
  border-color: var(--cm-orange);
  box-shadow: 0 0 0 4px rgba(255,71,66,.1);
}

.upload-drop {
  height: 56px;
  border: 1.5px dashed var(--cm-line);
  border-radius: var(--cm-radius);
  padding: 0 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--cm-bg-soft);
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
  position: relative;
  overflow: hidden;
}
.upload-drop:hover {
  border-color: var(--cm-orange);
  background: #FFF7F2;
}
.upload-drop.is-active {
  border-color: var(--cm-orange);
  border-style: solid;
  background: #FFF7F2;
}
.upload-drop input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.upload-icon {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--cm-orange);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.upload-icon svg { width: 18px; height: 18px; }
.upload-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.upload-text strong { font-size: 13px; font-weight: 600; color: var(--cm-black); }
.upload-text span { font-size: 11px; color: var(--cm-muted); }
.upload-thumb {
  width: 40px; height: 40px;
  border-radius: 6px;
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
  display: none;
  border: 1px solid var(--cm-line);
}
.upload-drop.has-file .upload-thumb { display: block; }
.upload-drop.has-file .upload-icon { display: none; }

.search-actions { display: flex; gap: 12px; align-items: center; }
.btn {
  height: 52px;
  padding: 0 28px;
  border-radius: var(--cm-radius);
  border: 0;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .3px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform .12s ease, background .15s ease, box-shadow .15s ease;
}
.btn-primary {
  background: var(--cm-orange);
  color: #fff;
  flex: 1;
  text-transform: uppercase;
  box-shadow: 0 6px 18px rgba(255,71,66,.32);
}
.btn-primary:hover { background: #F03934; box-shadow: 0 8px 24px rgba(255,71,66,.42); }
.btn-primary:active { transform: translateY(1px); }
.btn-ghost { background: var(--cm-bg); color: var(--cm-black); }
.btn-ghost:hover { background: #ECECEC; }
.btn svg { width: 18px; height: 18px; }

/* ==========================================================================
   BLOCK 3 — PHOTO GRID (5 x 30 = 150, ratio 3:2)
   ========================================================================== */

.results-section {
  padding: 40px 0 64px;
  background: var(--cm-white);
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}
.photo-card {
  position: relative;
  aspect-ratio: 3 / 2;
  border-radius: 8px;
  overflow: hidden;
  background: var(--cm-bg);
  cursor: pointer;
  display: block;
  isolation: isolate;
}
.photo-card .ph-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s ease;
}
.photo-card:hover .ph-img { transform: scale(1.06); }
.photo-card .ph-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(0,0,0,.7) 100%);
  opacity: 0;
  transition: opacity .25s ease;
  display: flex;
  align-items: flex-end;
  padding: 10px;
}
.photo-card:hover .ph-overlay { opacity: 1; }
.photo-card .ph-bib {
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: var(--cm-orange);
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: .5px;
}
.photo-card .ph-zoom {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(4px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity .2s ease, transform .2s ease;
}
.photo-card:hover .ph-zoom { opacity: 1; transform: translateY(0); }
.photo-card .ph-zoom svg { width: 14px; height: 14px; color: var(--cm-black); }

.photo-card::after {
  content: "COOLMATE • RUN";
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%) rotate(-4deg);
  font-size: 10px;
  font-weight: 800;
  color: rgba(255,255,255,.55);
  letter-spacing: 2px;
  pointer-events: none;
  text-shadow: 0 1px 2px rgba(0,0,0,.4);
  z-index: 2;
}

.load-more { display: flex; justify-content: center; margin-top: 32px; }
.btn-outline {
  height: 48px;
  padding: 0 32px;
  border-radius: var(--cm-radius);
  border: 1.5px solid var(--cm-black);
  background: #fff;
  color: var(--cm-black);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .3px;
  text-transform: uppercase;
  transition: background .15s ease, color .15s ease;
}
.btn-outline:hover { background: var(--cm-black); color: #fff; }

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.92);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 40px 80px;
}
.lightbox.is-open { display: flex; }
.lightbox-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
}
.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255,255,255,.12);
  color: #fff;
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  transition: background .15s ease;
}
.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover { background: rgba(255,255,255,.2); }
.lightbox-close { top: 24px; right: 24px; }
.lightbox-prev  { left: 24px; top: 50%; transform: translateY(-50%); }
.lightbox-next  { right: 24px; top: 50%; transform: translateY(-50%); }
.lightbox-close svg, .lightbox-prev svg, .lightbox-next svg { width: 20px; height: 20px; }
.lightbox-meta {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,.6);
  color: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 12px;
  backdrop-filter: blur(8px);
}
.lightbox-meta .lb-bib {
  background: var(--cm-orange);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  letter-spacing: .5px;
}

/* ==========================================================================
   BLOCK 4 — FOOTER (1:1 from coolmate.me — DARK BLACK theme)
   ========================================================================== */

.site-footer {
  background: #000;
  color: #C9C9C9;
  padding: 56px 0 24px;
  font-size: 13px;
}

/* Top: listening block | hotline/email stack | social */
.footer-contacts {
  display: grid;
  grid-template-columns: 1.4fr 1.2fr auto;
  gap: 48px;
  align-items: center;
  padding-bottom: 36px;
  border-bottom: 1px solid rgba(255,255,255,.12);
}

.listening-block h3 {
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  margin: 0 0 10px;
  letter-spacing: .2px;
  text-transform: uppercase;
}
.listening-block h3 .thin {
  font-weight: 400;
  text-transform: none;
  font-style: italic;
}
.listening-block p {
  margin: 0 0 16px;
  font-size: 13px;
  line-height: 1.6;
  color: #B5B5B5;
  max-width: 480px;
}
.btn-feedback {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  height: 44px;
  padding: 0 22px;
  background: transparent;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  border-radius: 999px;
  border: 1.5px solid #fff;
  letter-spacing: .8px;
  transition: background .15s ease, color .15s ease;
}
.btn-feedback .arr { font-size: 15px; }
.btn-feedback:hover { background: #fff; color: #000; }

.contact-stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.contact-block {
  display: flex;
  align-items: center;
  gap: 14px;
}
.contact-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: transparent;
  border: 1.5px solid #fff;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.contact-icon svg { width: 18px; height: 18px; }
.contact-label {
  font-size: 13px;
  font-weight: 600;
  color: #B5B5B5;
  margin-bottom: 2px;
}
.contact-value {
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  letter-spacing: .3px;
}
.contact-value a:hover { color: var(--cm-orange); }

.social-block .social-row {
  display: flex;
  gap: 10px;
}
.social-block .social-row a {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: transparent;
  border: 1.5px solid #fff;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .15s ease, color .15s ease, transform .15s ease;
}
.social-block .social-row a:hover {
  background: #fff;
  color: #000;
  transform: translateY(-2px);
}
.social-block .social-row svg { width: 22px; height: 22px; }

/* Link columns — 5 cols (4 link cols + address col) */
.footer-cols {
  display: grid;
  grid-template-columns: 1fr 1.05fr 1fr 1fr;
  gap: 28px;
  padding: 36px 0 28px;
}
.footer-col h4 {
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  margin: 0 0 14px;
  text-transform: uppercase;
  letter-spacing: .6px;
}
.footer-col h4:not(:first-child) {
  margin-top: 24px;
}
.footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.footer-col a {
  color: #C9C9C9;
  font-size: 13px;
  transition: color .15s ease;
}
.footer-col a:hover { color: var(--cm-orange); }

/* Address — sits as the 5th column on coolmate; we render it as its own block on the right via grid */
.footer-address {
  padding-bottom: 28px;
  border-bottom: 1px solid rgba(255,255,255,.12);
}
.footer-address h4 {
  font-size: 13px;
  font-weight: 800;
  margin: 0 0 14px;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: #fff;
  font-style: italic;
}
.footer-address ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 32px;
  row-gap: 12px;
}
.footer-address li {
  font-size: 12.5px;
  color: #C9C9C9;
  line-height: 1.6;
}
.footer-address strong {
  color: #fff;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Bottom: company + certifications */
.footer-bottom {
  padding: 22px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px;
}
.company-info p {
  margin: 0 0 4px;
  font-size: 12.5px;
  color: #B5B5B5;
  line-height: 1.55;
}
.company-info p:first-child { color: #fff; font-weight: 700; }

.certifications {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.certifications .cert { display: inline-block; }
.cert-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  height: 50px;
  min-width: 110px;
  padding: 0 10px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: .3px;
  font-style: normal;
  position: relative;
  overflow: hidden;
}

/* NCSC TÍN NHIỆM MẠNG */
.cert-ncsc {
  background: #fff;
  color: #2B7A4B;
  padding: 4px 10px 4px 36px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 1px;
}
.cert-ncsc::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 28px;
  background: radial-gradient(circle at 50% 30%, #2B7A4B 35%, transparent 36%) no-repeat,
              linear-gradient(180deg, #2B7A4B 0 60%, transparent 60%) no-repeat;
  background-size: 100% 100%, 100% 100%;
  clip-path: polygon(50% 0, 100% 25%, 100% 65%, 50% 100%, 0 65%, 0 25%);
  background: #2B7A4B;
}
.cert-ncsc b { font-size: 9px; color: #2B7A4B; font-weight: 800; letter-spacing: .4px; }
.cert-ncsc i { font-style: normal; font-size: 7px; color: #2B7A4B; font-weight: 700; }
.cert-ncsc em { font-style: normal; font-size: 7px; color: #2B7A4B; font-weight: 600; line-height: 1.1; margin-top: 1px; }

/* DMCA */
.cert-dmca {
  background: linear-gradient(180deg, #2A6FBF 0 35%, #fff 35% 100%);
  color: #1A4A8A;
  flex-direction: column;
  gap: 0;
  padding: 2px 8px;
}
.cert-dmca b { color: #fff; font-size: 7px; font-weight: 700; letter-spacing: .5px; padding: 1px 0; }
.cert-dmca strong { color: #1A4A8A; font-size: 13px; font-weight: 900; letter-spacing: 1px; line-height: 1; margin-top: 4px; }
.cert-dmca i { font-style: normal; color: #1A4A8A; font-size: 8px; font-weight: 700; }

/* ISO Q (kiểm định) */
.cert-iso {
  background: #fff;
  color: #1A4A8A;
  min-width: 70px;
  flex-direction: column;
  gap: 2px;
  padding: 4px 8px;
}
.cert-iso .q {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #1A4A8A;
  color: #fff;
  font-size: 14px;
  font-weight: 900;
  font-style: italic;
}
.cert-iso i { font-style: normal; color: #1A4A8A; font-size: 7px; font-weight: 800; letter-spacing: .3px; }

/* Đã thông báo Bộ Công Thương */
.cert-bct {
  background: #1A6BC1;
  color: #fff;
  flex-direction: column;
  gap: 0;
  padding: 4px 14px 4px 32px;
  align-items: flex-start;
  justify-content: center;
  min-width: 130px;
}
.cert-bct .check {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  color: #1A6BC1;
  font-size: 11px;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.cert-bct b { color: #fff; font-size: 11px; font-weight: 800; letter-spacing: .3px; line-height: 1; }
.cert-bct i { font-style: normal; color: #fff; font-size: 8px; font-weight: 700; margin-top: 2px; letter-spacing: .3px; }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 1024px) {
  .footer-contacts {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }
  .listening-block { grid-column: 1 / -1; }
  .footer-cols { grid-template-columns: repeat(2, 1fr); }
  .footer-address ul { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  :root {
    --cm-header-h:        64px;
    --cm-header-h-shrink: 56px;
  }
  .container { padding: 0 16px; }
  .brand-logo { height: 40px; }
  .site-header.is-scrolled .brand-logo { height: 36px; }
  .main-nav a { padding: 8px 12px; font-size: 13px; }

  .search-section { padding: 36px 0 28px; }
  .search-card { padding: 18px; }
  .search-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .search-actions .btn-ghost { display: none; }

  /* Mobile: 1 column x 60 rows */
  .photo-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .photo-card { aspect-ratio: 3 / 2; border-radius: 10px; }
  .photo-card::after { font-size: 14px; letter-spacing: 4px; }

  .footer-contacts {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .footer-cols {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }

  .lightbox { padding: 16px; }
  .lightbox-close { top: 12px; right: 12px; }
  .lightbox-prev  { left: 12px; }
  .lightbox-next  { right: 12px; }
}

@media (max-width: 480px) {
  .search-title { font-size: 26px; }
}
