/* ============================================================
   DECOR.IN — Tienda (estilos propios de la sección tienda/producto)
   Reutiliza los tokens ya definidos en tailwind.config.js
   (primary-dark #363231, accent-gold #C5A059, accent-olive #707955,
   gray-light #F1F0EC, gray-dark #888685) y las fuentes del sitio
   (Playfair Display / Inter). No se toca style.css para no arriesgar
   nada de lo ya compilado.
   ============================================================ */

/* === BARRA DE TÍTULO + BUSCADOR (justo debajo del header, solo tienda/producto) === */
.shop-topbar {
    background-color: #363231;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.shop-topbar-inner {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 1rem;
    padding: 0.7rem 1.5rem;
}
.shop-topbar-spacer { display: block; }
.shop-topbar-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: #fff;
    white-space: nowrap;
    text-align: center;
    justify-self: center;
}
.shop-topbar-title i { color: #C5A059; margin-right: 0.5rem; }
.shop-search {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 300px;
    justify-self: end;
    margin-right: 1.5rem; /* un poco separado del borde, no pegado a la derecha */
}
.shop-search i {
    position: absolute;
    left: 0.9rem;
    color: #888685;
    font-size: 0.85rem;
    pointer-events: none;
}
.shop-search input {
    width: 100%;
    background-color: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 9999px;
    color: #fff;
    font-size: 0.85rem;
    padding: 0.55rem 1rem 0.55rem 2.35rem;
}
.shop-search input::placeholder { color: rgba(255,255,255,0.55); }
.shop-search input:focus {
    outline: none;
    border-color: #C5A059;
    background-color: rgba(255,255,255,0.12);
}
@media (max-width: 640px) {
    .shop-topbar-inner { grid-template-columns: 1fr; gap: 0.6rem; padding: 0.75rem 1.25rem; }
    .shop-topbar-spacer { display: none; }
    .shop-search { max-width: none; margin-right: 0; justify-self: stretch; }
}

/* === BARRA DE CATEGORÍAS (bajo la barra de título, solo en tienda/producto) === */
.shop-subnav {
    background-color: #fff;
    border-bottom: 1px solid #F1F0EC;
    position: sticky;
    top: 0;
    z-index: 40;
}
#site-header + .shop-topbar + .shop-subnav { top: 88px; } /* justo debajo del header sticky */
.shop-subnav-inner {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 1.75rem;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 0.85rem 1.5rem;
}
.shop-subnav-inner::-webkit-scrollbar { display: none; }
@media (min-width: 768px) {
    .shop-subnav-inner { justify-content: center; flex-wrap: wrap; overflow: visible; }
}
.shop-subnav-link {
    white-space: nowrap;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: #363231;
    padding-bottom: 3px;
    border-bottom: 2px solid transparent;
    flex-shrink: 0;
}
.shop-subnav-link i { color: #707955; margin-right: 6px; }
.shop-subnav-link:hover,
.shop-subnav-link.is-active {
    color: #C5A059;
    border-bottom-color: #C5A059;
}
.shop-subnav-link.is-active i { color: #C5A059; }

/* === MEGA-MENÚ "TIENDA" DESDE EL HEADER PRINCIPAL === */
.shop-menu-trigger { position: relative; }
.shop-menu-panel {
    position: absolute;
    top: calc(100% + 1px);
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    width: min(560px, 92vw);
    background: #fff;
    border: 1px solid #F1F0EC;
    border-radius: 0.75rem;
    box-shadow: 0 24px 48px rgba(54, 50, 49, 0.18);
    padding: 1.25rem;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    z-index: 60;
}
@media (max-width: 767px) {
    /* En mobile el menú principal ya es una lista desplegable (#nav-menu);
       acá el submenú de Tienda simplemente queda siempre visible debajo del
       link, sin necesitar otro toggle propio. */
    .shop-menu-panel {
        position: static; transform: none; width: 100%; box-shadow: none; border: none;
        padding: 0.5rem 0 0.25rem 1rem; grid-template-columns: 1fr 1fr;
        opacity: 1; visibility: visible; pointer-events: auto; display: grid;
    }
    .shop-menu-item.is-all { display: none; } /* en mobile ya está el link "Tienda" arriba */
}
.shop-menu-trigger:hover .shop-menu-panel,
.shop-menu-trigger:focus-within .shop-menu-panel {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}
.shop-menu-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.6rem 0.75rem;
    border-radius: 0.5rem;
    color: #363231;
    font-size: 0.85rem;
    font-weight: 600;
}
.shop-menu-item:hover { background-color: #F1F0EC; color: #C5A059; }
.shop-menu-item i {
    width: 1.9rem; height: 1.9rem;
    display: flex; align-items: center; justify-content: center;
    background-color: #F1F0EC;
    color: #707955;
    border-radius: 9999px;
    font-size: 0.85rem;
    flex-shrink: 0;
}
.shop-menu-item:hover i { background-color: #363231; color: #C5A059; }
.shop-menu-item.is-all { grid-column: 1 / -1; border-top: 1px solid #F1F0EC; margin-top: 0.4rem; padding-top: 0.75rem; justify-content: center; }

/* === TILES DE CATEGORÍA (home de tienda) === */
.category-tile {
    position: relative;
    display: block;
    border-radius: 0.75rem;
    overflow: hidden;
    aspect-ratio: 3 / 4;
    background-color: #363231;
    isolation: isolate;
    box-shadow: 0 1px 3px rgba(54, 50, 49, 0.08);
    transition: box-shadow 0.4s ease;
}
.category-tile:hover { box-shadow: 0 20px 40px rgba(54, 50, 49, 0.2); }
.category-tile img {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
    opacity: 0.75;
}
.category-tile:hover img { transform: scale(1.08); }
.category-tile::after {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(to top, rgba(54,50,49,0.85) 0%, rgba(54,50,49,0.15) 60%);
    z-index: 1;
}
.category-tile-label {
    position: relative; z-index: 2;
    height: 100%;
    display: flex; flex-direction: column; justify-content: flex-end;
    padding: 1.4rem 1.4rem;
    color: #fff;
}
.category-tile-count {
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-weight: 600;
    color: #C5A059;
}
.category-tile-name {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: 0.2rem;
}

/* === TARJETA DE PRODUCTO COMO LINK (grid tienda) === */
.shop-product-link { display: block; text-decoration: none; }

/* === Orden === */
.sort-select {
    border: 1px solid #d1d5db;
    border-radius: 9999px;
    padding: 0.5rem 2.25rem 0.5rem 1.1rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: #363231;
    background-color: #fff;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath fill='%23888685' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.9rem center;
}
.sort-select:focus { outline: none; border-color: #C5A059; }

/* === PDP: breadcrumb === */
.pdp-breadcrumb { font-size: 0.8rem; color: #888685; }
.pdp-breadcrumb a { color: #888685; }
.pdp-breadcrumb a:hover { color: #C5A059; }

/* === PDP: galería === */
.pdp-gallery-main {
    position: relative;
    border-radius: 0.75rem;
    overflow: hidden;
    background-color: #F1F0EC;
    aspect-ratio: 1 / 1;
}
.pdp-gallery-main img,
.pdp-gallery-main video { width: 100%; height: 100%; object-fit: cover; display: block; }
.pdp-thumb-row { display: flex; gap: 0.6rem; margin-top: 0.75rem; overflow-x: auto; }
.pdp-thumb {
    flex: 0 0 auto;
    width: 4.5rem; height: 4.5rem;
    border-radius: 0.5rem;
    overflow: hidden;
    border: 2px solid transparent;
    cursor: pointer;
    background: #F1F0EC;
    padding: 0;
    position: relative;
}
.pdp-thumb.is-active { border-color: #C5A059; }
.pdp-thumb img, .pdp-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }

/* === PDP: badges === */
.pdp-badge {
    display: inline-flex; align-items: center; gap: 0.4rem;
    background-color: #F1F0EC;
    color: #363231;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.35rem 0.75rem;
    border-radius: 9999px;
}
.pdp-badge.is-order { background-color: rgba(197, 160, 89, 0.15); color: #B08D4A; }
.pdp-badge i { color: #707955; }
.pdp-badge.is-order i { color: #C5A059; }

/* === PDP: specs rápidas === */
.pdp-quickspecs { display: flex; flex-wrap: wrap; gap: 1.25rem; }
.pdp-quickspec { display: flex; align-items: center; gap: 0.5rem; font-size: 0.85rem; color: #363231; }
.pdp-quickspec i { color: #707955; }

/* === PDP: acordeón de detalles === */
.pdp-accordion-item { border-top: 1px solid #F1F0EC; }
.pdp-accordion-item:last-child { border-bottom: 1px solid #F1F0EC; }
.pdp-accordion-trigger {
    width: 100%;
    display: flex; align-items: center; justify-content: space-between;
    padding: 1rem 0.25rem;
    font-weight: 600;
    color: #363231;
    text-align: left;
}
.pdp-accordion-trigger i { color: #888685; transition: transform 0.25s ease; }
.pdp-accordion-item.is-open .pdp-accordion-trigger i { transform: rotate(180deg); color: #C5A059; }
.pdp-accordion-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    color: #565351;
    font-size: 0.9rem;
    line-height: 1.65;
}
.pdp-accordion-item.is-open .pdp-accordion-panel { padding-bottom: 1rem; }

/* === PDP: ficha técnica === */
.pdp-spec-table { width: 100%; font-size: 0.88rem; }
.pdp-spec-table tr:not(:last-child) td { border-bottom: 1px solid #F1F0EC; }
.pdp-spec-table td { padding: 0.6rem 0.25rem; }
.pdp-spec-table td:first-child { color: #888685; width: 40%; }
.pdp-spec-table td:last-child { color: #363231; font-weight: 600; }

/* === PDP: cantidad === */
.pdp-qty {
    display: inline-flex; align-items: center;
    border: 1px solid #d1d5db;
    border-radius: 9999px;
    overflow: hidden;
}
.pdp-qty button {
    width: 2.5rem; height: 2.5rem;
    display: flex; align-items: center; justify-content: center;
    color: #363231;
    font-weight: 700;
}
.pdp-qty button:hover { background-color: #F1F0EC; color: #C5A059; }
.pdp-qty input {
    width: 3rem;
    text-align: center;
    border: none;
    font-weight: 700;
    color: #363231;
    -moz-appearance: textfield;
}
.pdp-qty input::-webkit-outer-spin-button,
.pdp-qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* === Toast simple (añadido al carrito) === */
.mini-toast {
    position: fixed;
    bottom: 1.5rem; left: 50%;
    transform: translateX(-50%) translateY(20px);
    background-color: #363231;
    color: #fff;
    padding: 0.75rem 1.5rem;
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 12px 30px rgba(0,0,0,0.25);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 999;
}
.mini-toast.is-visible { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 640px) {
    .pdp-gallery-main { aspect-ratio: 4 / 3; }
}

/* ============================================================
   CONCEPTOS ("Personalizable / Cotizar") -- diseños todavía no
   fabricados ni fotografiados. El placeholder es a propósito: nunca debe
   verse como una foto real de producto.
   ============================================================ */
.concept-placeholder {
    width: 100%; height: 100%;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 0.6rem;
    background: repeating-linear-gradient(135deg, #F1F0EC, #F1F0EC 10px, #ffffff 10px, #ffffff 20px);
    color: #888685;
}
.concept-placeholder i { font-size: 2.1rem; color: #C5A059; }
.concept-placeholder span {
    font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
}

.concept-card { position: relative; }
.concept-badge {
    position: absolute; top: 1rem; left: 1rem; z-index: 2;
    background-color: #363231; color: #fff;
    font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em;
    padding: 0.3rem 0.7rem; border-radius: 9999px;
    display: inline-flex; align-items: center; gap: 0.4rem;
}
.concept-badge i { color: #C5A059; }
.concept-badge.is-new { background-color: #4f6f52; }

.concept-price-note {
    font-size: 0.72rem; color: #888685; font-weight: 500;
}

.pdp-badge.is-concept { background-color: #363231; color: #fff; }
.pdp-badge.is-concept i { color: #C5A059; }

/* ============================================================
   MODO TIENDA vs. MODO CATÁLOGO
   Home (sin ?categoria ni ?buscar en la URL): se ven las secciones
   .shop-home-only (hero, vitrinas, colecciones...).
   Catálogo (con ?categoria=X o ?buscar=): tienda.js agrega
   "shop-browsing" al <body> -- ahí se ocultan las de home y aparece
   #shop-grid-section (filtros + grid), igual que una PLP propia.
   ============================================================ */
#shop-grid-section { display: none; }
body.shop-browsing .shop-home-only { display: none !important; }
body.shop-browsing #shop-grid-section { display: block; }

/* === HERO: CARRUSEL === */
.hero-carousel {
    position: relative;
    height: 78vh;
    min-height: 520px;
    max-height: 760px;
    overflow: hidden;
}
.hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.9s ease;
}
.hero-slide.is-active { opacity: 1; visibility: visible; z-index: 1; }
.hero-slide img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-slide .hero-overlay { position: absolute; inset: 0; }
.hero-slide-content {
    position: relative;
    z-index: 2;
    max-width: 56rem;
    margin: 0 auto;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 1.5rem;
}
.hero-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    width: 2.75rem; height: 2.75rem;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.35);
    color: #fff;
    border-radius: 9999px;
    backdrop-filter: blur(3px);
}
.hero-arrow:hover { background: rgba(255,255,255,0.25); }
.hero-arrow-prev { left: 1.25rem; }
.hero-arrow-next { right: 1.25rem; }
.hero-dots {
    position: absolute;
    bottom: 1.75rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    display: flex;
    gap: 0.5rem;
}
.hero-dot {
    width: 0.5rem; height: 0.5rem;
    border-radius: 9999px;
    background: rgba(255,255,255,0.45);
    transition: all 0.3s ease;
}
.hero-dot.is-active { background: #C5A059; width: 1.5rem; }
@media (max-width: 640px) {
    .hero-carousel { height: 68vh; min-height: 460px; }
    .hero-arrow { width: 2.25rem; height: 2.25rem; }
}
@media (prefers-reduced-motion: reduce) {
    .hero-slide { transition: none; }
}

/* === PAGINACIÓN DEL CATÁLOGO === */
.shop-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2.5rem;
}
.shop-page-btn {
    min-width: 2.5rem; height: 2.5rem;
    padding: 0 0.75rem;
    display: flex; align-items: center; justify-content: center;
    border-radius: 9999px;
    border: 1px solid #d1d5db;
    color: #363231;
    font-size: 0.85rem;
    font-weight: 600;
}
.shop-page-btn:hover:not(:disabled) { border-color: #C5A059; color: #C5A059; }
.shop-page-btn.is-active { background-color: #363231; color: #fff; border-color: #363231; }
.shop-page-btn:disabled { opacity: 0.35; cursor: default; }

/* === BLOQUE DE ESTILO POR CATEGORÍA (bajo el catálogo, solo si hay una categoría elegida) === */
.shop-category-style {
    max-width: 46rem;
    margin: 4rem auto 0;
    padding-top: 3rem;
    border-top: 1px solid #e5e1da;
}
.shop-category-style h3 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: #363231;
    margin-bottom: 0.9rem;
    text-align: center;
}
.shop-category-style > p {
    color: #565351;
    line-height: 1.75;
    margin-bottom: 1.25rem;
}
.shop-category-style ul {
    list-style: none;
    display: grid;
    gap: 0.75rem;
}
.shop-category-style li {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    font-size: 0.92rem;
    color: #565351;
}
.shop-category-style li::before {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: #C5A059;
    margin-top: 0.15rem;
    flex-shrink: 0;
}

/* === VITRINAS POR CATEGORÍA (bajo "Nuestras categorías") === */
.category-preview + .category-preview { border-top: 1px solid #F1F0EC; }
.category-preview-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}
.category-preview-head h3 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: #363231;
}
.category-preview-head a {
    font-size: 0.82rem;
    font-weight: 600;
    color: #C5A059;
    white-space: nowrap;
}
.category-preview-head a:hover { color: #B08D4A; }
.category-preview-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
}
@media (min-width: 768px) {
    .category-preview-grid { grid-template-columns: repeat(4, 1fr); }
}
