/* ==================================================
   SHOP - SEARCH, LOKASI, KARTU PRODUK, KARTU TOKO
================================================== */

.page {
  padding-block: 1.5rem 2rem;
}

/* ==================================================
   SEARCH PANEL
================================================== */

.shop-head {
  margin-bottom: 2rem;

  padding: 1.75rem;

  background: var(--navy);

  border-radius: var(--r-lg);
}

.shop-head__title {
  margin-bottom: 1.15rem;

  color: #fff;

  font-size: 1.5rem;
  font-weight: 800;

  letter-spacing: -0.02em;
}

/* ==================================================
   SEARCH FORM
================================================== */

.search {
  position: relative;

  margin-bottom: 1rem;
}

.search__icon {
  position: absolute;

  top: 50%;
  left: 1.1rem;

  color: var(--faint);

  font-size: 0.9rem;

  transform: translateY(-50%);

  pointer-events: none;
}

.search__input {
  width: 100%;

  min-height: 3.25rem;

  padding: 0.85rem 1.1rem 0.85rem 2.85rem;

  appearance: none;
  -webkit-appearance: none;

  background: var(--surface);

  border: 0;
  border-radius: var(--r-md);

  font-size: 0.95rem;
}

.search__input::placeholder {
  color: var(--faint);
}

/* ==================================================
   ALAMAT
================================================== */

/* ==================================================
   GRID
================================================== */

.product-grid {
  display: grid;

  grid-template-columns: repeat(4, 1fr);

  gap: 1.15rem;
}

.store-grid {
  display: grid;

  grid-template-columns: repeat(3, 1fr);

  gap: 1.15rem;
}

/* ==================================================
   KARTU PRODUK
================================================== */

.product-card {
  display: flex;
  flex-direction: column;

  overflow: hidden;

  background: var(--surface);

  border: 1px solid var(--line);
  border-radius: var(--r-md);

  box-shadow: var(--shadow);

  transition:
    border-color var(--t),
    box-shadow var(--t);
}

.product-card:hover {
  border-color: var(--line-strong);

  box-shadow: var(--shadow-lg);
}

.product-card.is-unavailable {
  opacity: 0.65;
}

/* Media */

.product-card__media {
  position: relative;

  margin: 0;

  aspect-ratio: 4 / 3;

  background: var(--surface-mute);

  overflow: hidden;
}

.product-card__image {
  width: 100%;
  height: 100%;

  object-fit: cover;
}

.product-card__icon {
  display: none;

  color: var(--amber-line);

  font-size: 1.5rem;
}

.product-card__media.is-fallback {
  display: flex;
  align-items: center;
  justify-content: center;

  background: var(--amber-soft);
}

.product-card__media.is-fallback .product-card__image {
  display: none;
}

.product-card__media.is-fallback .product-card__icon {
  display: block;
}

/* Flag habis / tutup */

.product-card__flag {
  position: absolute;

  top: 0.6rem;
  left: 0.6rem;

  padding: 0.2rem 0.6rem;

  background: var(--ink);

  border-radius: var(--r-pill);

  color: #fff;

  font-size: 0.62rem;
  font-weight: 700;
}

/* Body */

.product-card__body {
  display: flex;
  flex-direction: column;

  flex: 1;

  padding: 0.9rem;
}

.product-card__name {
  margin-bottom: 0.25rem;

  font-size: 0.9rem;
  font-weight: 700;

  line-height: 1.35;
}

.product-card__store {
  display: flex;
  align-items: center;

  gap: 0.35rem;

  margin-bottom: 0.45rem;

  color: var(--amber-dark);

  font-size: 0.7rem;
  font-weight: 600;
}

.product-card__store i {
  font-size: 0.65rem;
}

.product-card__description {
  margin-bottom: 0.85rem;

  color: var(--muted);

  font-size: 0.75rem;

  line-height: 1.5;
}

.product-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 0.75rem;

  margin-top: auto;
}

.product-card__price {
  color: var(--ink);

  font-size: 1rem;
  font-weight: 800;
}

.product-card__add {
  display: flex;
  align-items: center;
  justify-content: center;

  flex-shrink: 0;

  width: 2.25rem;
  height: 2.25rem;

  background: var(--navy);

  border-radius: var(--r-sm);

  color: #fff;

  font-size: 0.8rem;

  transition:
    background-color var(--t),
    transform var(--t);
}

.product-card__add:hover {
  background: var(--amber);

  transform: scale(1.06);
}

.product-card__add[disabled] {
  background: var(--line-strong);

  cursor: not-allowed;

  transform: none;
}

/* ==================================================
   KARTU TOKO
================================================== */

.store-card {
  position: relative;

  display: flex;
  flex-direction: column;

  overflow: hidden;

  background: var(--surface);

  border: 1px solid var(--line);
  border-radius: var(--r-md);

  box-shadow: var(--shadow);

  transition:
    transform var(--t),
    border-color var(--t),
    box-shadow var(--t);
}

.store-card:hover {
  transform: translateY(-3px);

  border-color: var(--line-strong);

  box-shadow: var(--shadow-lg);
}

.store-card.is-closed {
  opacity: 0.7;
}

.store-card:has(.store-card__link:focus-visible) {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}

/* Media */

.store-card__media {
  position: relative;

  margin: 0;

  aspect-ratio: 16 / 9;

  background: var(--surface-mute);

  overflow: hidden;
}

.store-card__image {
  width: 100%;
  height: 100%;

  object-fit: cover;

  transition: transform 0.35s ease;
}

.store-card:hover .store-card__image {
  transform: scale(1.05);
}

.store-card__icon {
  display: none;

  color: rgba(245, 158, 11, 0.7);

  font-size: 1.75rem;
}

.store-card__media.is-fallback {
  display: flex;
  align-items: center;
  justify-content: center;

  background-image: linear-gradient(135deg, #14213d, #1f3a68);
}

.store-card__media.is-fallback .store-card__image {
  display: none;
}

.store-card__media.is-fallback .store-card__icon {
  display: block;
}

.store-card__status {
  position: absolute;

  top: 0.7rem;
  left: 0.7rem;

  display: inline-flex;
  align-items: center;

  gap: 0.35rem;

  padding: 0.22rem 0.65rem;

  background: var(--surface);

  border-radius: var(--r-pill);

  color: var(--ok);

  font-size: 0.65rem;
  font-weight: 700;

  box-shadow: var(--shadow);
}

.store-card.is-closed .store-card__status {
  color: var(--faint);
}

.store-card__status::before {
  content: "";

  width: 0.4rem;
  height: 0.4rem;

  border-radius: 50%;

  background: currentColor;
}

/* Body */

.store-card__body {
  padding: 1rem;
}

.store-card__category {
  margin-bottom: 0.2rem;

  color: var(--amber);

  font-size: 0.65rem;
  font-weight: 700;

  letter-spacing: 0.08em;

  text-transform: uppercase;
}

.store-card__name {
  margin-bottom: 0.7rem;

  font-size: 1rem;
  font-weight: 700;
}

.store-card__link::after {
  content: "";

  position: absolute;
  inset: 0;
}

.store-card__link:focus-visible {
  outline: none;
}

.store-card__meta {
  display: flex;
  flex-wrap: wrap;

  gap: 0.4rem 1rem;
}

.store-card__meta li {
  display: inline-flex;
  align-items: center;

  gap: 0.35rem;

  color: var(--muted);

  font-size: 0.75rem;
  font-weight: 500;
}

.store-card__meta i {
  color: var(--amber);

  font-size: 0.7rem;
}

.store-card__meta span {
  color: var(--faint);
  font-weight: 400;
}

/* ==================================================
   TABLET
   1024px
================================================== */

@media (max-width: 1024px) {
  .product-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .store-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ==================================================
   MOBILE
   768px
================================================== */

@media (max-width: 768px) {
  .shop-head {
    margin-bottom: 1.5rem;

    padding: 1.25rem;
  }

  .shop-head__title {
    font-size: 1.2rem;
  }

  .search__input {
    min-height: 3rem;

    font-size: 0.9rem;
  }

  .product-grid {
    grid-template-columns: repeat(2, 1fr);

    gap: 0.85rem;
  }

  .store-grid {
    grid-template-columns: 1fr;

    gap: 0.85rem;
  }

  .product-card__body {
    padding: 0.8rem;
  }

  .product-card__name {
    font-size: 0.85rem;
  }

  .product-card__price {
    font-size: 0.92rem;
  }
}

/* ==================================================
   SMALL MOBILE
   480px
================================================== */

@media (max-width: 480px) {
  .address__change {
    padding: 0.4rem 0.7rem;

    font-size: 0.7rem;
  }

  .product-card__description {
    display: none;
  }

  .store-card__meta {
    gap: 0.3rem 0.75rem;
  }
}
