/* Dunk Dynasty — Responsive UI v2 (ver dunkdynasty/Dunk_Dynasty_Responsive_UI_Guide_v2.md) */

:root {
  --bg: #06080B;
  --surface: #0B0E12;
  --surface-2: #10141A;
  --red: #E21D2F;
  --red-dark: #A80F1C;
  --white: #FFFFFF;
  --text-secondary: #9CA3AD;
  --border: rgba(255,255,255,.10);
  --border-red: rgba(226,29,47,.45);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 12px;
}

* { box-sizing: border-box; }

body.dd-body {
  margin: 0;
  background: var(--bg);
  color: var(--white);
  font-family: Montserrat, Roboto, Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.dd-page {
  width: min(calc(100% - 128px), 1440px);
  margin-inline: auto;
}

@media (max-width: 767px) {
  .dd-page { width: calc(100% - 40px); }
}

.dd-section + .dd-section { margin-top: 24px; }

@media (max-width: 767px) {
  .dd-section + .dd-section { margin-top: 16px; }
}

/* Header */
.dd-header {
  min-height: 108px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  padding-inline: max(64px, calc((100vw - 1440px) / 2));
  background: #050609;
  border-bottom: 1px solid var(--border);
}

.dd-header__logo img { height: 48px; display: block; }

.dd-login-form {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.dd-field { position: relative; display: flex; align-items: center; }

.dd-field__icon {
  position: absolute;
  left: 14px;
  color: var(--text-secondary);
  pointer-events: none;
}

.dd-login-input {
  height: 46px;
  padding: 0 16px 0 40px;
  background: #0D1117;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 14px;
}

.dd-login-input::placeholder { color: var(--text-secondary); }

.dd-field__toggle {
  position: absolute;
  right: 10px;
  background: none;
  border: 0;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  padding: 4px;
}

.dd-field__toggle.is-active { color: var(--red); }

.dd-login-button {
  height: 46px;
  padding: 0 30px;
  background: var(--red);
  border: 0;
  border-radius: var(--radius-sm);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.dd-login-button:hover { background: var(--red-dark); }

.dd-login-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.dd-login-error {
  display: none;
  color: var(--red);
  font-size: 12px;
}

.dd-login-error.is-visible { display: block; }

@media (max-width: 767px) {
  .dd-header {
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    padding: 16px;
    gap: 16px;
  }
  .dd-header__logo { order: 1; }
  .dd-login-form {
    order: 2;
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .dd-login-input, .dd-login-button, .dd-field { width: 100%; }
  .dd-login-meta { align-items: center; }
}

/* Hero */
.dd-hero {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 7;
  background: #080A0D;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  width: min(calc(100% - 128px), 1440px);
  margin: 20px auto 0;
}

@media (max-width: 767px) {
  .dd-hero { width: calc(100% - 40px); margin-top: 16px; }
}

.dd-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.dd-hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.45), rgba(0,0,0,0) 35%);
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 24px 32px;
}

.dd-hero__side {
  flex-shrink: 0;
  text-align: right;
  color: var(--white);
  text-transform: uppercase;
}

.dd-hero__side p {
  margin: 0;
  font-weight: 800;
  font-size: 15px;
  line-height: 1.3;
}

.dd-hero__side-line {
  display: inline-block;
  width: 36px;
  height: 2px;
  background: var(--red);
  margin: 8px 0;
}

.dd-hero__side small {
  display: block;
  color: var(--text-secondary);
  font-size: 11px;
  letter-spacing: .08em;
}

.dd-hero__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(0,0,0,.4);
  color: var(--white);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.dd-hero__arrow--prev { left: 16px; }
.dd-hero__arrow--next { right: 16px; }

.dd-hero__dots {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
}

.dd-hero__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,.35);
}

.dd-hero__dot.is-active { background: var(--red); }

@media (max-width: 767px) {
  .dd-hero { aspect-ratio: 1080 / 1100; }
  .dd-hero__overlay { padding: 16px; flex-direction: column; align-items: flex-start; }
  .dd-hero__side { text-align: left; }
}

/* Category grid */
.dd-category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  padding-block: 28px;
}

.dd-category-card {
  position: relative;
  overflow: hidden;
  min-height: 280px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  display: block;
  text-decoration: none;
  color: var(--white);
  transition: transform .2s ease, border-color .2s ease;
}

.dd-category-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-red);
}

.dd-category-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s ease;
}

.dd-category-card:hover img { transform: scale(1.025); }

.dd-category-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.88), rgba(0,0,0,.08) 65%);
}

.dd-category-card__label {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding: 18px 20px;
  align-self: flex-end;
  margin-top: auto;
}

.dd-category-card__body {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  height: 100%;
  padding: 18px 20px;
}

.dd-category-card__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dd-category-card__name {
  font-weight: 800;
  font-size: 18px;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.dd-category-card__arrow { color: var(--red); }

@media (max-width: 767px) {
  .dd-category-grid { grid-template-columns: 1fr; gap: 10px; padding-block: 20px; }
  .dd-category-card { min-height: 0; aspect-ratio: 4.2 / 1; }
}

/* Brand banner */
.dd-brand-banner {
  height: 100px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  background: #000;
  margin-block: 28px;
}

.dd-brand-banner img.dd-brand-banner__bg {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (max-width: 767px) {
  .dd-brand-banner { height: 80px; margin-block: 16px; }
}

/* Footer */
.dd-footer {
  margin-top: 24px;
  padding: 24px 0;
  border-top: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.dd-footer__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: 1px solid var(--border);
  border-radius: 50%;
  font-size: 11px;
  margin-right: 6px;
}

.dd-footer__meta { text-align: right; }

.dd-footer__links { display: flex; gap: 16px; flex-wrap: wrap; justify-content: flex-end; }

.dd-footer__links a {
  color: var(--text-secondary);
  text-decoration: none;
}

.dd-footer__links a:hover { color: var(--white); }

.dd-footer__copy { margin-top: 4px; color: var(--text-secondary); }

@media (max-width: 767px) {
  .dd-footer { flex-direction: column; align-items: center; text-align: center; gap: 12px; }
  .dd-footer__meta { text-align: center; }
  .dd-footer__links { justify-content: center; }
}

/* Loader */
.lds-ring { display: inline-flex; }
.lds-ring.hidden { display: none; }

/* Desktop: toda la pagina cabe en una pantalla, sin scroll vertical */
@media (min-width: 1024px) {
  html, body.dd-body { height: 100%; overflow: hidden; }

  body.dd-body { display: flex; flex-direction: column; }

  .dd-header { flex: 0 0 auto; min-height: 76px; }

  /* Altura fija (no flex-grow) para que el hero no colapse; proporcion reducida del original 1460x461 */
  .dd-hero {
    flex: 0 0 auto;
    aspect-ratio: auto;
    height: clamp(200px, 30vh, 340px);
    margin-top: 14px;
  }

  /* El resto del espacio se reparte entre cards/banner/footer para no dejar espacio muerto abajo */
  .dd-page {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }

  /* El gap cards->banner lo da el padding-block del grid (14px), igual que el margin-top del hero */
  .dd-section + .dd-section { margin-top: 0; }

  .dd-category-grid { padding-block: 14px; gap: 14px; }
  .dd-category-card { min-height: 185px; }

  .dd-brand-banner { height: 160px; margin-block: 0; }

  /* margin-top:auto empuja el footer al fondo sin inflar el gap cards->banner */
  .dd-footer { padding: 14px 0; margin-top: auto; }
}

