﻿/* =============
   PRODUCTOS — Experiencia Interactiva de Producto
   Origen Comercial · Apple/Nike-inspired
   ============= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ── Variables ============= */
:root {
    --pg-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --pg-black: #1a1a1a;
    --pg-gray-900: #2d2d2d;
    --pg-gray-600: #6b6b6b;
    --pg-gray-400: #a0a0a0;
    --pg-gray-200: #e5e5e5;
    --pg-gray-100: #f5f5f5;
    --pg-white: #fafafa; /* Blanco off-white fotográfico para mejor blend */
    --pg-green: #3d8b5f;
    --pg-ease-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --pg-ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Page Base ============= */
.pg-body {
    background: var(--pg-white);
    font-family: var(--pg-font);
    color: var(--pg-black);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.pg-main {
    min-height: 100vh;
    position: relative;
}

/* =============
   SECTION 1 — PRODUCT GRID
   ============= */

.pg-grid-view {
    padding: 140px 0 100px;
    opacity: 1;
    transition: opacity 0.4s var(--pg-ease-smooth);
}

.pg-grid-view--hidden {
    opacity: 0;
    pointer-events: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
}

/* ── Grid Header ============= */
.pg-header {
    text-align: center;
    margin-bottom: 80px;
    padding: 0 24px;
}

.pg-header__breadcrumb {
    font-size: 13px;
    font-weight: 400;
    color: var(--pg-gray-400);
    margin-bottom: 20px;
    letter-spacing: 0.02em;
}

.pg-header__breadcrumb a {
    color: var(--pg-gray-400);
    text-decoration: none;
    transition: color 0.2s;
}

.pg-header__breadcrumb a:hover {
    color: var(--pg-black);
}

.pg-header__title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 600;
    letter-spacing: -0.03em;
    line-height: 1.1;
    color: var(--pg-black);
    margin: 0;
}

.pg-header__subtitle {
    font-size: 1.1rem;
    font-weight: 300;
    color: var(--pg-gray-600);
    margin-top: 16px;
    letter-spacing: -0.01em;
}

/* ── Product Grid ============= */
.pg-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 60px 40px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px;
}

/* ── Product Item ============= */
.pg-item {
    cursor: pointer;
    text-align: center;
    transition: transform 0.25s ease-out, opacity 0.35s ease;
    will-change: transform, opacity;
    position: relative;
}

.pg-item__img-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    border-radius: 12px;
    overflow: visible;
}

.pg-item__img-wrap img {
    width: 85%;
    height: 85%;
    object-fit: contain;
    mix-blend-mode: multiply;
    transition: transform 0.25s ease-out, filter 0.25s ease-out;
    filter: brightness(1.04) contrast(1.03) drop-shadow(0 4px 12px rgba(0, 0, 0, 0));
    user-select: none;
    -webkit-user-drag: none;
}

/* ── Hover Float Shadow (ellipse under product) ============= */
.pg-item__img-wrap::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 15%;
    right: 15%;
    height: 24px;
    background: radial-gradient(ellipse, rgba(0, 0, 0, 0.08) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.25s ease-out;
    pointer-events: none;
}

.pg-item:hover {
    transform: translateY(-8px) scale(1.05);
}

.pg-item:hover .pg-item__img-wrap img {
    filter: brightness(1.04) contrast(1.03) drop-shadow(0 12px 32px rgba(0, 0, 0, 0.08));
}

.pg-item:hover .pg-item__img-wrap::after {
    opacity: 1;
}

.pg-item__name {
    display: block;
    font-size: 15px;
    font-weight: 500;
    color: var(--pg-gray-900);
    letter-spacing: -0.01em;
    transition: color 0.2s;
}

.pg-item:hover .pg-item__name {
    color: var(--pg-black);
}

/* ── Staggered Entry Animation ============= */
.pg-item {
    opacity: 0;
    transform: translateY(24px);
}

.pg-item--visible {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.5s var(--pg-ease-expo), transform 0.5s var(--pg-ease-expo);
}

/* ── Grid Cinematic Transition ============= */
.pg-grid-view--transitioning .pg-header {
    opacity: 0 !important;
    filter: blur(4px);
    transform: translateY(-10px);
    transition: opacity 0.35s ease, filter 0.35s ease, transform 0.35s ease;
    pointer-events: none;
}

.pg-grid--transitioning .pg-item:not(.pg-item--active) {
    opacity: 0 !important;
    filter: blur(4px);
    transform: scale(0.96) !important;
    transition: opacity 0.35s ease, filter 0.35s ease, transform 0.35s ease !important;
    pointer-events: none;
}

.pg-item--active {
    z-index: 100;
    pointer-events: none;
}

.pg-item--zooming {
    transition: transform 0.65s var(--pg-ease-expo) !important;
}

/* =============
   SECTION 2 — PRODUCT DETAIL
   ============= */

.pg-detail {
    position: fixed;
    inset: 0;
    background: var(--pg-white);
    z-index: 200;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s var(--pg-ease-smooth), visibility 0s 0.4s;
    overflow-y: auto;
    overflow-x: hidden;
}

.pg-detail--active {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.4s var(--pg-ease-smooth), visibility 0s 0s;
}

/* ── Back Button ============= */
.pg-detail__back {
    position: fixed;
    top: 24px;
    left: 24px;
    z-index: 210;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 100px;
    font-family: var(--pg-font);
    font-size: 14px;
    font-weight: 500;
    color: var(--pg-black);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.pg-detail__back:hover {
    background: var(--pg-white);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transform: translateX(-2px);
}

.pg-detail__back svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

/* ── Detail Content ============= */
.pg-detail__content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 80px 24px 60px;
}

/* ── Product Image Stage ============= */
.pg-detail__stage {
    position: relative;
    width: 100%;
    max-width: 500px;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 32px;
}

.pg-detail--active .pg-detail__stage {
    animation: detailReveal 0.6s var(--pg-ease-expo) forwards;
}

@keyframes detailReveal {
    from {
        opacity: 0;
        transform: scale(0.94);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.pg-detail__img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    mix-blend-mode: multiply;
    filter: brightness(1.04) contrast(1.03);
    opacity: 0;
    transition: opacity 0.15s ease;
    user-select: none;
    -webkit-user-drag: none;
}

.pg-detail__img--active {
    opacity: 1;
}

/* ── Detail Info ============= */
.pg-detail__info {
    text-align: center;
    width: 100%;
    max-width: 500px;
}

.pg-detail--active .pg-detail__info {
    animation: infoSlideUp 0.5s var(--pg-ease-expo) 0.15s both;
}

@keyframes infoSlideUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pg-detail__name {
    font-size: clamp(1.5rem, 4vw, 2.2rem);
    font-weight: 600;
    letter-spacing: -0.03em;
    color: var(--pg-black);
    margin: 0 0 8px;
}

/* =============
   INTERACTIVE SLIDER
   ============= */

.pg-slider-wrap {
    width: 100%;
    max-width: 400px;
    margin: 24px auto 32px;
    padding: 0 16px; /* Added padding so cursor doesn't cut off */
}

.pg-slider {
    position: relative;
    width: 100%;
    height: 44px;
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    touch-action: none;
}

.pg-slider__track {
    position: relative;
    width: 100%;
    height: 16px;
    background: #e2e2e2;
    border-radius: 100px;
}

.pg-slider__fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: #c21b10;
    border-radius: 100px;
    transition: width 0.05s var(--pg-ease-smooth);
    pointer-events: none;
}

.pg-slider__cursor {
    position: absolute;
    top: 50%;
    left: 0;
    width: 38px;
    height: 38px;
    margin-top: -19px;
    border-radius: 50%;
    background-color: #c21b10;
    border: 3px solid #ffffff;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.15);
    transition: left 0.05s var(--pg-ease-smooth), transform 0.15s ease;
    z-index: 5;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Background image for double arrow icon */
.pg-slider__cursor::after {
    content: '';
    width: 18px;
    height: 18px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M10 16L5 12l5-4v8zM14 8l5 4-5 4V8z"/></svg>');
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
}

.pg-slider__cursor--dragging {
    transform: scale(1.1);
    transition: left 0s, transform 0.15s ease;
}

.pg-slider__mark {
    display: none; /* Hide the dots to match the clean design */
}

.pg-slider__mark--active {
    display: none;
}

/* ── Cut Indicator ============= */
.pg-slider__indicator {
    font-size: 13px;
    font-weight: 400;
    color: var(--pg-gray-400);
    letter-spacing: 0.04em;
    margin-top: 8px;
    text-align: center;
}

/* ── No-slider message for single-image products ============= */
.pg-detail__single-label {
    font-size: 14px;
    font-weight: 400;
    color: var(--pg-gray-400);
    margin: 8px 0 24px;
}

/* ── WhatsApp CTA ============= */
.pg-detail__cta {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 32px;
    background: #25d366;
    color: #fff;
    font-family: var(--pg-font);
    font-size: 15px;
    font-weight: 500;
    border-radius: 100px;
    text-decoration: none;
    transition: all 0.25s ease;
    box-shadow: 0 4px 16px rgba(37, 211, 102, 0.25);
    margin-top: 8px;
}

.pg-detail__cta:hover {
    background: #22c55e;
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(37, 211, 102, 0.35);
}

.pg-detail__cta svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
    flex-shrink: 0;
}

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

/* Tablet */
@media (max-width: 1024px) {
    .pg-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 48px 32px;
        padding: 0 32px;
    }

    .pg-header {
        margin-bottom: 60px;
    }
}

/* Mobile */
@media (max-width: 640px) {
    .pg-grid-view {
        padding: 120px 0 60px;
    }

    .pg-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 36px 20px;
        padding: 0 20px;
    }

    .pg-header {
        margin-bottom: 40px;
    }

    .pg-header__subtitle {
        font-size: 0.95rem;
    }

    .pg-item__name {
        font-size: 13px;
    }

    .pg-detail__content {
        padding: 70px 16px 40px;
        justify-content: flex-start;
        padding-top: 100px;
    }

    .pg-detail__stage {
        max-width: 320px;
    }

    .pg-slider-wrap {
        max-width: 300px;
    }

    .pg-detail__back {
        top: 16px;
        left: 16px;
        padding: 8px 16px;
        font-size: 13px;
    }
}

/* Small mobile */
@media (max-width: 380px) {
    .pg-grid {
        gap: 28px 16px;
        padding: 0 16px;
    }

    .pg-detail__stage {
        max-width: 260px;
    }
}

/* ── Mobile Touch Enhancements ============= */
@media (max-width: 768px) {
    .pg-slider__cursor {
        width: 48px;
        height: 48px;
        margin-top: -24px;
    }

    .pg-slider__track {
        height: 20px;
    }

    .pg-detail__cta {
        width: 100%;
        max-width: 320px;
        justify-content: center;
        min-height: 48px;
        font-size: 16px;
        white-space: nowrap;
    }
}
