/* ==========================================
   Product Detail Page Styles
   ========================================== */

/* Breadcrumb */
.breadcrumb {
    background: var(--bg-light);
    padding: 20px 0;
    margin-bottom: 40px;
}

.breadcrumb .container {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.breadcrumb a {
    color: var(--text-light);
    transition: var(--transition);
}

.breadcrumb a:hover {
    color: var(--primary-color);
}

.breadcrumb span {
    color: var(--text-light);
}

/* Product Detail */
.product-detail {
    padding: 60px 0;
}

.product-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    margin-bottom: 80px;
}

/* Product Gallery */
.product-gallery {
    position: sticky;
    top: 120px;
    height: fit-content;
}

.main-image {
    width: 100%;
    height: 550px;
    background: var(--bg-light);
    border-radius: var(--border-radius);
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: var(--shadow-md);
}

.main-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumbnail-images {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.thumbnail {
    height: 120px;
    background: var(--bg-light);
    border-radius: var(--border-radius);
    overflow: hidden;
    cursor: pointer;
    border: 3px solid transparent;
    transition: var(--transition);
}

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

.thumbnail:hover {
    border-color: var(--primary-light);
    transform: translateY(-2px);
}

.thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Video thumbnail in gallery */
.thumbnail.video-thumb {
    background: #111;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-thumb-icon {
    color: rgba(255,255,255,0.8);
    font-size: 2.2rem;
    transition: var(--transition);
}

.thumbnail.video-thumb:hover .video-thumb-icon,
.thumbnail.video-thumb.active .video-thumb-icon {
    color: var(--primary-color);
    transform: scale(1.1);
}

/* Gallery video fills main-image like the product photo */
.main-image video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Product Details Info */
.product-details-info {
    padding: 20px 0;
}

.product-badge-detail {
    display: inline-block;
    background: var(--primary-color);
    color: var(--text-white);
    padding: 6px 20px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 20px;
}

.product-name {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 20px;
    line-height: 1.2;
}

.product-rating {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
}

.stars {
    color: #FFB800;
    font-size: 1.2rem;
}

.rating-text {
    color: var(--text-light);
    font-weight: 500;
}

.product-short-desc {
    margin-bottom: 35px;
    padding: 25px;
    background: var(--bg-light);
    border-radius: var(--border-radius);
    border-left: 4px solid var(--primary-color);
}

.product-short-desc p {
    color: var(--text-dark);
    line-height: 1.8;
    font-size: 1.05rem;
}

/* Product Options */
.product-option {
    margin-bottom: 35px;
}

.product-option h3 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: var(--text-dark);
}

.color-options {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.color-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
}

.color-option:hover {
    border-color: var(--primary-light);
    transform: translateY(-2px);
}

.color-option.active {
    border-color: var(--primary-color);
    background: rgba(46, 91, 255, 0.05);
}

.color-swatch {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.color-option span {
    font-weight: 600;
    color: var(--text-dark);
}

/* Key Features */
.key-features {
    margin-bottom: 35px;
}

.key-features h3 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: var(--text-dark);
}

.key-features ul {
    list-style: none;
}

.key-features li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    color: var(--text-dark);
    font-size: 1rem;
}

.key-features li i {
    color: var(--primary-color);
    font-size: 1.1rem;
}

/* Product Actions */
.product-actions {
    display: flex;
    gap: 15px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.product-actions .btn {
    flex: 1;
    min-width: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

/* Product Meta */
.product-meta {
    border-top: 1px solid var(--border-color);
    padding-top: 25px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 0;
}

.meta-label {
    font-weight: 600;
    color: var(--text-dark);
    min-width: 80px;
}

.meta-value {
    color: var(--text-light);
}

.share-buttons {
    display: flex;
    gap: 10px;
}

.share-buttons a {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dark);
    transition: var(--transition);
}

.share-buttons a:hover {
    background: var(--primary-color);
    color: var(--text-white);
    transform: translateY(-3px);
}

/* Product Tabs */
.product-tabs {
    margin-bottom: 80px;
}

.tab-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 40px;
    border-bottom: 2px solid var(--border-color);
    flex-wrap: wrap;
}

.tab-btn {
    padding: 15px 30px;
    background: transparent;
    border: none;
    color: var(--text-dark);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
}

.tab-btn:hover {
    color: var(--primary-color);
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-content {
    background: var(--bg-white);
}

.tab-pane {
    display: none;
    animation: fadeIn 0.5s ease;
}

.tab-pane.active {
    display: block;
}

.tab-pane h2 {
    font-size: 2rem;
    margin-bottom: 25px;
    color: var(--text-dark);
}

.tab-pane h3 {
    font-size: 1.5rem;
    margin-top: 30px;
    margin-bottom: 15px;
    color: var(--text-dark);
}

.tab-pane p {
    line-height: 1.8;
    color: var(--text-light);
    margin-bottom: 20px;
}

.product-images-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 40px;
}

.product-images-grid img {
    width: 100%;
    height: 570px;
    object-fit: cover;
    border-radius: var(--border-radius);
}

/* Specifications Table */
.specs-table {
    background: var(--bg-white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.spec-row {
    display: grid;
    grid-template-columns: 1fr 2fr;
    border-bottom: 1px solid var(--border-color);
}

.spec-row:last-child {
    border-bottom: none;
}

.spec-label {
    padding: 20px 25px;
    background: var(--bg-light);
    font-weight: 600;
    color: var(--text-dark);
}

.spec-value {
    padding: 20px 25px;
    color: var(--text-light);
}

/* Features List */
.features-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
    gap: 18px;
}

.feature-item {
    display: flex;
    gap: 16px;
    padding: 20px 22px;
    background: var(--bg-white);
    border-radius: 10px;
    border-left: 4px solid var(--primary-color);
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    transition: var(--transition);
    align-items: flex-start;
}

.feature-item:hover {
    background: var(--bg-white);
    box-shadow: 0 6px 22px rgba(46,91,255,0.13);
    transform: translateY(-3px);
}

.feature-icon {
    width: 48px;
    height: 48px;
    min-width: 48px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-white);
    font-size: 1.2rem;
}

.feature-content h3 {
    font-size: 1.05rem;
    margin: 0 0 6px 0;
    color: var(--text-dark);
    font-weight: 700;
    line-height: 1.4;
}

.feature-content p {
    margin: 0;
    line-height: 1.7;
    font-size: 0.9rem;
    color: #666;
}

/* Download Section */
.download-section {
    display: grid;
    gap: 25px;
    margin-top: 30px;
}

.download-item {
    display: flex;
    align-items: center;
    gap: 25px;
    padding: 30px;
    background: var(--bg-light);
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.download-item:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-5px);
}

.download-icon {
    width: 70px;
    height: 70px;
    min-width: 70px;
    background: var(--primary-color);
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-white);
    font-size: 2rem;
}

.download-info {
    flex: 1;
}

.download-info h3 {
    font-size: 1.2rem;
    margin: 0 0 8px 0;
    color: var(--text-dark);
}

.download-info p {
    margin: 0 0 8px 0;
    font-size: 0.95rem;
}

.file-size {
    font-size: 0.85rem;
    color: var(--text-light);
}

/* ==========================================
   Video Tab
   ========================================== */
.video-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    padding: 10px 0 30px;
}

.video-aspect-btns {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.aspect-btn {
    padding: 8px 22px;
    border: 2px solid var(--border-color);
    border-radius: 20px;
    background: transparent;
    color: var(--text-dark);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
}

.aspect-btn:hover {
    border-color: var(--primary-light);
    color: var(--primary-color);
}

.aspect-btn.active {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(46, 91, 255, 0.06);
}

.video-player-wrap {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.video-player-wrap video {
    max-height: 72vh;
    max-width: 100%;
    width: auto;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    background: #000;
    display: block;
}

/* For portrait / tall aspect ratios, constrain width on desktop */
@media (min-width: 768px) {
    .video-player-wrap[data-aspect="3:4"] video  { max-width: 50%; }
    .video-player-wrap[data-aspect="9:16"] video { max-width: 36%; }
    .video-player-wrap[data-aspect="1:1"] video  { max-width: 65%; }
}

.video-loading {
    color: var(--text-light);
    font-size: 0.95rem;
    margin-top: 8px;
    text-align: center;
}

/* Related Products */
.related-products {
    margin-top: 80px;
}

.related-products .section-title {
    text-align: center;
    margin-bottom: 50px;
}

.related-products .products-grid,
.related-products-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 320px));
    gap: 30px;
    justify-content: center;
}

/* Responsive */
@media (max-width: 968px) {
    .product-layout {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .product-gallery {
        position: static;
    }

    .main-image {
        height: 400px;
    }

    .thumbnail-images {
        grid-template-columns: repeat(4, 1fr);
    }

    .product-name {
        font-size: 2rem;
    }

    .tab-buttons {
        overflow-x: auto;
        flex-wrap: nowrap;
    }

    .tab-btn {
        white-space: nowrap;
    }

    .product-images-grid {
        grid-template-columns: 1fr;
    }

    .spec-row {
        grid-template-columns: 1fr;
    }

    .feature-item {
        flex-direction: column;
    }

    .download-item {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 576px) {
    .main-image {
        height: 320px;
    }

    .thumbnail {
        height: 80px;
    }

    .product-name {
        font-size: 1.6rem;
    }

    .product-actions {
        flex-direction: column;
    }

    .product-actions .btn {
        width: 100%;
    }

    .color-options {
        flex-direction: column;
    }

    .color-option {
        width: 100%;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================
   Product Detail Images (vertical)
   ========================================== */
.product-detail-images {
    margin-bottom: 80px;
}

.product-detail-images .section-title {
    text-align: center;
    margin-bottom: 40px;
}

.detail-images-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 860px;
    margin: 0 auto;
}

.detail-images-grid img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
}

/* ==========================================
   Related Products Cards
   ========================================== */
.related-products .product-card {
    background: var(--bg-white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.related-products .product-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-8px);
}

.related-products .product-image {
    position: relative;
    width: 100%;
    height: 280px;
    background: var(--bg-light);
    overflow: hidden;
}

.related-products .product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.related-products .product-card:hover .product-image img {
    transform: scale(1.08);
}

.related-products .product-info {
    padding: 25px;
}

.related-products .product-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 15px;
}

.related-products .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Key Features Side-by-Side Layout */
.key-features-wrapper {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    margin-bottom: 35px;
}

.key-features-wrapper .key-features {
    flex: 1;
    min-width: 0;
    margin-bottom: 0;
}

.product-highlight-copy {
    flex: 1;
    min-width: 0;
    padding: 16px 18px;
    border-radius: 0 8px 8px 0;
    border-left-width: 3px;
    border-left-style: solid;
    box-shadow: 0 2px 10px rgba(0,0,0,0.07);
}

.product-highlight-copy h4 {
    margin: 0 0 10px;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.4;
}

.product-highlight-copy p {
    margin: 0;
    font-size: 0.88rem;
    line-height: 1.8;
    color: #555;
}

@media (max-width: 900px) {
    .key-features-wrapper {
        flex-direction: column;
    }
    .product-highlight-copy {
        border-left-width: 3px;
        border-radius: 0 0 8px 8px;
        border-top: none;
    }
}
