/* ========================================================================== */
/* FerCor Shop V8 - ajuste final de tienda, busqueda y fotografias             */
/* Este archivo se carga despues de app.css para mantener los cambios aislados. */
/* ========================================================================== */

:root {
  --store-card-radius:22px;
  --store-photo-radius:15px;
  --store-line:#e2e5d7;
  --store-shadow:0 16px 42px rgba(15,3,38,.075);
  --store-shadow-hover:0 24px 58px rgba(15,3,38,.12)
}

/* Buscador: campo amplio, foco visible y texto legible. */
.nav-search {
  background:#fff!important;
  border-color:#dce1ca!important;
  box-shadow:0 8px 24px rgba(15,3,38,.05)!important
}

.nav-search>span {
  flex:0 0 auto;
  color:#6e6776
}

.nav-search input {
  color:var(--midnight-violet);
  font-size:13px!important
}

.nav-search input::placeholder {
  color:#8b8790;
  opacity:1
}

.nav-search button {
  min-width:90px;
  transition:background .2s ease,transform .2s ease
}

.nav-search button:hover {
  background:var(--lobster-pink);
  transform:translateY(-1px)
}

/* Tarjetas: misma altura para nombre, descripcion, precio y controles. */
.product-grid {
  align-items:stretch
}

.product-card {
  display:grid;
  grid-template-rows:auto 1fr;
  min-width:0;
  height:100%;
  padding:10px;
  overflow:hidden!important;
  border:1px solid var(--store-line);
  border-radius:var(--store-card-radius);
  background:#fff;
  box-shadow:var(--store-shadow);
  transition:border-color .25s ease,box-shadow .25s ease,transform .25s ease
}

.product-card:hover {
  border-color:#cfd8bc;
  box-shadow:var(--store-shadow-hover);
  transform:translateY(-4px)
}

.product-media {
  min-width:0;
  border-radius:var(--store-photo-radius);
  background:#f0f2e8
}

.product-image,
.basic-products .product-image,
.shop-products .product-image,
.saved-products .product-image {
  display:block;
  width:100%;
  height:auto!important;
  aspect-ratio:1/1;
  overflow:hidden;
  border-radius:var(--store-photo-radius)!important;
  background:#f0f2e8
}

.product-image img {
  display:block;
  width:100%;
  height:100%;
  object-fit:cover;
  object-position:center;
  background:#f0f2e8
}

.product-copy,
.basic-products .product-copy,
.shop-products .product-copy {
  display:flex;
  flex-direction:column;
  min-width:0;
  height:100%;
  padding:15px 5px 5px!important
}

.product-copy>small {
  min-height:18px;
  overflow:hidden;
  color:#77717d;
  font-size:10px;
  line-height:18px;
  text-overflow:ellipsis;
  white-space:nowrap
}

.product-copy h3,
.shop-products .product-copy h3 {
  display:-webkit-box;
  min-height:44px!important;
  margin:5px 0 7px;
  overflow:hidden;
  font-size:17px;
  line-height:1.3;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:2
}

.product-copy>p {
  display:-webkit-box;
  min-height:40px;
  height:40px;
  margin:0;
  overflow:hidden;
  color:#77717d;
  font-size:12px;
  line-height:1.65;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:2
}

.product-price-row {
  min-height:56px;
  margin-top:auto!important;
  padding-top:10px;
  align-items:flex-end!important
}

.product-price-row>div {
  min-height:46px;
  justify-content:flex-end
}

.product-price-row del {
  min-height:18px;
  color:#77717d;
  font-size:11px;
  line-height:18px
}

.product-price-row strong {
  line-height:1.2
}

.product-price-row>small {
  padding-bottom:3px;
  white-space:nowrap
}

.card-add-form {
  align-self:end;
  width:100%;
  margin-top:10px!important
}

.quantity-picker,
.card-cart-button {
  min-height:40px
}

.card-cart-button {
  border-radius:12px!important
}

/* Detalle: fotografia cuadrada y bloque de compra con proporciones compactas. */
.product-detail {
  grid-template-columns:minmax(0,545px) minmax(0,1fr);
  align-items:center;
  gap:clamp(38px,5vw,64px);
  max-width:1180px;
  margin-inline:auto
}

.detail-image {
  width:100%;
  min-height:0!important;
  max-height:545px;
  aspect-ratio:1/1;
  border:1px solid var(--store-line);
  border-radius:24px;
  background:#f0f2e8;
  box-shadow:var(--store-shadow)
}

.detail-image img {
  display:block;
  width:100%;
  height:100%;
  object-fit:cover;
  object-position:center
}

.product-detail-copy {
  min-width:0;
  padding-block:12px
}

.product-detail h1 {
  max-width:760px;
  margin:13px 0 15px;
  overflow-wrap:anywhere;
  font-size:clamp(2.4rem,4.7vw,3.65rem);
  line-height:.98;
  letter-spacing:-.045em
}

.product-detail .lead {
  margin:0;
  font-size:17px;
  line-height:1.55
}

.product-detail-copy>p:not(.lead):not(.stock) {
  max-width:650px;
  line-height:1.65
}

.detail-price {
  min-height:48px;
  margin:20px 0 18px
}

.detail-price strong {
  font-size:32px
}

.product-purchase-panel {
  grid-template-columns:minmax(0,1fr) minmax(170px,auto)!important;
  align-items:stretch;
  padding:14px!important;
  border-radius:18px!important
}

.product-add-form {
  grid-template-columns:auto minmax(150px,1fr)!important;
  gap:12px!important
}

.product-add-form>.btn,
.favorite-detail {
  min-height:58px;
  border-radius:13px
}

.favorite-detail {
  min-width:180px;
  justify-content:center
}

/* Escritorio: marca y acciones arriba; navegacion debajo; busqueda protagonista. */
@media(min-width:1181px) {
  .nav.container {
    grid-template-columns:auto minmax(430px,1fr) auto!important;
    grid-template-rows:74px 42px;
    column-gap:28px;
    row-gap:0;
    min-height:116px;
    padding-block:0!important
  }

  .nav>.brand {
    grid-column:1!important;
    grid-row:1
  }

  .nav-search {
    grid-column:2!important;
    grid-row:1;
    justify-self:center;
    width:100%;
    max-width:720px;
    height:52px
  }

  .header-actions {
    grid-column:3!important;
    grid-row:1
  }

  .nav>nav {
    position:static!important;
    grid-column:1/-1!important;
    grid-row:2;
    justify-self:stretch;
    width:100%!important;
    gap:34px!important;
    padding:0!important;
    border:0!important;
    border-top:1px solid #eceee5!important;
    border-radius:0!important;
    background:transparent!important;
    box-shadow:none!important;
    transform:none!important
  }

  .nav>nav a {
    padding:11px 2px!important;
    font-size:11px!important;
    white-space:nowrap
  }
}

/* Tablet: busqueda completa en la segunda fila y tarjetas equilibradas. */
@media(max-width:1180px) {
  .nav-search {
    width:100%
  }

  .product-quick {
    opacity:1;
    transform:none
  }

  .product-detail {
    grid-template-columns:minmax(0,1fr);
    gap:30px;
    max-width:720px
  }

  .detail-image {
    max-height:none
  }
}

@media(max-width:680px) {
  .nav-search input {
    font-size:12px!important
  }

  .nav-search button {
    min-width:72px
  }

  .product-card {
    padding:7px;
    border-radius:17px
  }

  .product-copy,
  .basic-products .product-copy,
  .shop-products .product-copy {
    padding:11px 3px 3px!important
  }

  .product-copy h3,
  .shop-products .product-copy h3 {
    min-height:38px!important;
    font-size:14px;
    line-height:1.35
  }

  .product-copy>p {
    display:none;
    min-height:0;
    height:0
  }

  .product-price-row {
    min-height:52px;
    padding-top:7px
  }

  .product-price-row>div {
    min-height:43px
  }

  .product-purchase-panel,
  .product-add-form {
    grid-template-columns:1fr!important
  }

  .favorite-detail {
    width:100%;
    min-width:0
  }

  .product-detail h1 {
    font-size:clamp(2.15rem,12vw,3rem)
  }

  .detail-image {
    border-radius:19px
  }
}

@media(max-width:420px) {
  .nav-search button {
    width:48px;
    min-width:48px
  }

  .product-grid,
  .basic-products,
  .shop-products,
  .saved-products {
    gap:14px 9px!important
  }

  .product-card {
    padding:6px;
    border-radius:15px
  }

  .product-copy>small {
    font-size:9px
  }

  .product-price-row strong {
    font-size:14px
  }
}
