/* =============================================================
   INSTINTO DARK — Shop & Product CSS
   Story 3.3 | archive-product.php + single-product.php
   ============================================================= */

/* ── Shared Container ──────────────────────────────────────── */
.shop-container {
    max-width: var(--container-xl);
    margin-inline: auto;
    padding-inline: var(--space-sm);
}

@media (min-width: 768px) {
    .shop-container {
        padding-inline: var(--space-lg);
    }
}

/* ─────────────────────────────────────────────────────────────
   LOJA — archive-product.php
   ───────────────────────────────────────────────────────────── */

.shop-page {
    min-height: 100vh;
    background: var(--color-bg);
    /* topbar: 32px + header: 64px (mobile) / 72px (desktop) */
    padding-top: calc(32px + 64px + var(--space-2xl));
}

@media (min-width: 768px) {
    .shop-page {
        padding-top: calc(32px + 72px + var(--space-2xl));
    }
}

/* ── Breadcrumb (loja) ─────────────────────────────────────── */
.shop-breadcrumb,
.product-breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-xs);
    font-family: var(--font-body);
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    margin-bottom: var(--space-md);
}

.shop-breadcrumb a,
.product-breadcrumb a {
    color: var(--color-text-muted);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.shop-breadcrumb a:hover,
.product-breadcrumb a:hover {
    color: var(--color-text);
}

.shop-breadcrumb__sep,
.product-breadcrumb__sep {
    color: var(--color-border);
}

/* ── Page Header ───────────────────────────────────────────── */
.shop-header {
    background: var(--color-bg);
    padding-bottom: var(--space-lg);
}

.shop-header__label {
    font-family: var(--font-body);
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: var(--tracking-widest);
    color: var(--color-text-muted);
    margin-bottom: var(--space-sm);
}

.shop-header__title {
    font-family: var(--font-display);
    font-size: 34px;
    font-weight: var(--weight-medium);
    color: var(--color-text);
    line-height: var(--leading-tight);
    margin: 0 0 var(--space-xs);
}

@media (min-width: 768px) {
    .shop-header__title {
        font-size: 40px;
    }
}

.shop-header__count {
    font-family: var(--font-body);
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    margin: 0;
}

/* ── Filters ───────────────────────────────────────────────── */
.shop-filters {
    background: var(--color-bg);
    padding-bottom: var(--space-lg);
}

.shop-filters__list {
    display: flex;
    gap: var(--space-xs);
    overflow-x: auto;
    padding-bottom: var(--space-2xs);
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.shop-filters__list::-webkit-scrollbar {
    display: none;
}

.filter-btn {
    flex-shrink: 0;
    font-family: var(--font-body);
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wider);
    padding: var(--space-xs) var(--space-lg);
    text-decoration: none;
    transition: var(--transition-colors);
    border-radius: var(--radius-none);
    border: var(--border-thin) solid var(--color-border);
    background: transparent;
    color: var(--color-text-muted);
    font-weight: var(--weight-regular);
    cursor: pointer;
    display: inline-block;
}

.filter-btn:hover {
    border-color: var(--color-text-muted);
    color: var(--color-text);
}

.filter-btn--active {
    background: var(--color-accent);
    border-color: var(--color-accent);
    color: var(--color-bg);
    font-weight: var(--weight-bold);
}

.filter-btn--active:hover {
    border-color: var(--color-accent);
    color: var(--color-bg);
}

/* ── Product Grid ──────────────────────────────────────────── */
.shop-grid-section {
    background: var(--color-bg);
    padding-bottom: var(--space-4xl);
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-xs);
}

@media (min-width: 768px) {
    .product-grid {
        gap: var(--space-md);
    }
}

@media (min-width: 1024px) {
    .product-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: var(--space-lg);
    }
}

/* ── Product Card ──────────────────────────────────────────── */
.product-card {
    background: var(--color-surface);
    border: var(--border-thin) solid var(--color-border);
    transition:
        border-color var(--transition-normal),
        transform var(--transition-normal);
}

.product-card:hover {
    border-color: var(--color-text-muted);
    transform: translateY(-2px);
}

.product-card__link {
    display: block;
    text-decoration: none;
}

.product-card__image-wrap {
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #0a0a0a;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
}

@media (min-width: 768px) {
    .product-card__image-wrap {
        padding: var(--space-xl);
    }
}

.product-card__image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform var(--transition-slow);
}

.product-card:hover .product-card__image {
    transform: scale(1.05);
}

.product-card__badge {
    position: absolute;
    top: 0;
    left: 0;
    background: var(--color-accent);
    color: var(--color-bg);
    font-family: var(--font-body);
    font-size: 10px;
    font-weight: var(--weight-bold);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wider);
    padding: var(--space-2xs) var(--space-sm);
}

.product-card__body {
    padding: var(--space-md);
}

@media (min-width: 768px) {
    .product-card__body {
        padding: var(--space-lg);
    }
}

.product-card__name {
    font-family: var(--font-display);
    font-size: var(--text-lg);
    font-weight: var(--weight-semibold);
    color: var(--color-text);
    line-height: var(--leading-snug);
    margin: 0 0 var(--space-2xs);
}

@media (min-width: 768px) {
    .product-card__name {
        font-size: var(--text-xl);
    }
}

.product-card__subtitle {
    font-family: var(--font-body);
    font-size: var(--text-sm);
    font-style: italic;
    color: var(--color-text-muted);
    line-height: var(--leading-normal);
    margin: 0 0 var(--space-xs);
}

.product-card__price {
    font-family: var(--font-body);
    font-size: var(--text-base);
    font-weight: var(--weight-bold);
    color: var(--color-accent);
    margin: 0;
}

/* WC price override inside card */
.product-card__price .price {
    color: var(--color-accent);
    font-weight: var(--weight-bold);
}

.product-card__price del {
    color: var(--color-text-muted);
    opacity: 0.6;
}

/* ── Empty State ───────────────────────────────────────────── */
.shop-empty {
    padding: var(--space-4xl) var(--space-lg);
    text-align: center;
}

.shop-empty__text {
    font-family: var(--font-display);
    font-style: italic;
    font-size: var(--text-xl);
    color: var(--color-text-muted);
    margin: 0;
}

/* ── Pagination ────────────────────────────────────────────── */
.shop-pagination {
    display: flex;
    justify-content: center;
    gap: var(--space-xs);
    margin-top: var(--space-3xl);
    flex-wrap: wrap;
}

.shop-pagination .page-numbers {
    font-family: var(--font-body);
    font-size: var(--text-sm);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wider);
    color: var(--color-text-muted);
    text-decoration: none;
    border: var(--border-thin) solid var(--color-border);
    padding: var(--space-xs) var(--space-md);
    transition: var(--transition-colors);
    border-radius: var(--radius-none);
}

.shop-pagination .page-numbers:hover,
.shop-pagination .page-numbers.current {
    border-color: var(--color-text-muted);
    color: var(--color-text);
}

.shop-pagination .page-numbers.current {
    background: var(--color-surface);
}

/* ─────────────────────────────────────────────────────────────
   PRODUTO — single-product.php
   ───────────────────────────────────────────────────────────── */

.single-product-page {
    min-height: 100vh;
    background: var(--color-bg);
    padding-top: calc(32px + 64px);
}

@media (min-width: 768px) {
    .single-product-page {
        padding-top: calc(32px + 72px);
    }
}

/* ── Breadcrumb (produto) ──────────────────────────────────── */
.product-breadcrumb-wrap {
    border-bottom: var(--border-thin) solid var(--color-border);
    padding-block: var(--space-md);
}

/* ── Product Layout ────────────────────────────────────────── */
.product-layout {
    display: grid;
    grid-template-columns: 1fr;
}

@media (min-width: 768px) {
    .product-layout {
        grid-template-columns: 55% 45%;
        align-items: start;
    }
}

/* ── Gallery ───────────────────────────────────────────────── */
.product-gallery {
    display: flex;
    gap: var(--space-sm);
    padding: var(--space-lg);
    padding-top: var(--space-xl);
    flex-direction: column;
}

@media (min-width: 768px) {
    .product-gallery {
        flex-direction: row;
    }
}

/* Thumbnails — só visíveis no desktop */
.product-gallery__thumbs {
    display: none;
    flex-direction: column;
    gap: var(--space-xs);
}

@media (min-width: 768px) {
    .product-gallery__thumbs {
        display: flex;
    }
}

.gallery-thumb {
    width: 72px;
    height: 72px;
    flex-shrink: 0;
    overflow: hidden;
    border: var(--border-thin) solid var(--color-border);
    border-radius: var(--radius-none);
    cursor: pointer;
    padding: 0;
    background: none;
    transition: border-color var(--transition-fast);
}

.gallery-thumb:hover {
    border-color: var(--color-text-muted);
}

.gallery-thumb.is-active {
    border-color: var(--color-text);
}

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

/* Main image wrap */
.product-gallery__main-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-gallery__main {
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: var(--color-surface);
}

.product-gallery__main-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity 0.3s ease;
}

/* Dots — só visíveis no mobile */
.gallery-dots {
    display: flex;
    justify-content: center;
    gap: var(--space-xs);
    padding-top: var(--space-md);
}

@media (min-width: 768px) {
    .gallery-dots {
        display: none;
    }
}

.gallery-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-border);
    border: none;
    cursor: pointer;
    padding: 0;
    transition: background var(--transition-fast);
}

.gallery-dot.is-active {
    background: var(--color-accent);
}

.product-gallery__placeholder img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    background: var(--color-surface);
}

/* ── Product Details ───────────────────────────────────────── */
.product-details {
    position: relative;
}

@media (min-width: 768px) {
    .product-details__inner {
        position: sticky;
        top: calc(32px + 72px);
        padding: var(--space-xl) var(--space-lg) var(--space-xl) 0;
    }
}

/* Identity */
.product-details__identity {
    padding: var(--space-lg);
    padding-bottom: var(--space-lg);
}

@media (min-width: 768px) {
    .product-details__identity {
        padding-left: 0;
    }
}

.product-details__category {
    display: inline-block;
    font-family: var(--font-body);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: var(--tracking-wider);
    color: var(--color-text-muted);
    border: var(--border-thin) solid var(--color-border);
    padding: var(--space-2xs) var(--space-sm);
    text-decoration: none;
    transition: var(--transition-colors);
    border-radius: var(--radius-none);
    margin-bottom: var(--space-sm);
}

.product-details__category:hover {
    color: var(--color-text);
    border-color: var(--color-text-muted);
}

.product-details__name {
    font-family: var(--font-display);
    font-size: 34px;
    font-weight: var(--weight-semibold);
    color: var(--color-text);
    line-height: var(--leading-tight);
    margin: 0 0 var(--space-sm);
}

@media (min-width: 768px) {
    .product-details__name {
        font-size: 40px;
    }
}

.product-details__subtitle {
    font-family: var(--font-body);
    font-size: var(--text-base);
    font-style: italic;
    color: var(--color-text-muted);
    line-height: var(--leading-normal);
    margin: 0;
}

/* Narrative */
.product-details__narrative {
    border-top: var(--border-thin) solid var(--color-border);
    padding: var(--space-lg);
}

@media (min-width: 768px) {
    .product-details__narrative {
        padding-left: 0;
    }
}

.product-details__narrative-label {
    font-family: var(--font-body);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: var(--tracking-widest);
    color: var(--color-text-muted);
    margin: 0 0 var(--space-md);
}

.product-details__narrative-text,
.product-details__narrative-text p {
    font-family: var(--font-body);
    font-size: var(--text-base);
    color: var(--color-text-muted);
    line-height: var(--leading-relaxed);
    margin: 0;
}

/* Purchase section */
.product-details__purchase {
    border-top: var(--border-thin) solid var(--color-border);
    padding: var(--space-lg);
}

@media (min-width: 768px) {
    .product-details__purchase {
        padding-left: 0;
    }
}

/* Price override */
.product-details__price .price,
.product-details__price {
    font-family: var(--font-body);
    font-size: 30px;
    font-weight: var(--weight-bold);
    color: var(--color-accent);
    line-height: 1;
    margin-bottom: var(--space-xs);
}

.product-details__price ins {
    text-decoration: none;
    color: var(--color-accent);
}

.product-details__price del {
    color: var(--color-text-muted);
    opacity: 0.6;
    font-size: var(--text-lg);
}

/* WC Add to Cart form */
.single-product-page .woocommerce-variation-add-to-cart,
.single-product-page form.cart {
    margin-top: var(--space-lg);
}

/* Size / variation selector */
.single-product-page .variations {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: var(--space-md);
}

.single-product-page .variations td,
.single-product-page .variations th {
    padding: 0;
    text-align: left;
    vertical-align: middle;
}

.single-product-page .variations label {
    font-family: var(--font-body);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: var(--tracking-widest);
    color: var(--color-text-muted);
    display: block;
    margin-bottom: var(--space-sm);
}

.single-product-page .variations select {
    background: var(--color-surface);
    border: var(--border-thin) solid var(--color-border);
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: var(--text-sm);
    padding: var(--space-xs) var(--space-md);
    border-radius: var(--radius-none);
    appearance: none;
    width: 100%;
    cursor: pointer;
}

.single-product-page .variations select:focus {
    outline: none;
    border-color: var(--color-text-muted);
}

/* Reset variation link */
.single-product-page .reset_variations {
    font-family: var(--font-body);
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    text-decoration: underline;
    cursor: pointer;
    display: inline-block;
    margin-top: var(--space-xs);
}

/* Quantity input */
.single-product-page .quantity {
    margin-right: var(--space-sm);
}

.single-product-page .quantity input[type="number"] {
    width: 64px;
    background: var(--color-surface);
    border: var(--border-thin) solid var(--color-border);
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: var(--text-sm);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-none);
    text-align: center;
}

/* Add to cart button */
.single-product-page button.single_add_to_cart_button,
.single-product-page .single_add_to_cart_button {
    width: 100%;
    height: 56px;
    background: var(--color-accent);
    color: var(--color-bg);
    border: none;
    border-radius: var(--radius-none);
    font-family: var(--font-body);
    font-size: var(--text-sm);
    font-weight: var(--weight-bold);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wider);
    cursor: pointer;
    transition: var(--transition-colors);
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: var(--space-md);
}

.single-product-page button.single_add_to_cart_button:hover {
    background: #bfef00;
}

/* WhatsApp button */
.btn-whatsapp {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 48px;
    background: transparent;
    color: var(--color-text);
    border: var(--border-thin) solid var(--color-border);
    border-radius: var(--radius-none);
    font-family: var(--font-body);
    font-size: var(--text-sm);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wider);
    text-decoration: none;
    transition: border-color var(--transition-fast);
    margin-top: var(--space-sm);
}

.btn-whatsapp:hover {
    border-color: var(--color-text-muted);
}

/* ── Cross-sell ────────────────────────────────────────────── */
.product-crosssell {
    border-top: var(--border-thin) solid var(--color-border);
    background: var(--color-surface);
    padding-block: var(--space-xl);
    margin-top: var(--space-xl);
}

@media (min-width: 768px) {
    .product-crosssell {
        padding-block: var(--space-3xl);
    }
}

.product-crosssell__label {
    font-family: var(--font-body);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: var(--tracking-widest);
    color: var(--color-text-muted);
    margin: 0 0 var(--space-lg);
}

.product-crosssell__list {
    display: flex;
    gap: var(--space-md);
    overflow-x: auto;
    padding-bottom: var(--space-xs);
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.product-crosssell__list::-webkit-scrollbar {
    display: none;
}

.crosssell-card {
    flex-shrink: 0;
    width: 160px;
    background: var(--color-bg);
    border: var(--border-thin) solid var(--color-border);
    text-decoration: none;
    display: block;
    transition:
        border-color var(--transition-normal),
        transform var(--transition-normal);
}

@media (min-width: 768px) {
    .crosssell-card {
        width: 200px;
    }
}

.crosssell-card:hover {
    border-color: var(--color-text-muted);
    transform: translateY(-2px);
}

.crosssell-card__image-wrap {
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: var(--color-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-md);
}

.crosssell-card__image {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.crosssell-card__body {
    padding: var(--space-sm);
}

.crosssell-card__name {
    font-family: var(--font-display);
    font-size: var(--text-base);
    font-weight: var(--weight-semibold);
    color: var(--color-text);
    line-height: var(--leading-snug);
    margin: 0 0 var(--space-2xs);
}

.crosssell-card__subtitle {
    font-family: var(--font-body);
    font-size: var(--text-xs);
    font-style: italic;
    color: var(--color-text-muted);
    margin: 0 0 var(--space-2xs);
}

.crosssell-card__price {
    font-family: var(--font-body);
    font-size: var(--text-sm);
    font-weight: var(--weight-bold);
    color: var(--color-accent);
    margin: 0;
}

.crosssell-card__price .price {
    color: var(--color-accent);
}

/* ─────────────────────────────────────────────────────────────
   RESPONSIVIDADE — breakpoints 320 / 375 / 768 / 1280
   ───────────────────────────────────────────────────────────── */

/* 320px — mobile mínimo */
@media (max-width: 375px) {
    .product-details__name {
        font-size: 28px;
    }

    .shop-header__title {
        font-size: 28px;
    }

    .product-grid {
        gap: var(--space-2xs);
    }

    .product-card__body {
        padding: var(--space-sm);
    }

    .product-card__name {
        font-size: var(--text-base);
    }
}

/* 768px — tablet */
@media (min-width: 768px) {
    .product-gallery {
        flex-direction: row;
    }
}

/* 1280px — desktop */
@media (min-width: 1280px) {
    .product-details__name {
        font-size: 40px;
    }
}
