* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: #f4f0e8;
  color: #17191a;
}

header {
  background: #090b0c;
  color: #fff;
  padding: 16px 5%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 5;
}

header b {
  font-size: 21px;
}

header small {
  color: #aaa;
}

nav {
  display: flex;
  gap: 8px;
}

button {
  cursor: pointer;
}

nav button,
.add,
.wa {
  border: 0;
  border-radius: 9px;
  padding: 10px 14px;
  font-weight: bold;
}

nav button {
  background: #1b2022;
  color: #fff;
}

.order,
.add {
  background: #ff6a21 !important;
  color: #fff;
}

/* HERO */
.hero {
  padding: 75px 8%;
  min-height: 330px;
  color: #fff;

  background:
    linear-gradient(
      90deg,
      rgba(9, 11, 12, 0.94) 0%,
      rgba(9, 11, 12, 0.72) 42%,
      rgba(9, 11, 12, 0.18) 100%
    ),
    url('../images/products/hero-chelaconnect.png')
    center / cover no-repeat;
}

.hero span {
  color: #d8ff35;
  letter-spacing: 4px;
  font-size: 11px;
  font-weight: bold;
}

.hero h1 {
  font-size: 64px;
  margin: 10px 0;
}

.hero p {
  font-size: 19px;
  max-width: 520px;
  line-height: 1.45;
}

/* CONTENIDO */
main {
  max-width: 1200px;
  margin: auto;
  padding: 35px 20px;
}

.tools {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

#filters {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

#filters button {
  border: 1px solid #d5d0c8;
  background: #fff;
  border-radius: 30px;
  padding: 9px 13px;
}

#filters .active {
  background: #111;
  color: #fff;
}

#search {
  padding: 11px;
  border: 1px solid #ccc;
  border-radius: 9px;
}

/* GRID */
#grid {
  display: grid;
  grid-template-columns: repeat(
    auto-fit,
    minmax(225px, 1fr)
  );
  gap: 20px;
  margin-top: 24px;
}

.card {
  background: #fff;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 8px 24px #0001;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px #0002;
}

/* FOTOS DE PRODUCTO */
.pic {
  height: 175px;
  background: #111;
  overflow: hidden;
}

.pic img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.info {
  padding: 16px;
}

.info small {
  color: #b44e19;
  font-weight: bold;
}

.info h3 {
  margin: 7px 0;
}

.price {
  font-size: 22px;
  font-weight: bold;
  margin: 10px 0;
}

.add {
  width: 100%;
}

/* MODAL */
.modal {
  position: fixed;
  inset: 0;
  background: #000a;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
}

.hidden {
  display: none;
}

.box {
  width: min(520px, 100%);
  max-height: 90vh;
  overflow: auto;
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  position: relative;
}

.close {
  border: 0;
  background: #eee;
  border-radius: 50%;
  font-size: 24px;
  width: 36px;
  height: 36px;
  line-height: 30px;
  position: relative;
  z-index: 2;
  float: right;
}

/* FOTO GRANDE EN MODAL */
.modal-product-image {
  height: 260px;
  margin: -24px -24px 18px;
  border-radius: 16px 16px 0 0;
}

.modal-product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.box label,
#cart label {
  display: block;
  font-weight: bold;
  margin: 12px 0;
}

.box select,
.box textarea,
#cart input,
#cart textarea {
  width: 100%;
  padding: 10px;
  margin-top: 5px;
  border: 1px solid #ccc;
  border-radius: 8px;
}

.box textarea,
#cart textarea {
  min-height: 75px;
  resize: vertical;
}

/* CARRITO */
#cart {
  position: fixed;
  right: -440px;
  top: 0;
  width: min(440px, 100%);
  height: 100vh;
  background: #fff;
  z-index: 30;
  padding: 22px;
  overflow: auto;
  transition: 0.25s;
  box-shadow: -8px 0 25px #0002;
}

#cart.open {
  right: 0;
}

.row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid #eee;
  padding: 11px 0;
}

.row small {
  color: #74787a;
  line-height: 1.4;
}

.row button {
  border: 0;
  background: transparent;
  font-size: 18px;
}

.wa {
  width: 100%;
  background: #20a447;
  color: #fff;
}

/* FOOTER */
footer {
  text-align: center;
  background: #090b0c;
  color: #aaa;
  padding: 26px;
}

/* RESPONSIVE */
@media (max-width: 600px) {

  header {
    flex-wrap: wrap;
    gap: 10px;
  }

  nav {
    width: 100%;
  }

  nav button {
    flex: 1;
  }

  .hero {
    min-height: 300px;
    padding: 50px 20px;

    background:
      linear-gradient(
        90deg,
        rgba(9, 11, 12, 0.90),
        rgba(9, 11, 12, 0.45)
      ),
      url('../images/products/hero-chelaconnect.png')
      center / cover no-repeat;
  }

  .hero h1 {
    font-size: 45px;
  }

  .hero p {
    font-size: 17px;
  }

  #search {
    width: 100%;
  }

  #grid {
    grid-template-columns: 1fr;
  }

  .pic {
    height: 220px;
  }

  .modal-product-image {
    height: 220px;
  }
}
