/*
Theme Name: CarrierGo
Theme URI: https://tasdelivery.id
Author: Growflo
Description: Custom homepage theme for CarrierGo (Indah Tas Obrok) — Your Delivery Bag Solutions.
Version: 1.4.0
Text Domain: carriergo
*/

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; }
ul { list-style: none; }

/* ---------- Design tokens ---------- */
:root {
  --color-primary: #1650c9;
  --color-primary-dark: #0f3a94;
  --color-bg-light: #eef2ff;
  --color-text: #1a1a2e;
  --color-text-muted: #5a5f73;
  --color-whatsapp: #25d366;
  --color-white: #ffffff;
  --font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --container-max: 1200px;
  --radius: 10px;
}

body {
  font-family: var(--font-stack);
  color: var(--color-text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: 20px;
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Header / Nav ---------- */
.site-header {
  background: var(--color-white);
  border-bottom: 1px solid #e5e7f0;
  position: sticky;
  top: 0;
  z-index: 50;
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
}
.site-logo {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--color-primary);
}
.nav-toggle {
  display: block;
  font-size: 1.5rem;
  color: var(--color-primary);
}
.nav-menu {
  display: none;
  position: absolute;
  top: 64px;
  left: 0;
  right: 0;
  background: var(--color-white);
  border-bottom: 1px solid #e5e7f0;
  flex-direction: column;
  padding: 12px 20px 20px;
}
.nav-menu.is-open { display: flex; }
.nav-menu a {
  padding: 10px 0;
  font-weight: 600;
  color: var(--color-text);
}
.btn {
  display: inline-block;
  padding: 12px 22px;
  border-radius: var(--radius);
  font-weight: 700;
  text-align: center;
}
.btn--whatsapp {
  background: var(--color-whatsapp);
  /* white text on this green is ~2:1 contrast, fails WCAG AA (needs 4.5:1) —
     dark text on the same green is ~10.5:1, keeps the brand color intact */
  color: #0d2818 !important;
}

@media (min-width: 900px) {
  .nav-toggle { display: none; }
  .nav-menu {
    position: static;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 28px;
    padding: 0;
    border: none;
  }
  .nav-menu a { padding: 0; }
}

/* ---------- Hero ---------- */
.hero {
  background: var(--color-bg-light);
  padding-block: 0 48px;
}
.hero__banner {
  width: 100%;
}
.hero__inner {
  text-align: center;
  padding-top: 32px;
}
.hero__title {
  font-size: clamp(1.75rem, 4vw + 1rem, 3rem);
  font-weight: 800;
  line-height: 1.15;
  color: var(--color-text);
  max-width: 18ch;
  margin-inline: auto;
  margin-bottom: 16px;
}
.hero__subtitle {
  color: var(--color-text-muted);
  max-width: 55ch;
  margin-inline: auto;
  margin-bottom: 24px;
}
.btn--large { font-size: 1.05rem; padding: 14px 30px; }

/* ---------- Products ---------- */
.products { padding-block: 48px; }
.section-title {
  font-size: 1.6rem;
  font-weight: 800;
  text-align: center;
  margin-bottom: 28px;
}
.products__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.product-card {
  background: var(--color-bg-light);
  border-radius: var(--radius);
  padding: 14px;
  text-align: center;
  min-width: 0; /* prevent CSS Grid item blowout: without this, the
                   width="500" product images force the 1fr track (and
                   the whole page) wider than the viewport at 390px —
                   this was the original P0 mobile cut-off bug. */
}
.product-card__img {
  border-radius: calc(var(--radius) - 4px);
  margin-bottom: 10px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}
.product-card__name {
  font-weight: 700;
  font-size: 0.9rem;
  min-height: 2.4em;
}

@media (min-width: 640px) {
  .products__grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 960px) {
  .products__grid { grid-template-columns: repeat(4, 1fr); }
}

/* ---------- Trust bar ---------- */
.trust-bar {
  padding-block: 40px;
  background: var(--color-primary-dark);
  text-align: center;
}
.trust-bar .section-title { color: var(--color-white); }
.trust-bar__panel {
  display: inline-block;
  background: var(--color-white);
  border-radius: var(--radius);
  padding: 24px;
}
.trust-bar__logos {
  width: 100%; /* .trust-bar__logos's max-width:700px has higher
                  specificity than the base `img{max-width:100%}` reset
                  and was overriding it, letting the 1024px-wide source
                  image overflow narrow viewports. width:100% restores
                  the responsive cap; max-width:700px still applies on
                  wide screens. */
  margin-inline: auto;
  max-width: 700px;
}

/* ---------- Final CTA ---------- */
.final-cta {
  background: var(--color-bg-light);
  padding-block: 48px;
  text-align: center;
}
.final-cta__text {
  color: var(--color-text-muted);
  max-width: 50ch;
  margin-inline: auto;
  margin-bottom: 22px;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--color-primary-dark);
  color: var(--color-white);
  padding-block: 32px;
}
.footer__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}
.footer__links {
  display: flex;
  gap: 20px;
}
.footer__links a { color: #c9d4f7; font-size: 0.85rem; }
.footer__copyright { font-size: 0.8rem; color: #a9b6e0; }
