/* ============================================================
   ONA Club — Tienda / Shop
   Estilos del módulo de tienda: grid de productos, detalle,
   carrusel, paleta de colores, timeline de pedidos.
   ============================================================ */

/* ============================
   SECTION LATERAL PADDING
   Matches .page-header padding so the shop content
   is never flush against the screen edges.
   ============================ */

#my-orders-section,
#shop-categories,
#shop-grid {
    padding-left:  var(--space-md);
    padding-right: var(--space-md);
}

#my-orders-section { margin-bottom: var(--space-sm); }
#shop-categories    { margin-bottom: 0; }
#shop-grid          { padding-bottom: var(--space-xl); }

/* ============================
   PRODUCT GRID
   ============================ */

#shop-grid .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
}

/* ============================
   PRODUCT CARD
   ============================ */

#shop-grid .card {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    background: var(--bg-card);
    display: flex;
    flex-direction: column;
    cursor: pointer;
}

#shop-grid .card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    border-color: rgba(var(--color-primary-rgb, 99 102 241), 0.35);
}

.product-card__image {
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

.product-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.3s ease;
}

#shop-grid .card:hover .product-card__image img {
    transform: scale(1.04);
}

#shop-grid .card .card__body {
    padding: var(--space-md);
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

#shop-grid .card h4 {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    color: var(--text-heading);
    line-height: 1.3;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

#shop-grid .card h4 + div {
    margin-top: auto;
    padding-top: var(--space-xs);
}

#shop-grid .badge--primary {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 999px;
}

/* ============================
   CATEGORY FILTER
   ============================ */

#shop-categories .class-filter {
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--border-color);
}

/* ============================
   MY ORDERS SECTION
   ============================ */

#my-orders-section .card {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
}

#my-orders-section img {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
}

/* ============================
   ORDER TIMELINE
   ============================ */

.order-timeline {
    display: flex;
    align-items: center;
    gap: 0;
    padding: var(--space-sm) 0 var(--space-xs);
    overflow-x: auto;
    scrollbar-width: none;
}

.order-timeline::-webkit-scrollbar {
    display: none;
}

.order-timeline__step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.order-timeline__dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    background: var(--bg-elevated);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: border-color 0.2s, background 0.2s, color 0.2s;
}

.order-timeline__step.done .order-timeline__dot {
    border-color: var(--color-primary);
    background: var(--color-primary);
    color: #fff;
}

.order-timeline__step.active .order-timeline__dot {
    border-color: var(--color-primary);
    background: rgba(var(--color-primary-rgb, 99 102 241), 0.12);
    color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb, 99 102 241), 0.18);
}

.order-timeline__label {
    font-size: 10px;
    color: var(--text-muted);
    text-align: center;
    white-space: nowrap;
    max-width: 58px;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.order-timeline__step.done .order-timeline__label,
.order-timeline__step.active .order-timeline__label {
    color: var(--color-primary);
    font-weight: var(--font-weight-medium);
}

.order-timeline__line {
    flex: 1;
    height: 2px;
    min-width: 16px;
    background: var(--border-color);
    margin-bottom: 18px;
    transition: background 0.2s;
}

.order-timeline__line.done {
    background: var(--color-primary);
}

/* ============================
   PRODUCT DETAIL — CAROUSEL
   ============================ */

.product-carousel {
    position: relative;
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    margin-bottom: var(--space-md);
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
}

.product-carousel__track {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.product-carousel__track::-webkit-scrollbar {
    display: none;
}

.product-carousel__track img {
    flex-shrink: 0;
    width: 100%;
    height: 260px;
    object-fit: contain;
    background: var(--bg-elevated);
    scroll-snap-align: start;
}

/* Arrow buttons */
.carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(0, 0, 0, 0.42);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 5;
    padding: 0;
    line-height: 1;
    transition: background 0.2s, border-color 0.2s;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.carousel-arrow:hover {
    background: rgba(0, 0, 0, 0.68);
    border-color: rgba(255, 255, 255, 0.5);
}

.carousel-arrow--left  { left:  var(--space-sm); }
.carousel-arrow--right { right: var(--space-sm); }

/* Dots row */
.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: var(--space-xs) 0 var(--space-sm);
    background: var(--bg-elevated);
}

.carousel-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    border: none;
    background: var(--border-color);
    cursor: pointer;
    padding: 0;
    transition: background 0.2s, transform 0.2s;
}

.carousel-dot.active {
    background: var(--color-primary);
    transform: scale(1.35);
}

/* ============================
   COLOR PALETTE
   ============================ */

.color-palette {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    padding: var(--space-xs) 0;
}

.color-swatch {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    box-shadow: 0 0 0 1px var(--border-color);
    transition: transform 0.15s, box-shadow 0.15s;
    flex-shrink: 0;
}

.color-swatch:hover {
    transform: scale(1.15);
}

.color-swatch.selected {
    box-shadow: 0 0 0 2px var(--bg-card), 0 0 0 4px var(--color-primary);
    transform: scale(1.1);
}

/* ============================
   RESPONSIVE
   ============================ */

/* Very small phones: 1 column */
@media (max-width: 359px) {
    #shop-grid .gallery-grid {
        grid-template-columns: 1fr;
        gap: var(--space-sm);
    }
}

/* Tablets: 3 columns */
@media (min-width: 640px) {
    #shop-grid .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--space-lg);
    }

    .product-carousel__track img {
        height: 340px;
    }

    .carousel-arrow {
        width: 40px;
        height: 40px;
    }

    #shop-grid .card h4 {
        font-size: var(--font-size-base);
    }
}

/* Desktop: 4 columns */
@media (min-width: 1024px) {
    #shop-grid .gallery-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: var(--space-lg);
    }

    .product-carousel__track img {
        height: 420px;
    }
}

/* Wide: 5 columns */
@media (min-width: 1400px) {
    #shop-grid .gallery-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* ============================
   DARK MODE
   ============================ */

@media (prefers-color-scheme: dark) {
    .carousel-arrow {
        background: rgba(255, 255, 255, 0.12);
        border-color: rgba(255, 255, 255, 0.15);
        color: var(--text-primary);
    }

    .carousel-arrow:hover {
        background: rgba(255, 255, 255, 0.25);
    }
}
