/* Product Detail Styles */

/* Product Header Section */
.product-container {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 15px;
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 20px;
    font-size: 14px;
    color: #666;
}

.breadcrumb a {
    color: #007bff;
    text-decoration: none;
    transition: color 0.3s;
}

.breadcrumb a:hover {
    color: #0056b3;
}

.breadcrumb-separator {
    margin: 0 8px;
    color: #ccc;
}

.product-header {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 30px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    padding: 30px;
}

.product-image {
    flex: 0 0 40%;
    margin-right: 30px;
}

.product-image img {
    max-width: 100%;
    border-radius: 8px;
    box-shadow: 0 0 5px rgba(0,0,0,0.1);
}

.product-info {
    flex: 1;
}

.product-info h1 {
    color: #333;
    margin-bottom: 10px;
    font-size: 24px;
    font-weight: 700;
}

.product-info .subtitle {
    color: #666;
    margin-bottom: 15px;
    font-size: 16px;
}

.product-price {
    font-size: 28px;
    color: #d32f2f;
    margin: 15px 0;
    font-weight: 700;
}

.stock {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 14px;
    margin-left: 10px;
}

.in-stock {
    background-color: #d4edda;
    color: #155724;
}

.low-stock {
    background-color: #fff3cd;
    color: #856404;
}

.out-of-stock {
    background-color: #f8d7da;
    color: #721c24;
}

.product-meta {
    margin-bottom: 20px;
}

.product-meta p {
    margin: 8px 0;
    display: flex;
    align-items: center;
}

.product-meta strong {
    color: #555;
    min-width: 100px;
    display: inline-block;
}

.add-to-cart-section {
    margin-top: 25px;
}

.add-to-cart-btn {
    width: 100%;
    background-color: #d32f2f;
    color: white;
    border: none;
    padding: 15px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.add-to-cart-btn:hover {
    background-color: #b71c1c;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(211, 47, 47, 0.3);
}

.add-to-cart-btn:active {
    transform: translateY(0);
}

/* Loading state untuk tombol add to cart */
.add-to-cart-btn.loading {
    position: relative;
    color: transparent;
    pointer-events: none;
}

.add-to-cart-btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

/* Success state untuk tombol add to cart */
.add-to-cart-btn.success {
    background-color: #4CAF50;
    pointer-events: none;
    transition: background-color 0.3s ease;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Tabs Section */
.tabs {
    margin-top: 30px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    overflow: hidden;
}

.tab-buttons {
    display: flex;
    background-color: #f8f9fa;
    border-bottom: 1px solid #ddd;
}

.tab-button {
    padding: 15px 20px;
    cursor: pointer;
    background-color: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    font-size: 16px;
    font-weight: 500;
    color: #666;
    transition: all 0.3s;
}

.tab-button:hover {
    color: #d32f2f;
}

.tab-button.active {
    color: #d32f2f;
    border-bottom-color: #d32f2f;
    background-color: white;
}

.tab-content {
    padding: 25px;
    display: none;
}

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

.tab-content h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 18px;
}

/* Gallery Section */
.gallery-images {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-top: 20px;
}

.gallery-image {
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.gallery-image img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s;
    cursor: pointer;
}

.gallery-image img:hover {
    transform: scale(1.05);
}

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

.section-title {
    font-size: 24px;
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #d32f2f;
    display: inline-block;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.product-card {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.product-card-image {
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f9fa;
    overflow: hidden;
}

.product-card-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.product-card-info {
    padding: 15px;
}

.product-card-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #333;
    height: 40px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product-card-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 12px;
    color: #666;
}

.product-card-price {
    font-size: 18px;
    font-weight: 700;
    color: #d32f2f;
    margin-bottom: 15px;
}

.product-card-actions {
    display: flex;
    gap: 10px;
}

.product-card-cart-btn {
    flex-grow: 1;
    background-color: #d32f2f;
    color: #fff;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.product-card-cart-btn:hover {
    background-color: #b71c1c;
}

.product-card-wishlist-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f0f0f0;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.product-card-wishlist-btn:hover {
    background-color: #ffebee;
    color: #d32f2f;
}

/* Responsive Styles */
@media (max-width: 1200px) {
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 992px) {
    .product-header {
        flex-direction: column;
    }
    
    .product-image {
        flex: 0 0 100%;
        margin-right: 0;
        margin-bottom: 30px;
    }
    
    .gallery-images {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .gallery-images {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .tab-button {
        padding: 12px 15px;
        font-size: 14px;
    }
    
    .tab-content {
        padding: 20px;
    }
}

@media (max-width: 576px) {
    .product-info h1 {
        font-size: 20px;
    }
    
    .product-price {
        font-size: 24px;
    }
    
    .add-to-cart-btn {
        padding: 12px 16px;
        font-size: 14px;
    }
    
    .gallery-images {
        grid-template-columns: repeat(1, 1fr);
    }
    
    .product-grid {
        grid-template-columns: repeat(1, 1fr);
    }
}