:root {
  --bg: #0f0f10;
  --card: #16171a;
  --muted: #8a8f98;
  --text: #ffffff;
  --accent: #22c55e;
  --accent2: #38bdf8;
}

/* =========================
   BASE
========================= */

body {
  padding-bottom: 100px;
}

header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 16px;
  border-bottom: 1px solid #222222;
}

header img {
  width: 28px;
  height: 28px;
}

header h1 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.version {
  margin-left: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #25d366;
  color: #062d1e;
  font-size: 12px;
  font-weight: 700;
}

main {
  display: grid;
  gap: 14px;
  max-width: 860px;
  margin: 0 auto;
  padding: 18px;
}

.card {
  padding: 14px;
}

.row {
  display: grid;
  gap: 10px;
}

.grid {
  display: grid;
  gap: 12px;
}

@media (min-width: 720px) {
  .grid {
    grid-template-columns: 1.2fr 1fr;
  }
}

/* =========================
   FORMULARIOS
========================= */

.btn {
  cursor: pointer;
  border: 1px solid #3a3d44;
}

.btn-primary {
  color: #041d0f;
  background: var(--accent);
  border-color: #169c48;
  font-weight: 700;
}

.btn-ghost {
  background: #1a1c20;
}

/* =========================
   PREVISUALIZACIÓN
========================= */

.preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}

.thumb {
  position: relative;
  overflow: hidden;
  background: #0b0c0e;
  border: 1px solid #2a2d33;
  border-radius: 10px;
}

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

.thumb .priceTag {
  position: absolute;
  bottom: 8px;
  left: 8px;
  padding: 4px 8px;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 999px;
  font-size: 12px;
}

.pill {
  padding: 6px 10px;
  background: #121316;
  border: 1px solid #2a2d33;
  border-radius: 999px;
  font-size: 12px;
}

/* =========================
   TARJETAS DE PRODUCTOS
========================= */

.grid.list {
  grid-template-columns: 1fr;
}

/* =========================
   BOTONES DE PRODUCTO
========================= */

.share .btn,
.share .facebook-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: 10px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.15;
  text-align: center;
  white-space: normal;
}

.whats {
  color: #062d1e;
  background: #25d366;
  border-color: #128c7e;
  font-weight: 700;
}

.share .facebook-btn {
  color: #ffffff;
  background: #1877f2;
  border-color: #1877f2;
}

.share .edit {
  color: #ffffff;
  background: #292524;
  border-color: #57534e;
}

.share .gal {
  color: #e2e8f0;
  background: #1e293b;
  border-color: #334155;
}

.share .del {
  color: #fecaca;
  background: #3a1619;
  border-color: #991b1b;
}

.copy {
  border-color: #3a3d44;
}

/* =========================
   MODAL
========================= */

.hidden {
  display: none !important;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.75);
}

.modal-content {
  width: min(700px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  padding: 16px;
  background: var(--card);
  border: 1px solid #2a2d33;
  border-radius: 16px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal-header h2 {
  margin: 0;
  font-size: 20px;
}

.modal-close {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  font-size: 24px;
  line-height: 1;
}

.modal-photos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.modal-photo {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px;
  background: #121316;
  border: 1px solid #2a2d33;
  border-radius: 12px;
}

.modal-photo img,
.modal-product-image {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 8px;
}

.new-photos-preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.new-photos-preview img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 10px;
}

.modal-photo button,
.delete-photo-btn {
  width: 100%;
  padding: 9px;
  color: #fecaca;
  background: #3a1619;
  border: 1px solid #7f1d1d;
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
}

.delete-photo-btn:hover {
  background: #551b1f;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
}

.modal-footer .btn {
  width: auto;
}

/* =========================
   PIE DE PÁGINA
========================= */

footer {
  padding: 18px;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
}

/* =========================
   RESPONSIVE
========================= */

@media (max-width: 520px) {
  .modal-photos {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .modal-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .modal-footer .btn {
    width: 100%;
  }
}

/* =========================
   INVENTARIO HEADER
========================= */

.inventory-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}

.inventory-header h2 {
  margin: 0;
}

.inventory-header p {
  margin: 4px 0 0;
}

.inventory-header .btn {
  width: auto;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .inventory-header {
    flex-direction: column;
    align-items: stretch;
  }

  .inventory-header .btn {
    width: 100%;
  }
}

/* =========================
   VISTA PRINCIPAL INVENTARIO
========================= */

.inventory-page {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0;
}

.inventory-page > .card {
  width: 100%;
}

#list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 900px) {
  #list {
    grid-template-columns:
      repeat(auto-fit, minmax(300px, 1fr));
  }
}

/* =========================
   BOTÓN FLOTANTE AGREGAR
========================= */

.floating-add-btn {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 1200;

  display: flex;
  align-items: center;
  justify-content: center;

  width: 64px;
  height: 64px;

  color: #111;
  background: #ffd400;
  border: 4px solid #18191d;
  border-radius: 50%;

  font-size: 38px;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;

  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.45),
    0 0 0 6px rgba(255, 212, 0, 0.16);
}

.floating-add-btn:hover {
  transform: translateY(-2px);
}

.floating-add-btn:active {
  transform: scale(0.95);
}

@media (max-width: 640px) {
  .floating-add-btn {
    right: 18px;
    bottom: 18px;
    width: 60px;
    height: 60px;
    font-size: 34px;
  }
}

/* =========================
   BUSCADOR
========================= */

.inventory-search{
  margin:18px 0;
}

.inventory-search input{
  width:100%;
  padding:14px 16px;
  border-radius:12px;
  background:#1a1c20;
  border:1px solid #2b2d31;
  font-size:15px;
}

.inventory-search input:focus{
  outline:none;
  border-color:#25d366;
  box-shadow:0 0 0 3px rgba(37,211,102,.15);
}

/* =========================
   RESUMEN DEL INVENTARIO
========================= */

.inventory-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0;
}

.summary-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 125px;
  padding: 16px 12px;
  text-align: center;
  background: #121316;
  border: 1px solid #2a2d33;
  border-radius: 12px;
}

.summary-icon {
  margin-bottom: 8px;
  font-size: 28px;
  line-height: 1;
}

.summary-card__label {
  color: var(--muted);
  font-size: 13px;
}

.summary-card__value {
  margin-top: 6px;
  width: 100%;
  color: var(--text);
  font-size: clamp(18px, 4vw, 26px);
  font-weight: 800;
  line-height: 1.1;
  text-align: center;
  overflow-wrap: anywhere;
}

/* Colores de los iconos */

.summary-card:nth-child(1) .summary-icon {
  color: #3b82f6;
}

.summary-card:nth-child(2) .summary-icon {
  color: #facc15;
}

.summary-card:nth-child(3) .summary-icon {
  color: #22c55e;
}

/* Móvil */

@media (max-width: 640px) {
  .inventory-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
  }

  .summary-card {
    min-height: 105px;
    padding: 10px 5px;
  }

  .summary-icon {
    margin-bottom: 6px;
    font-size: 23px;
  }

  .summary-card__label {
    font-size: 10px;
  }

  .summary-card__value {
    margin-top: 4px;
    font-size: clamp(16px, 4.5vw, 20px);
  }
}

.summary-card--value {
  position: relative;
}

.summary-visibility-btn {
  position: absolute;
  top: 8px;
  right: 8px;

  width: 34px;
  height: 34px;
  padding: 0;

  display: flex;
  align-items: center;
  justify-content: center;

  color: var(--muted);
  background: transparent;
  border: none;
  border-radius: 50%;
  cursor: pointer;
}

.summary-visibility-btn:hover {
  color: var(--text);
  background: #1f2125;
}

.summary-visibility-btn i {
  font-size: 18px;
}

/* =========================
   TARJETA V4
========================= */

.list .item {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 14px;

  min-width: 0;
  overflow: hidden;
  padding: 12px;

  background: var(--card);
  border: 1px solid #24262b;
  border-radius: 16px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.22);
}

.product-card__image {
  width: 150px;
  height: 150px;
  object-fit: cover;
  object-position: center;
  border-radius: 12px;
}

.product-card__content {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.product-card__title {
  display: block;
  font-size: 18px;
  font-weight: 750;
}

.product-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.product-card__description {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.product-card__price {
  display: block;
  margin-top: 8px;
  color: var(--accent);
  font-size: 18px;
  font-weight: 800;
}

.product-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 10px;
}

.icon-btn {
  width: 34px;
  height: 34px;
  padding: 0;

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

  color: #e5e7eb;
  background: #1a1c20;
  border: 1px solid #3a3d44;
  border-radius: 10px;
  cursor: pointer;
}

.icon-btn i {
  font-size: 18px;
}

.icon-btn.whats {
  color: #ffffff;
  background: #128c7e;
  border-color: #25d366;
}

.icon-btn.facebook-btn {
  color: #ffffff;
  background: #1877f2;
  border-color: #1877f2;
}

.icon-btn.gal {
  color: #e2e8f0;
  background: #1e293b;
  border-color: #334155;
}

.icon-btn.edit {
  color: #ffffff;
  background: #292524;
  border-color: #57534e;
}

.icon-btn.del {
  color: #f87171;
  background: transparent;
  border-color: #991b1b;
}

@media (max-width: 640px) {
  .list .item {
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 10px;
    padding: 10px;
  }
  
  .product-card__image {
    width: 96px;
    height: 96px;
  }
  
  .product-card__actions {
    gap: 4px;
  }
  
  .icon-btn {
    width: 30px;
    height: 30px;
  }
  
  .icon-btn i {
    font-size: 14px;
  }
}

/* =========================
   MENÚ LATERAL
========================= */

.header-menu-btn{
  width:42px;
  height:42px;

  display:flex;
  align-items:center;
  justify-content:center;

  padding:0;

  color:#fff;
  background:transparent;

  border:none;
  border-radius:10px;

  cursor:pointer;

  transition:.2s;
}

.header-menu-btn:hover{
  background:#1f2125;
}

.header-menu-btn i{
  font-size:30px;
}

/* Fondo oscuro */

.side-menu-overlay{

  position:fixed;
  inset:0;

  background:rgba(0,0,0,.55);

  opacity:0;

  visibility:hidden;

  transition:.25s;

  z-index:1999;

}

/* Panel */

.side-menu{

  position:fixed;

  top:0;
  left:0;

  width:290px;
  max-width:85vw;

  height:100vh;

  background:#151619;

  border-right:1px solid #2a2d33;

  transform:translateX(-100%);

  transition:transform .28s ease;

  z-index:2000;

  display:flex;
  flex-direction:column;

}

/* Cabecera */

.side-menu__header{

  display:flex;

  justify-content:space-between;
  align-items:center;

  padding:22px 18px;

  border-bottom:1px solid #24262b;

}

.side-menu__brand{

  display:block;

  font-size:18px;
  font-weight:700;

}

.side-menu__subtitle{

  display:block;

  margin-top:4px;

  color:var(--muted);

  font-size:13px;

}

.side-menu__close{

  width:38px;
  height:38px;

  padding:0;

  border:none;

  background:transparent;

  color:#fff;

  cursor:pointer;

}

.side-menu__close i{

  font-size:20px;

}

/* Navegación */

.side-menu__nav{

  padding:16px 10px;

  overflow-y:auto;

  flex:1;

}

.side-menu__section-title{

  margin:18px 12px 8px;

  color:#6b7280;

  font-size:11px;

  text-transform:uppercase;

  letter-spacing:.08em;

}

.side-menu__link{

  display:flex;

  align-items:center;

  gap:14px;

  padding:12px 14px;

  margin-bottom:4px;

  color:#e5e7eb;

  text-decoration:none;

  border-radius:12px;

  transition:.2s;

}

.side-menu__link:hover{

  background:#202226;

}

.side-menu__link.active{

  background:#1f3f2d;

  color:#25d366;

}

.side-menu__link i{

  width:22px;

  text-align:center;

  font-size:18px;

}

.side-menu.open{

  transform:translateX(0);

}

.side-menu-overlay.show{

  opacity:1;

  visibility:visible;

}

/* =========================
   NAVEGACIÓN INFERIOR
========================= */

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 14px;
  z-index: 1400;

  width: min(440px, calc(100% - 24px));
  min-height: 68px;

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

  padding: 7px;

  background: rgba(18, 19, 22, 0.96);
  border: 1px solid #2a2d33;
  border-radius: 18px;

  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(12px);

  transform: translateX(-50%);
}

.bottom-nav__item {
  min-width: 0;
  min-height: 52px;
  padding: 6px 4px;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;

  color: var(--muted);
  background: transparent;
  border: none;
  border-radius: 12px;

  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
}

.bottom-nav__item i {
  font-size: 20px;
  line-height: 1;
}

.bottom-nav__item span {
  font-size: 11px;
  font-weight: 650;
}

.bottom-nav__item.active {
  color: var(--accent);
  background: rgba(34, 197, 94, 0.12);
}

body {
  padding-bottom: 105px;
}

@media (min-width: 800px) {
  .bottom-nav {
    display: none;
  }

  body {
    padding-bottom: 0;
  }
}

/* =========================
   PÁGINA AGREGAR PRODUCTO
========================= */

.add-product-main{
  width:min(900px, calc(100% - 32px));
  margin:0 auto;
  padding:24px 0;
}

.add-product-card{
  width:100%;
}

.new-photo-card {
  overflow: hidden;
  background: #121316;
  border: 1px solid #2a2d33;
  border-radius: 12px;
}

.new-photo-card > img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 0;
}

.new-photo-fields {
  display: grid;
  grid-template-columns: 1fr 0.8fr;
  gap: 8px;
  padding: 8px;
}

.new-photo-fields label {
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
}

.new-photo-fields input {
  width: 100%;
  min-width: 0;
  margin-top: 5px;
  padding: 8px;
  color: var(--text);
  background: #0f1115;
  border: 1px solid #34373e;
  border-radius: 7px;
}

/* Quitar flechas de inputs numéricos */
.new-photo-fields input[type="number"]::-webkit-inner-spin-button,
.new-photo-fields input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.new-photo-fields input[type="number"] {
  appearance: textfield;
  -moz-appearance: textfield;
}