:root {
  --teal: #5fc4ad;
  --teal-deep: #2f9f8a;
  --ink: #121417;
  --muted: #66707a;
  --line: #e6e2dc;
  --bg: #f5f3ef;
  --card: #fff;
  --danger: #b42318;
  --ok: #1f7a4d;
  --shadow: 0 10px 30px rgba(18, 20, 23, 0.08);
  --font: "Sora", "Segoe UI", sans-serif;
  --display: "Chakra Petch", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input { font: inherit; }

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background:
    linear-gradient(120deg, rgba(18,20,23,.78), rgba(18,20,23,.45)),
    url("https://www.atmmotorepuestos.com/assets/images/cover-taller.jpg") center/cover no-repeat;
}

.login-card {
  width: min(100%, 420px);
  background: rgba(255,255,255,.96);
  border: 1px solid rgba(255,255,255,.5);
  box-shadow: var(--shadow);
  padding: 1.6rem;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: .8rem;
  margin-bottom: 1.1rem;
}
.login-brand img {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 2px solid var(--teal);
}
.login-brand strong {
  display: block;
  font-family: var(--display);
  font-size: 1.5rem;
  letter-spacing: .06em;
  color: var(--teal-deep);
}
.login-brand span { color: var(--muted); font-size: .9rem; }

.login-card h1 {
  margin: 0 0 .35rem;
  font-family: var(--display);
  font-size: 1.55rem;
}
.login-card p {
  margin: 0 0 1.1rem;
  color: var(--muted);
  line-height: 1.45;
}

label {
  display: grid;
  gap: .35rem;
  margin-bottom: .85rem;
  font-size: .9rem;
  font-weight: 600;
}
input[type="tel"],
input[type="password"],
input[type="search"] {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  padding: .8rem .9rem;
}

.btn, .btn-dark, .btn-outline, .btn-teal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  border: 0;
  cursor: pointer;
  font-weight: 600;
  padding: .75rem 1rem;
}
.btn-teal { width: 100%; background: var(--teal-deep); color: #fff; }
.btn-teal:hover { background: #278574; }
.btn-dark { background: var(--ink); color: #fff; }
.btn-outline {
  background: transparent;
  border: 1px solid rgba(255,255,255,.35);
  color: #fff;
}

.top {
  background: var(--ink);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: 0 2px 12px rgba(0,0,0,.2);
}
.top-inner {
  width: min(1200px, calc(100% - 2rem));
  margin: 0 auto;
  min-height: 72px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1rem;
  align-items: center;
}
.logo {
  display: flex;
  align-items: center;
  gap: .7rem;
  color: #fff;
}
.logo img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--teal);
}
.logo strong {
  display: block;
  font-family: var(--display);
  letter-spacing: .08em;
  color: var(--teal);
  line-height: 1;
}
.logo small {
  color: rgba(255,255,255,.7);
  font-size: .75rem;
}

.search {
  display: flex;
  gap: .4rem;
  max-width: 520px;
  width: 100%;
  justify-self: center;
}
.search input {
  border: 0;
  background: rgba(255,255,255,.1);
  color: #fff;
}
.search input::placeholder { color: rgba(255,255,255,.55); }
.search button {
  background: var(--teal);
  color: var(--ink);
  border: 0;
  padding: 0 1rem;
  font-weight: 700;
  cursor: pointer;
}

.top-right {
  display: flex;
  align-items: center;
  gap: .55rem;
}
.userbox {
  text-align: right;
  line-height: 1.2;
  margin-right: .3rem;
}
.userbox strong { display: block; font-size: .92rem; }
.userbox span { color: rgba(255,255,255,.65); font-size: .78rem; }

.page {
  width: min(1200px, calc(100% - 2rem));
  margin: 1.25rem auto 2rem;
}

.flash {
  margin: 0 0 1rem;
  padding: .85rem 1rem;
  border: 1px solid var(--line);
  background: #fff;
}
.flash.ok { color: var(--ok); background: #eaf7f0; }
.flash.error { color: var(--danger); background: #fdeceb; }

.hero-strip {
  background: linear-gradient(135deg, #16191d, #243038);
  color: #fff;
  padding: 1.3rem 1.2rem;
  margin-bottom: 1.1rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: end;
  flex-wrap: wrap;
}
.hero-strip h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(1.5rem, 3vw, 2rem);
}
.hero-strip p {
  margin: .35rem 0 0;
  color: rgba(255,255,255,.75);
}
.pill {
  background: rgba(95,196,173,.18);
  color: var(--teal);
  border: 1px solid rgba(95,196,173,.35);
  padding: .45rem .75rem;
  font-size: .85rem;
  font-weight: 600;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1rem;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  overflow: hidden;
  display: grid;
  transition: transform .2s ease, box-shadow .2s ease;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}
.card .media {
  aspect-ratio: 1;
  background: #ececec;
  position: relative;
}
.card .media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.card .code {
  position: absolute;
  left: .6rem;
  top: .6rem;
  background: rgba(18,20,23,.82);
  color: #fff;
  font-size: .72rem;
  padding: .25rem .45rem;
  letter-spacing: .04em;
}
.card .body {
  padding: .85rem .9rem 1rem;
  display: grid;
  gap: .35rem;
}
.card .name {
  font-weight: 600;
  line-height: 1.3;
  min-height: 2.5em;
}
.card .price {
  font-family: var(--display);
  color: var(--teal-deep);
  font-size: 1.25rem;
}
.card .meta {
  color: var(--muted);
  font-size: .82rem;
}
.stock-ok { color: var(--ok); font-weight: 600; font-size: .82rem; }
.stock-low { color: #a15c00; font-weight: 600; font-size: .82rem; }

.empty {
  background: #fff;
  border: 1px solid var(--line);
  padding: 2rem;
  text-align: center;
  color: var(--muted);
}

.detail {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 1.25rem;
}
.detail-media {
  background: #fff;
  border: 1px solid var(--line);
  padding: .75rem;
}
.detail-main {
  aspect-ratio: 1;
  background: #eee;
  overflow: hidden;
}
.detail-main img,
.thumbs img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
  gap: .45rem;
  margin-top: .6rem;
}
.thumbs a {
  aspect-ratio: 1;
  border: 1px solid var(--line);
  overflow: hidden;
  background: #eee;
}
.detail-info {
  background: #fff;
  border: 1px solid var(--line);
  padding: 1.1rem;
}
.detail-info h1 {
  margin: 0 0 .35rem;
  font-family: var(--display);
  font-size: clamp(1.4rem, 3vw, 1.9rem);
}
.detail-info .code {
  color: var(--muted);
  margin-bottom: 1rem;
}
.detail-info .price {
  font-family: var(--display);
  font-size: 2rem;
  color: var(--teal-deep);
  margin-bottom: .3rem;
}
.specs {
  margin: 1rem 0 1.25rem;
  display: grid;
  gap: .55rem;
}
.specs div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px dashed var(--line);
  padding-bottom: .45rem;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
}
.actions .btn-teal { width: auto; padding-inline: 1.1rem; }
.back {
  display: inline-flex;
  margin-bottom: .8rem;
  color: var(--muted);
  font-weight: 600;
}

.foot {
  border-top: 1px solid var(--line);
  background: #fff;
  padding: 1rem;
}
.foot-inner {
  width: min(1200px, calc(100% - 2rem));
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: .88rem;
}

@media (max-width: 900px) {
  .top-inner { grid-template-columns: 1fr; padding: .75rem 0; }
  .search { max-width: none; }
  .top-right { justify-content: space-between; }
  .userbox { text-align: left; }
  .detail { grid-template-columns: 1fr; }
  .btn-outline { border-color: rgba(255,255,255,.5); }
}
