/**
 * Product Detail Page CSS
 * Superindo Taiwan - Clean & Modern
 * Desktop-First Responsive
 */

/* === Layout === */
#product-detail-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 1.5rem 2rem;
}

/* === Breadcrumb === */
#product-detail-page .breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: var(--gray-500);
    margin-bottom: 1.5rem;
}

#product-detail-page .breadcrumb a {
    color: var(--gray-500);
    text-decoration: none;
    transition: color 0.2s;
}

#product-detail-page .breadcrumb a:hover {
    color: var(--primary);
}

#product-detail-page .breadcrumb i {
    font-size: 0.625rem;
    color: var(--gray-300);
}

#product-detail-page .breadcrumb span {
    color: var(--gray-700);
}

/* === Main Product Section === */
#product-detail-page .product-main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
    margin-bottom: 2rem;
}

/* === Gallery === */
#product-detail-page .product-gallery {
    position: sticky;
    top: 100px;
    align-self: flex-start;
}

#product-detail-page .gallery-main {
    position: relative;
    aspect-ratio: 1;
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 0.75rem;
    border: 1px solid var(--gray-100);
}

#product-detail-page .gallery-main img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

#product-detail-page .gallery-main .discount-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: var(--primary);
    color: white;
    font-size: 0.875rem;
    font-weight: 700;
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-full);
}

#product-detail-page .gallery-thumbs {
    display: flex;
    gap: 0.5rem;
}

#product-detail-page .gallery-thumbs .thumb {
    width: 72px;
    height: 72px;
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    border: 2px solid var(--gray-200);
    transition: all 0.2s;
    background: var(--white);
}

#product-detail-page .gallery-thumbs .thumb:hover {
    border-color: var(--gray-400);
}

#product-detail-page .gallery-thumbs .thumb.active {
    border-color: var(--primary);
}

#product-detail-page .gallery-thumbs .thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* === Product Info === */
#product-detail-page .product-info {
    padding: 0.5rem 0;
}

#product-detail-page .product-brand {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

#product-detail-page .product-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-800);
    line-height: 1.3;
    margin: 0 0 0.75rem;
}

#product-detail-page .product-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
    margin-bottom: 1.25rem;
}

#product-detail-page .product-meta .rating {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

#product-detail-page .product-meta .rating i {
    color: var(--secondary);
}

#product-detail-page .product-meta .rating-value {
    font-weight: 600;
    color: var(--gray-800);
}

#product-detail-page .product-meta .rating-count {
    color: var(--gray-500);
}

#product-detail-page .product-meta .divider {
    color: var(--gray-300);
}

#product-detail-page .product-meta .sold {
    color: var(--gray-500);
}

/* === Price === */
#product-detail-page .product-price {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--primary-light);
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
}

#product-detail-page .product-price .price-current {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary);
}

#product-detail-page .product-price .price-old {
    font-size: 1rem;
    color: var(--gray-400);
    text-decoration: line-through;
}

#product-detail-page .product-price .price-discount {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--primary);
    background: white;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
}

/* === Variants === */
#product-detail-page .product-variants {
    margin-bottom: 1.5rem;
}

#product-detail-page .variant-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 0.625rem;
}

#product-detail-page .variant-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

#product-detail-page .variant-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.875rem;
    background: var(--white);
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
}

#product-detail-page .variant-btn:hover {
    border-color: var(--primary);
}

#product-detail-page .variant-btn.active {
    border-color: var(--primary);
    background: var(--primary-light);
}

#product-detail-page .variant-btn .variant-color {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1px solid var(--gray-200);
}

#product-detail-page .variant-btn .variant-name {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--gray-700);
}

#product-detail-page .variant-btn .variant-stock {
    font-size: 0.6875rem;
    color: var(--primary);
}

#product-detail-page .variant-btn.low-stock {
    background: #fff5f5;
}

/* === Quantity === */
#product-detail-page .product-quantity {
    margin-bottom: 1.5rem;
}

#product-detail-page .qty-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 0.625rem;
}

#product-detail-page .qty-wrapper {
    display: flex;
    align-items: center;
    gap: 1rem;
}

#product-detail-page .qty-control {
    display: flex;
    align-items: center;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius);
    overflow: hidden;
}

#product-detail-page .qty-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-50);
    border: none;
    cursor: pointer;
    color: var(--gray-600);
    transition: all 0.2s;
}

#product-detail-page .qty-btn:hover {
    background: var(--gray-100);
    color: var(--primary);
}

#product-detail-page .qty-input {
    width: 60px;
    height: 40px;
    border: none;
    text-align: center;
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-800);
    -moz-appearance: textfield;
}

#product-detail-page .qty-input::-webkit-outer-spin-button,
#product-detail-page .qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

#product-detail-page .stock-info {
    font-size: 0.875rem;
    color: var(--gray-500);
}

#product-detail-page .stock-info strong {
    color: var(--gray-700);
}

/* === Action Buttons === */
#product-detail-page .product-actions {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

#product-detail-page .btn-cart,
#product-detail-page .btn-buy {
    flex: 1;
    padding: 0.875rem 1.5rem;
    font-size: 0.9375rem;
    font-weight: 600;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

#product-detail-page .btn-cart {
    background: var(--white);
    border: 2px solid var(--primary);
    color: var(--primary);
}

#product-detail-page .btn-cart:hover {
    background: var(--primary-light);
}

#product-detail-page .btn-buy {
    background: var(--primary);
    border: 2px solid var(--primary);
    color: white;
}

#product-detail-page .btn-buy:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

/* === Quick Info === */
#product-detail-page .quick-info {
    display: flex;
    gap: 1.5rem;
    padding: 1rem;
    background: var(--gray-50);
    border-radius: var(--radius);
}

#product-detail-page .quick-info .info-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: var(--gray-600);
}

#product-detail-page .quick-info .info-item i {
    color: var(--primary);
}

/* === Product Details / Tabs === */
#product-detail-page .product-details {
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-100);
    margin-bottom: 2rem;
    overflow: hidden;
}

#product-detail-page .tabs {
    display: flex;
    border-bottom: 1px solid var(--gray-100);
}

#product-detail-page .tab-btn {
    padding: 1rem 1.5rem;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--gray-500);
    background: transparent;
    border: none;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
}

#product-detail-page .tab-btn:hover {
    color: var(--gray-700);
}

#product-detail-page .tab-btn.active {
    color: var(--primary);
}

#product-detail-page .tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary);
}

#product-detail-page .tab-content {
    padding: 1.5rem;
}

#product-detail-page .tab-panel {
    display: none;
}

#product-detail-page .tab-panel.active {
    display: block;
}

/* Description Tab */
#product-detail-page .description-text {
    font-size: 0.9375rem;
    line-height: 1.7;
    color: var(--gray-600);
    margin-bottom: 1.25rem;
}

#product-detail-page .tab-panel h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 0.75rem;
}

#product-detail-page .features-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

#product-detail-page .features-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--gray-600);
}

#product-detail-page .features-list li i {
    color: var(--success);
    margin-top: 0.125rem;
}

/* Specifications Tab */
#product-detail-page .specs-table {
    width: 100%;
    border-collapse: collapse;
}

#product-detail-page .specs-table tr:nth-child(even) {
    background: var(--gray-50);
}

#product-detail-page .specs-table td {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
}

#product-detail-page .specs-table .spec-label {
    width: 40%;
    color: var(--gray-500);
    font-weight: 500;
}

#product-detail-page .specs-table .spec-value {
    color: var(--gray-700);
}

/* Reviews Tab */
#product-detail-page .reviews-summary {
    text-align: center;
    padding: 1.5rem;
    background: var(--gray-50);
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
}

#product-detail-page .rating-big .rating-number {
    font-size: 3rem;
    font-weight: 700;
    color: var(--gray-800);
}

#product-detail-page .rating-big .rating-stars {
    display: flex;
    justify-content: center;
    gap: 0.25rem;
    margin: 0.5rem 0;
}

#product-detail-page .rating-big .rating-stars i {
    font-size: 1.25rem;
    color: var(--secondary);
}

#product-detail-page .rating-big .rating-stars i.empty {
    color: var(--gray-200);
}

#product-detail-page .rating-big .rating-total {
    font-size: 0.875rem;
    color: var(--gray-500);
}

#product-detail-page .reviews-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

#product-detail-page .review-item {
    padding: 1rem;
    background: var(--gray-50);
    border-radius: var(--radius);
}

#product-detail-page .review-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

#product-detail-page .reviewer-avatar {
    width: 40px;
    height: 40px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

#product-detail-page .reviewer-info {
    flex: 1;
}

#product-detail-page .reviewer-name {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-800);
}

#product-detail-page .review-date {
    font-size: 0.75rem;
    color: var(--gray-400);
}

#product-detail-page .review-rating i {
    font-size: 0.75rem;
    color: var(--secondary);
}

#product-detail-page .review-rating i.empty {
    color: var(--gray-200);
}

#product-detail-page .review-text {
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--gray-600);
    margin: 0;
}

/* === Related Products === */
#product-detail-page .related-products {
    margin-bottom: 2rem;
}

#product-detail-page .section-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--gray-800);
    margin: 0 0 1rem;
}

#product-detail-page .products-scroll {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 1rem;
}

/* Product Card (same as product page) */
#product-detail-page .product-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--gray-100);
    display: flex;
    flex-direction: column;
    transition: all 0.2s;
}

#product-detail-page .product-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

#product-detail-page .product-card .image {
    aspect-ratio: 1;
    position: relative;
    background: var(--gray-50);
    overflow: hidden;
}

#product-detail-page .product-card .image a {
    display: block;
    width: 100%;
    height: 100%;
}

#product-detail-page .product-card .image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

#product-detail-page .product-card:hover .image img {
    transform: scale(1.05);
}

#product-detail-page .product-card .badge {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    background: var(--primary);
    color: white;
    font-size: 0.625rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-full);
}

#product-detail-page .product-card .badge.top {
    background: var(--secondary);
    color: var(--gray-800);
}

#product-detail-page .product-card .info {
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

#product-detail-page .product-card .name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#product-detail-page .product-card .price-action {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-top: auto;
    gap: 0.5rem;
}

#product-detail-page .product-card .price-group {
    display: flex;
    flex-direction: column;
}

#product-detail-page .product-card .price-old {
    font-size: 0.625rem;
    color: var(--gray-400);
    text-decoration: line-through;
}

#product-detail-page .product-card .price-current {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--primary);
}

#product-detail-page .product-card .btn-buy {
    padding: 0.4rem 0.75rem;
    background: var(--primary);
    border: none;
    border-radius: var(--radius);
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
}

#product-detail-page .product-card .btn-buy:hover {
    background: var(--primary-dark);
}

/* === Mobile Bottom Bar === */
.mobile-bottom-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--white);
    padding: 0.75rem 1rem;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
    gap: 0.5rem;
}

.mobile-bottom-bar .btn-chat,
.mobile-bottom-bar .btn-wishlist {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--white);
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius);
    color: var(--gray-600);
    font-size: 1.125rem;
    cursor: pointer;
}

.mobile-bottom-bar .btn-add-cart {
    flex: 1;
    padding: 0.75rem;
    background: var(--white);
    border: 2px solid var(--primary);
    border-radius: var(--radius);
    color: var(--primary);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
}

.mobile-bottom-bar .btn-buy-now {
    flex: 1;
    padding: 0.75rem;
    background: var(--primary);
    border: 2px solid var(--primary);
    border-radius: var(--radius);
    color: white;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
}

/* ============================================
   RESPONSIVE - Desktop First
   ============================================ */

/* < 1280px */
@media (max-width: 1279px) {
    #product-detail-page .products-scroll {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* < 1024px */
@media (max-width: 1023px) {
    #product-detail-page .product-main {
        gap: 2rem;
    }
    
    #product-detail-page .product-name {
        font-size: 1.25rem;
    }
    
    #product-detail-page .products-scroll {
        grid-template-columns: repeat(4, 1fr);
    }
    
    #product-detail-page .features-list {
        grid-template-columns: 1fr;
    }
}

/* < 768px (Tablet) */
@media (max-width: 767px) {
    #product-detail-page {
        padding: 1rem;
        padding-bottom: 5rem;
    }
    
    #product-detail-page .breadcrumb {
        font-size: 0.75rem;
        margin-bottom: 1rem;
    }
    
    #product-detail-page .product-main {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        margin-top:15px;
    }
    
    #product-detail-page .product-gallery {
        position: relative;
        top: 0;
    }
    
    #product-detail-page .gallery-thumbs .thumb {
        width: 60px;
        height: 60px;
    }
    
    #product-detail-page .product-name {
        font-size: 1.125rem;
    }
    
    #product-detail-page .product-price .price-current {
        font-size: 1.5rem;
    }
    
    #product-detail-page .product-actions {
        display: none;
    }
    
    #product-detail-page .quick-info {
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    #product-detail-page .quick-info .info-item {
        width: calc(50% - 0.5rem);
    }
    
    #product-detail-page .tabs {
        overflow-x: auto;
        scrollbar-width: none;
    }
    
    #product-detail-page .tabs::-webkit-scrollbar {
        display: none;
    }
    
    #product-detail-page .tab-btn {
        padding: 0.875rem 1.25rem;
        white-space: nowrap;
    }
    
    #product-detail-page .tab-content {
        padding: 1.25rem;
    }
    
    #product-detail-page .products-scroll {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.75rem;
    }
    
    .mobile-bottom-bar {
        display: flex;
    }
    
    /* Hide desktop bottom nav */
    .bottom-nav {
        display: none;
    }
}

/* < 576px (Mobile) */
@media (max-width: 575px) {
    #product-detail-page {
        padding: 0.75rem;
        padding-bottom: 5rem;
    }
    
    #product-detail-page .breadcrumb {
        display: none;
    }
    
    #product-detail-page .gallery-main .discount-badge {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }
    
    #product-detail-page .gallery-thumbs .thumb {
        width: 52px;
        height: 52px;
    }
    
    #product-detail-page .product-brand {
        font-size: 0.8125rem;
    }
    
    #product-detail-page .product-name {
        font-size: 1rem;
    }
    
    #product-detail-page .product-meta {
        font-size: 0.8125rem;
        flex-wrap: wrap;
    }
    
    #product-detail-page .product-price {
        padding: 0.75rem;
    }
    
    #product-detail-page .product-price .price-current {
        font-size: 1.375rem;
    }
    
    #product-detail-page .variant-btn {
        padding: 0.4rem 0.75rem;
    }
    
    #product-detail-page .variant-btn .variant-name {
        font-size: 0.75rem;
    }
    
    #product-detail-page .qty-btn {
        width: 36px;
        height: 36px;
    }
    
    #product-detail-page .qty-input {
        width: 50px;
        height: 36px;
    }
    
    #product-detail-page .quick-info {
        padding: 0.75rem;
        gap: 0.75rem;
    }
    
    #product-detail-page .quick-info .info-item {
        font-size: 0.75rem;
    }
    
    #product-detail-page .tab-btn {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }
    
    #product-detail-page .tab-content {
        padding: 1rem;
    }
    
    #product-detail-page .specs-table td {
        padding: 0.625rem 0.75rem;
        font-size: 0.8125rem;
    }
    
    #product-detail-page .section-title {
        font-size: 1rem;
    }
    
    #product-detail-page .products-scroll {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
    
    #product-detail-page .product-card .info {
        padding: 0.5rem;
    }
    
    #product-detail-page .product-card .name {
        font-size: 0.6875rem;
    }
    
    #product-detail-page .product-card .price-current {
        font-size: 0.75rem;
    }
    
    #product-detail-page .product-card .btn-buy {
        padding: 0.3rem 0.5rem;
        font-size: 0.625rem;
    }
    
    .mobile-bottom-bar {
        padding: 0.625rem 0.75rem;
    }
    
    .mobile-bottom-bar .btn-chat,
    .mobile-bottom-bar .btn-wishlist {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .mobile-bottom-bar .btn-add-cart,
    .mobile-bottom-bar .btn-buy-now {
        padding: 0.625rem;
        font-size: 0.8125rem;
    }
}