/**
 * Elisa Parpinelli – single-product.css
 * Estilos da página de produto individual.
 */

/* ============================================================
   LAYOUT
   ============================================================ */

.single-product-page {
    padding: 1.5rem 0 4rem;
}

/* Desktop: galeria à esquerda; à direita, header (breadcrumb+título) acima da
   info. O header alinha ao topo da galeria. */
.sp-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
        "gallery header"
        "gallery info";
    grid-template-rows: auto 1fr;
    column-gap: 3rem;
    row-gap: 1.5rem;
    align-items: start;
    margin-bottom: 4rem;
}
.sp-header  { grid-area: header; }
.sp-gallery { grid-area: gallery; }
.sp-info    { grid-area: info; }

/* Mobile: empilha — breadcrumb+título no topo, depois imagem, depois info. */
@media (max-width: 1023px) {
    .sp-layout {
        grid-template-columns: 1fr;
        grid-template-areas:
            "header"
            "gallery"
            "info";
        grid-template-rows: none;
        gap: 1.5rem;
    }
}

/* ============================================================
   GALLERY
   ============================================================ */

.sp-gallery__main {
    position: relative;
    border-radius: 0;
    overflow: hidden;
    background: #f8f8f8;
    aspect-ratio: 1;
    cursor: zoom-in;
}

.sp-gallery__zoom-container {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.sp-gallery__main-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    transition: transform 0.4s ease, opacity 0.25s ease;
    transform-origin: center;
}

.sp-gallery__main:hover .sp-gallery__main-img {
    transform: scale(1.06);
}

@media (prefers-reduced-motion: reduce) {
    .sp-gallery__main-img { transition: opacity 0.25s ease; }
    .sp-gallery__main:hover .sp-gallery__main-img { transform: none; }
}

/* Badges on gallery */
.sp-gallery__badges {
    position: absolute;
    top: 1rem;
    left: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    z-index: 2;
}

/* Fullscreen button */
.sp-gallery__fullscreen {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: rgba(255,255,255,0.9);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: #333;
    z-index: 3;
    transition: background 0.15s, color 0.15s, transform 0.15s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.sp-gallery__fullscreen:hover {
    background: var(--color-primary);
    color: #fff;
    transform: scale(1.1);
}

/* Prev / Next arrows on gallery */
.sp-gallery__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.92);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    z-index: 3;
    color: #333;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    transition: background 0.15s, color 0.15s;
}
.sp-gallery__nav:hover { background: var(--color-primary); color: #fff; }
.sp-gallery__nav--prev { left: 0.75rem; }
.sp-gallery__nav--next { right: 0.75rem; }

/* Thumbnails */
.sp-gallery__thumbs {
    display: flex;
    gap: 0.625rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.sp-gallery__thumb {
    width: 80px;
    height: 80px;
    border-radius: 0;
    overflow: hidden;
    border: 2px solid transparent;
    padding: 0;
    background: #f0f0f0;
    cursor: pointer;
    transition: border-color 0.15s, transform 0.15s;
    flex-shrink: 0;
}
.sp-gallery__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.sp-gallery__thumb:hover { border-color: var(--color-primary); transform: scale(1.04); }
.sp-gallery__thumb.is-active { border-color: var(--color-primary); }

/* ============================================================
   INFO COLUMN
   ============================================================ */

.sp-breadcrumb { margin-bottom: 1rem; }

.sp-info__title {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 0.75rem;
    color: var(--color-black);
}

.sp-info__rating {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    font-size: 0.875rem;
}

.sp-info__review-count {
    color: #888;
    text-decoration: underline;
    text-decoration-color: transparent;
    transition: color 0.15s, text-decoration-color 0.15s;
}
.sp-info__review-count:hover {
    color: var(--color-primary);
    text-decoration-color: var(--color-primary);
}

.sp-info__sku {
    color: #aaa;
    font-size: 0.8rem;
}
.sp-info__sku span { font-weight: 500; color: #888; }

/* Price */
.sp-info__price {
    margin-bottom: 1.25rem;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-primary);
    line-height: 1;
}
.sp-info__price del {
    font-size: 1.1rem;
    font-weight: 400;
    color: #bbb;
    text-decoration: line-through;
    margin-right: 0.5rem;
}
.sp-info__price ins {
    text-decoration: none;
}

/* Short description */
.sp-info__short-desc {
    font-size: 0.9375rem;
    line-height: 1.7;
    color: #555;
    margin-bottom: 1.25rem;
}

.sp-info__divider {
    height: 1px;
    background: #eee;
    margin: 1.25rem 0;
}

/* Stock indicator */
.sp-info__stock {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.8125rem;
    font-weight: 500;
    margin-left: 0.75rem;
}
.sp-info__stock--in  { color: #22c55e; }
.sp-info__stock--out { color: #ef4444; }

/* ============================================================
   FORM (variations + qty + CTA)
   ============================================================ */

.sp-form__group {
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.sp-form__label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-black);
    min-width: 90px;
    flex-shrink: 0;
}

.sp-form__selected-value {
    font-weight: 400;
    color: var(--color-primary);
    margin-left: 0.25rem;
}

/* Color swatches */
.sp-color-swatches {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.sp-color-swatch {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    font-weight: 700;
    color: #fff;
    box-shadow: 0 0 0 2px #fff, 0 0 0 3px #ddd;
    transition: box-shadow 0.15s, transform 0.15s;
    background: #ccc;
    padding: 0;
}
.sp-color-swatch:hover {
    transform: scale(1.15);
    box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--color-primary);
}
.sp-color-swatch.is-active {
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--color-primary);
    transform: scale(1.05);
}

/* Size buttons */
.sp-size-btns {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.sp-size-btn {
    min-width: 44px;
    height: 40px;
    padding: 0 0.75rem;
    border: 1.5px solid #ddd;
    border-radius: 0;
    background: #fff;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-black);
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
    font-family: inherit;
}
.sp-size-btn:hover { border-color: var(--color-primary); color: var(--color-primary); }
.sp-size-btn.is-active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
}

/* Quantity */
.sp-qty {
    display: flex;
    align-items: center;
    border: 1.5px solid #ddd;
    border-radius: 0;
    overflow: hidden;
    height: 44px;
}

.sp-qty__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-black);
    transition: background 0.15s, color 0.15s;
    flex-shrink: 0;
}
.sp-qty__btn:hover { background: var(--color-primary); color: #fff; }

.sp-qty__input {
    width: 56px;
    height: 44px;
    border: none;
    text-align: center;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    color: var(--color-black);
    background: none;
    border-left: 1px solid #eee;
    border-right: 1px solid #eee;
    outline: none;
    -moz-appearance: textfield;
}
.sp-qty__input::-webkit-inner-spin-button,
.sp-qty__input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

/* CTA Buttons */
.sp-form__actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.sp-btn-cart,
.sp-btn-buy {
    flex: 1;
    min-width: 140px;
}

/* Share */
.sp-share {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.sp-share__label {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #888;
}

.sp-share__links { display: flex; gap: 0.5rem; }

.sp-share__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1.5px solid #eee;
    background: #fff;
    cursor: pointer;
    color: #555;
    text-decoration: none;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.sp-share__btn:hover { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }

/* ============================================================
   ACCORDION
   ============================================================ */

.sp-accordion {
    margin-top: 1.5rem;
    border: 1px solid #eee;
    border-radius: 0;
    overflow: hidden;
}

.sp-accordion__item { border-bottom: 1px solid #eee; }
.sp-accordion__item:last-child { border-bottom: none; }

.sp-accordion__toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 1rem 1.25rem;
    background: none;
    border: none;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--color-black);
    font-family: inherit;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s;
}
.sp-accordion__toggle:hover { background: #fafafa; }

.sp-accordion__chevron {
    transition: transform 0.25s;
    flex-shrink: 0;
}
.sp-accordion__toggle[aria-expanded="false"] .sp-accordion__chevron {
    transform: rotate(180deg);
}

.sp-accordion__body {
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.sp-accordion__content {
    padding: 0.25rem 1.25rem 1.25rem;
    font-size: 0.9rem;
    line-height: 1.7;
    color: #555;
}
.sp-accordion__content p { margin: 0 0 0.75rem; }
.sp-accordion__content p:last-child { margin-bottom: 0; }

/* Attrs table */
.sp-attrs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}
.sp-attrs-table th,
.sp-attrs-table td {
    padding: 0.6rem 1rem;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
}
.sp-attrs-table th {
    width: 35%;
    font-weight: 600;
    color: var(--color-black);
    background: #fafafa;
}
.sp-attrs-table td { color: #555; }

/* Shipping list */
.sp-shipping-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.sp-shipping-list li {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-size: 0.875rem;
    color: #555;
}
.sp-shipping-list svg { color: var(--color-primary); flex-shrink: 0; }

/* ============================================================
   STICKY BAR
   ============================================================ */

.sp-sticky-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid #eee;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
    z-index: 300;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}
.sp-sticky-bar.is-visible {
    transform: translateY(0);
}

.sp-sticky-bar__inner {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 0;
    flex-wrap: wrap;
}

.sp-sticky-bar__img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 0;
    flex-shrink: 0;
}

.sp-sticky-bar__name {
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--color-black);
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.sp-sticky-bar__price {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-primary);
    white-space: nowrap;
}

@media (max-width: 640px) {
    .sp-sticky-bar__img,
    .sp-sticky-bar__name { display: none; }
    .sp-sticky-bar__inner { justify-content: space-between; }
}

/* ============================================================
   TABS SECTION
   ============================================================ */

.sp-tabs-section {
    margin-bottom: 4rem;
    border: 1px solid #eee;
    border-radius: 0;
    overflow: hidden;
}

.sp-tabs {
    display: flex;
    border-bottom: 1px solid #eee;
    background: #fafafa;
}

.sp-tab {
    padding: 1rem 1.5rem;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #888;
    font-family: inherit;
    transition: color 0.15s, border-color 0.15s;
    white-space: nowrap;
}
.sp-tab:hover { color: var(--color-primary); }
.sp-tab--active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
    background: #fff;
}

.sp-tab-panel { display: none; }
.sp-tab-panel--active { display: block; }

.sp-tab-panel__content {
    padding: 2rem;
    font-size: 0.9375rem;
    line-height: 1.75;
    color: #555;
}
.sp-tab-panel__content p { margin: 0 0 1rem; }
.sp-tab-panel__content p:last-child { margin-bottom: 0; }
.sp-tab-panel__content h2,
.sp-tab-panel__content h3 {
    color: var(--color-black);
    font-weight: 700;
    margin: 1.5rem 0 0.75rem;
}

/* ============================================================
   REVIEWS
   ============================================================ */

/* WC comment form overrides */
.sp-tab-panel__content .comment-form-rating { margin-bottom: 1rem; }

.review-stars-input {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    gap: 0.25rem;
    margin: 0.5rem 0 1rem;
}

.review-star-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #ddd;
    padding: 0;
    transition: color 0.15s, transform 0.1s;
    line-height: 1;
}
.review-star-btn:hover,
.review-star-btn.is-active,
.review-stars-input:not(:hover) .review-star-btn[aria-pressed="true"] {
    color: #f59e0b;
}
/* CSS-only hover trick: hover on a star highlights it and all before it */
.review-star-btn:hover ~ .review-star-btn { color: #f59e0b; }

/* Comments list */
.sp-tab-panel__content .commentlist {
    list-style: none;
    padding: 0;
    margin: 0 0 2rem;
}
.sp-tab-panel__content .commentlist .comment {
    padding: 1.25rem 0;
    border-bottom: 1px solid #f0f0f0;
}
.sp-tab-panel__content .commentlist .comment:last-child { border-bottom: none; }
.sp-tab-panel__content .comment-author { font-weight: 600; color: var(--color-black); }
.sp-tab-panel__content .comment-text p { margin: 0.5rem 0 0; font-size: 0.9rem; color: #555; }
.sp-tab-panel__content .review .star-rating { color: #f59e0b; margin-bottom: 0.25rem; }

/* ============================================================
   RELATED & RECENTLY VIEWED
   ============================================================ */

.sp-related,
.sp-recently-viewed {
    margin-bottom: 3rem;
}

/* ============================================================
   LIGHTBOX
   ============================================================ */

.sp-lightbox {
    position: fixed;
    inset: 0;
    z-index: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}
.sp-lightbox.is-open { pointer-events: all; }

.sp-lightbox__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.92);
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s;
}
.sp-lightbox.is-open .sp-lightbox__overlay { opacity: 1; }

.sp-lightbox__inner {
    position: relative;
    display: flex;
    align-items: center;
    gap: 1rem;
    z-index: 1;
    max-width: 90vw;
    max-height: 90vh;
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.3s, transform 0.3s;
}
.sp-lightbox.is-open .sp-lightbox__inner {
    opacity: 1;
    transform: scale(1);
}

.sp-lightbox__img-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
}

.sp-lightbox__img {
    max-width: 80vw;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 0;
    transition: opacity 0.2s;
    display: block;
}

.sp-lightbox__close {
    position: absolute;
    top: -3rem;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 50%;
    cursor: pointer;
    color: #fff;
    transition: background 0.15s;
}
.sp-lightbox__close:hover { background: rgba(255,255,255,0.3); }

.sp-lightbox__nav {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 50%;
    cursor: pointer;
    color: #fff;
    transition: background 0.15s;
    flex-shrink: 0;
}
.sp-lightbox__nav:hover { background: rgba(255,255,255,0.3); }

.sp-lightbox__counter {
    position: absolute;
    bottom: -2.5rem;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,0.7);
    font-size: 0.875rem;
    white-space: nowrap;
}

/* ============================================================
   BTN SIZES
   ============================================================ */

.btn--lg {
    height: 52px;
    padding: 0 2rem;
    font-size: 1rem;
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
    .sp-gallery__main-img,
    .sp-lightbox__inner,
    .sp-lightbox__overlay,
    .sp-sticky-bar,
    .sp-gallery__thumb { transition: none !important; }
}
