/* Product detail: cleaner marketplace layout */

.item-detail-page {
    padding: 1.25rem 0 2.5rem;
}

.detail-panel {
    padding: 0;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}

.item-detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.92fr);
    gap: 1.1rem;
    align-items: start;
}

.item-gallery,
.price-card,
.maker-card,
.detail-block,
.seller-card,
.review-card,
.review-form-card,
.detail-section {
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(18, 28, 39, 0.1);
    border-radius: 8px;
    box-shadow: 0 14px 34px rgba(18, 28, 39, 0.08);
}

.item-gallery {
    padding: 0.75rem;
    position: sticky;
    top: 92px;
}

.gallery-main {
    position: relative;
    aspect-ratio: 1 / 1;
    border-radius: 6px;
    overflow: hidden;
    background: #f3f5f7;
    box-shadow: inset 0 0 0 1px rgba(18, 28, 39, 0.04);
}

.gallery-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.22s ease;
}

.gallery-slide.active {
    opacity: 1;
}

.gallery-main-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    cursor: zoom-in;
}

.gallery-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ink-muted);
}

.gallery-thumbnails {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
    gap: 0.55rem;
    margin-top: 0.7rem;
}

.gallery-thumbnail {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 6px;
    border: 2px solid transparent;
    cursor: pointer;
    opacity: 0.68;
    background: #f3f5f7;
}

.gallery-thumbnail.active {
    border-color: var(--primary-color);
    opacity: 1;
}

.gallery-nav,
.lightbox-nav,
.lightbox-close {
    border: none;
    cursor: pointer;
}

.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.72);
    color: #fff;
    font-size: 1.35rem;
}

.gallery-prev {
    left: 10px;
}

.gallery-next {
    right: 10px;
}

.gallery-counter {
    position: absolute;
    right: 10px;
    bottom: 10px;
    padding: 0.3rem 0.62rem;
    border-radius: 6px;
    background: rgba(15, 23, 42, 0.72);
    color: #fff;
    font-size: 0.88rem;
    font-weight: 700;
}

.item-info {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.item-title,
.item-info h3,
.section-head h2,
.review-card h4,
.seller-info h4,
.detail-section .item-title {
    font-family: 'Manrope', 'Segoe UI', sans-serif;
    letter-spacing: 0;
}

.item-info > .item-title {
    display: block;
    overflow: visible;
    -webkit-line-clamp: unset;
    -webkit-box-orient: initial;
    margin: 0;
    color: #162436;
    font-size: clamp(2rem, 3.5vw, 2.85rem);
    font-weight: 800;
    line-height: 1.08;
    text-wrap: balance;
}

.item-badges,
.item-meta-line,
.tags-row,
.seller-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.item-badges {
    justify-content: flex-end;
}

.item-badges .item-badge,
.item-badges .item-type-badge {
    position: static;
}

.item-meta-line {
    color: var(--ink-muted);
    font-size: 0.93rem;
}

.item-meta-line span,
.seller-info p {
    color: var(--ink-muted);
}

.item-badge,
.status-pill,
.rating-badge,
.item-type-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.34rem 0.62rem;
    border-radius: 6px;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0;
}

.item-badge,
.rating-badge,
.status-pill.active {
    background: rgba(23, 52, 75, 0.1);
    color: var(--primary-color);
}

.status-pill.muted {
    background: rgba(17, 24, 39, 0.08);
    color: var(--ink-muted);
}

.price-card,
.maker-card,
.detail-block,
.review-form-card,
.detail-section {
    padding: 1.05rem;
}

.price-card {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: start;
}

.price-amount {
    color: #17344b;
    font-family: 'Manrope', 'Segoe UI', sans-serif;
    font-size: clamp(2.15rem, 4vw, 3.2rem);
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0;
}

.price-amount span {
    margin-left: 0.25rem;
    font-size: 1rem;
    color: var(--ink-muted);
    font-weight: 700;
}

.price-text {
    color: #17344b;
    font-size: 1.32rem;
    font-weight: 800;
}

.item-actions {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    align-items: stretch;
}

.maker-card-head,
.section-head,
.review-top {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: start;
}

.section-kicker {
    color: var(--ink-muted);
    font-family: 'Manrope', 'Segoe UI', sans-serif;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0;
}

.maker-card h3,
.detail-block h3 {
    margin: 0;
    color: #162436;
    font-size: 1.05rem;
    font-weight: 800;
}

.maker-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
    margin-top: 0.85rem;
}

.maker-metric {
    padding: 0.78rem 0.85rem;
    border-radius: 8px;
    background: #f8fafc;
    border: 1px solid rgba(31, 41, 51, 0.08);
}

.maker-metric strong {
    display: block;
    margin-bottom: 0.25rem;
    color: #202a36;
}

.maker-metric span,
.maker-copy,
.owner-note,
.rich-copy p,
.review-notice {
    color: var(--ink-muted);
}

.maker-metric.wide {
    grid-column: 1 / -1;
}

.owner-actions {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 0.85rem;
}

.owner-note {
    padding: 1rem;
    border: 1px solid rgba(18, 28, 39, 0.08);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.72);
}

.tags-row .tag {
    padding: 0.4rem 0.65rem;
    border-radius: 6px;
    background: rgba(23, 52, 75, 0.06);
    color: #17344b;
    text-decoration: none;
    font-weight: 700;
}

.seller-card {
    display: grid;
    grid-template-columns: 72px 1fr auto;
    gap: 1rem;
    align-items: center;
    padding: 1rem;
}

.seller-avatar,
.seller-avatar-placeholder,
.author-avatar {
    width: 72px;
    height: 72px;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: #fff;
    font-weight: 800;
}

.seller-avatar img,
.author-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.seller-links a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 800;
}

.detail-section {
    margin-top: 1rem;
}

.detail-section .items-grid {
    gap: 0.85rem;
}

.detail-section .item-card {
    border-radius: 8px;
    box-shadow: none;
}

.detail-section .item-image-wrapper {
    aspect-ratio: 1 / 1;
    padding-top: 0;
    background: #f3f5f7;
}

.detail-section .item-content {
    padding: 0.85rem;
}

.review-form-card {
    margin-bottom: 1rem;
}

.star-rating-input {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    gap: 0.25rem;
}

.star-rating-input input {
    display: none;
}

.star-rating-input label {
    color: #d1d5db;
    cursor: pointer;
    font-size: 2rem;
}

.star-rating-input input:checked ~ label,
.star-rating-input label:hover,
.star-rating-input label:hover ~ label {
    color: #f59e0b;
}

.reviews-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.review-card {
    padding: 1rem;
    box-shadow: none;
}

.review-author {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.author-avatar {
    width: 48px;
    height: 48px;
}

.review-rating {
    color: #f59e0b;
}

.verified-purchase-badge {
    display: inline-flex;
    margin-top: 0.7rem;
    padding: 0.3rem 0.65rem;
    border-radius: 6px;
    background: rgba(15, 118, 110, 0.12);
    color: #0f766e;
    font-weight: 800;
    font-size: 0.82rem;
}

.lightbox-modal {
    position: fixed;
    inset: 0;
    background: rgba(8, 10, 14, 0.88);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1200;
}

.lightbox-modal.active {
    display: flex;
}

.lightbox-content {
    position: relative;
    max-width: min(92vw, 1200px);
    max-height: 90vh;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 82vh;
    object-fit: contain;
    border-radius: 8px;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    font-size: 1.5rem;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    font-size: 1.5rem;
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

.lightbox-counter {
    margin-top: 0.8rem;
    text-align: center;
    color: #fff;
}

@media (max-width: 980px) {
    .item-detail-grid,
    .price-card,
    .owner-actions,
    .seller-card,
    .maker-grid {
        display: grid;
        grid-template-columns: 1fr;
    }

    .item-gallery {
        position: static;
    }

    .maker-metric.wide {
        grid-column: auto;
    }
}

@media (max-width: 720px) {
    .item-detail-page {
        padding-top: 0.75rem;
    }

    .detail-panel {
        width: calc(100% - 24px);
    }

    .maker-card-head,
    .section-head,
    .review-top {
        display: grid;
        grid-template-columns: 1fr;
    }

    .item-info > .item-title {
        font-size: 1.8rem;
    }

    .seller-card {
        text-align: center;
    }

    .seller-avatar {
        margin: 0 auto;
    }
}
