﻿.product-detail-page {
    min-height: 60vh;
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

.product-detail-container {
    background: linear-gradient(145deg, #1a1a2e, #16213e);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 100px 20px;
    color: #888;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(76, 175, 80, 0.2);
    border-top-color: #4CAF50;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.product-main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 40px;
    row-gap: 20px;
    padding: 40px;
    align-items: start;
}

.product-gallery {
    position: relative;
    grid-column: 1;
    grid-row: 1 / 12;
    align-self: start;
}

.main-image {
    width: 100%;
    max-height: 500px;
    object-fit: contain;
    border-radius: 12px;
    background: #0d0d15;
    cursor: zoom-in;
    transition: transform 0.3s ease;
}

.main-image:hover {
    transform: scale(1.02);
}

.badges {
    position: absolute;
    top: 15px;
    left: 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.badge {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    background: #4CAF50;
    color: white;
}

.product-info,
.product-info-description-area {
    display: contents;
}

.product-info > *:not(.product-description):not(.product-features):not(.product-info-description-area) {
    grid-column: 2;
    min-width: 0;
}

.provider-badge {
    display: inline-block;
    padding: 8px 16px;
    background: linear-gradient(135deg, #4CAF50, #2e7d32);
    color: white;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    width: fit-content;
}

.product-info h1 {
    font-size: 32px;
    color: #fff;
    margin: 0;
    line-height: 1.2;
}

.category {
    color: #888;
    font-size: 14px;
    margin: 0;
}

.price-stock-row {
    display: flex;
    align-items: stretch;
    justify-content: center;
    gap: 12px;
    width: 100%;
}

.price-stock-row .price-box,
.price-stock-row .stock-info {
    flex: 0 1 auto;
    width: fit-content;
}

.price-box {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding: 12px 20px;
    background: rgba(76, 175, 80, 0.1);
    border-radius: 12px;
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.price {
    font-size: 32px;
    font-weight: 700;
    color: #4CAF50;
}

.compare-price {
    font-size: 18px;
    color: #888;
    text-decoration: line-through;
}

.discount-badge {
    padding: 6px 12px;
    background: #f44336;
    color: white;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 700;
}

.stock-info {
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
}

.stock-info.in-stock {
    background: rgba(76, 175, 80, 0.15);
    color: #4CAF50;
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.stock-info.out-of-stock {
    background: rgba(244, 67, 54, 0.15);
    color: #f44336;
    border: 1px solid rgba(244, 67, 54, 0.3);
}

.product-actions {
    display: grid;
    grid-template-columns: 1fr 160px;
    grid-template-rows: 48px 48px;
    gap: 12px;
}

.quantity-selector {
    grid-column: 1;
    grid-row: 1;
    display: flex;
    align-items: stretch;
    background: #0d0d15;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    height: 48px;
}

.qty-btn {
    width: 48px;
    height: 48px;
    border: none;
    background: transparent;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.qty-btn:hover {
    background: rgba(76, 175, 80, 0.2);
}

.quantity-selector input {
    flex: 1;
    height: 48px;
    border: none;
    background: transparent;
    color: #fff;
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    min-width: 0;
}

.btn-share {
    grid-column: 2;
    grid-row: 1;
    height: 48px;
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-add-cart {
    grid-column: 1;
    grid-row: 2;
    height: 48px;
    background: linear-gradient(135deg, #4CAF50, #2e7d32);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-add-cart:disabled {
    background: #555;
    cursor: not-allowed;
}

.btn-wishlist {
    grid-column: 2;
    grid-row: 2;
    height: 48px;
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-wishlist.active {
    background: rgba(244, 67, 54, 0.3);
    border-color: #f44336;
    color: #f44336;
}

.product-description,
.product-features {
    grid-row: 13;
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    min-width: 0;
    text-align: center;
    box-sizing: border-box;
}

.product-description {
    grid-column: 1;
}

.product-features {
    grid-column: 2;
}

.product-description h3,
.product-features h3 {
    color: #4CAF50;
    margin: 0 0 15px;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.product-description p,
.product-features div {
    color: #ccc;
    line-height: 1.7;
    margin: 0;
    text-align: center;
}

.product-meta {
    padding: 15px 20px;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    text-align: center;
}

.product-meta p {
    margin: 0;
    color: #888;
    font-size: 14px;
}

.product-meta strong {
    color: #aaa;
}

.error-state {
    text-align: center;
    padding: 80px 20px;
}

.error-state h2 {
    font-size: 36px;
    color: #fff;
    margin: 0 0 15px;
}

.error-state p {
    color: #888;
    margin: 0 0 30px;
}

.btn-back {
    display: inline-block;
    padding: 15px 30px;
    background: #4CAF50;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
}

.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
}

.lightbox.active {
    opacity: 1;
    visibility: visible;
}

.lightbox img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 40px;
    color: white;
    background: none;
    border: none;
    cursor: pointer;
}

.lightbox-hint {
    position: absolute;
    bottom: 30px;
    color: #888;
}

.reviews-section {
    max-width: 900px;
    margin: 60px auto;
    padding: 0 20px;
}

.reviews-wrapper {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 40px;
}

.reviews-title {
    font-size: 1.8rem;
    color: var(--text-primary);
    margin-bottom: 20px;
    text-transform: uppercase;
}

.reviews-summary {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 30px;
}

.reviews-average {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.reviews-count,
.no-reviews,
.reviews-loading,
.review-notice {
    color: var(--text-muted);
}

.reviews-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 40px;
}

.review-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
}

.review-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.review-author,
.review-title {
    color: var(--text-primary);
}

.verified-badge {
    background: rgba(0, 200, 100, 0.1);
    border: 1px solid rgba(0, 200, 100, 0.3);
    color: #00c864;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 20px;
}

.review-date {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-left: auto;
}

.review-comment {
    color: var(--text-secondary);
    line-height: 1.6;
}

.review-form-wrapper {
    border-top: 1px solid var(--border-color);
    padding-top: 30px;
    margin-top: 30px;
}

.review-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group input,
.form-group textarea {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    color: var(--text-primary);
    font-family: inherit;
}

.star-selector {
    display: flex;
    gap: 6px;
    font-size: 1.5rem;
}

.btn-submit-review {
    background: var(--gradient-primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    padding: 12px 24px;
    cursor: pointer;
    align-self: flex-start;
}

.review-success { color: #00c864; }
.review-error { color: #ff4444; }

.qty-input-no-arrows::-webkit-outer-spin-button,
.qty-input-no-arrows::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.qty-input-no-arrows {
    -moz-appearance: textfield;
    text-align: center;
}

.product-blockchain-verify {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    margin-top: 8px;
    padding: 14px 18px;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.08), rgba(0, 150, 255, 0.04));
    border: 1px solid rgba(0, 212, 255, 0.35);
    border-radius: 12px;
}

.pbv-icon {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #00d4ff;
    border: 1px solid rgba(0, 212, 255, 0.35);
    border-radius: 50%;
}

.pbv-text {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.pbv-title {
    color: #00d4ff;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.pbv-sub {
    color: var(--text-muted);
    font-size: 0.78rem;
}

.pbv-btn {
    color: #00d4ff;
    border: 1px solid rgba(0, 212, 255, 0.45);
    border-radius: 50px;
    padding: 10px 22px;
    text-decoration: none;
    text-transform: uppercase;
    white-space: nowrap;
}

@media (max-width: 900px) {
    .product-main {
        display: block;
        padding: 20px;
    }

    .product-info,
    .product-info-description-area {
        display: flex;
        flex-direction: column;
        gap: 16px;
    }

    .product-gallery,
    .product-description,
    .product-features,
    .product-info > * {
        grid-column: auto;
        grid-row: auto;
    }
}

@media (max-width: 768px) {
    .product-info h1 { font-size: 24px; }
    .price { font-size: 28px; }
    .product-actions {
        grid-template-columns: 1fr 140px;
    }
    .price-stock-row {
        flex-wrap: wrap;
    }
    .price-stock-row .price-box,
    .price-stock-row .stock-info {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .product-actions {
        grid-template-columns: 1fr;
        grid-template-rows: repeat(4, 48px);
    }
    .quantity-selector,
    .btn-share,
    .btn-add-cart,
    .btn-wishlist {
        grid-column: 1;
        width: 100%;
    }
    .quantity-selector { grid-row: 1; }
    .btn-share { grid-row: 2; }
    .btn-add-cart { grid-row: 3; }
    .btn-wishlist { grid-row: 4; }
    .price-stock-row {
        flex-direction: column;
    }
    .product-blockchain-verify {
        flex-wrap: wrap;
        justify-content: center;
        text-align: center;
    }
    .pbv-btn { width: 100%; }
}