/* Reset dan Base Styles */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */
.main-header {
    background: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 0;
}

.logo img {
    height: 40px;
}

.search-bar {
    flex: 1;
    max-width: 600px;
    margin: 0 20px;
}

.search-bar form {
    display: flex;
}

.search-bar input {
    flex: 1;
    padding: 12px;
    border: 2px solid #ddd;
    border-right: none;
    border-radius: 4px 0 0 4px;
    font-size: 16px;
    outline: none;
}

.search-bar button {
    padding: 12px 20px;
    background: #ff6b35;
    color: white;
    border: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    font-weight: 500;
}

.user-actions {
    display: flex;
    gap: 20px;
}

.user-actions a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
}

.main-nav {
    border-top: 1px solid #eee;
}

.main-nav ul {
    display: flex;
    list-style: none;
    gap: 30px;
}

.main-nav a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    padding: 15px 0;
    display: block;
    transition: color 0.3s ease;
}

.main-nav a:hover {
    color: #ff6b35;
}

/* Breadcrumb */
.breadcrumb {
    background: white;
    padding: 15px 0;
    margin-bottom: 20px;
}

.breadcrumb ol {
    display: flex;
    list-style: none;
    gap: 10px;
}

.breadcrumb a {
    text-decoration: none;
    color: #666;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb li:not(:last-child)::after {
    content: ">";
    margin-left: 10px;
    color: #999;
}

/* Product Page */
.product-page {
    padding: 20px 0;
}

.product-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* Product Gallery */
.product-gallery {
    display: flex;
    flex-direction: column;
}

.gallery-main img {
    width: 100%;
    height: 400px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 15px;
}

.gallery-thumbnails {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 5px;
    scrollbar-width: thin;
}

.thumb-btn {
    border: 2px solid #ddd;
    border-radius: 4px;
    padding: 5px;
    cursor: pointer;
    background: white;
    flex-shrink: 0;
}

.thumb-btn.active {
    border-color: #ff6b35;
}

.thumb-btn img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 2px;
}

/* Product Info */
.product-info h1 {
    font-size: 24px;
    margin-bottom: 15px;
    color: #333;
}

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

.stars {
    color: #ffd700;
}

.rating-text {
    color: #666;
    font-size: 14px;
}

.product-price {
    margin-bottom: 15px;
}

.current-price {
    font-size: 28px;
    font-weight: bold;
    color: #ff6b35;
}

.original-price {
    text-decoration: line-through;
    color: #999;
    margin: 0 10px;
}

.discount {
    background: #ff6b35;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
}

.product-badges {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
}

.badge.best-seller {
    background: #ffeb3b;
    color: #333;
}

.badge.free-shipping {
    background: #4caf50;
    color: white;
}

.badge.limited {
    background: #f44336;
    color: white;
}

.product-details {
    margin-bottom: 20px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.label {
    font-weight: 500;
    color: #666;
}

.value {
    color: #333;
}

.value.in-stock {
    color: #4caf50;
    font-weight: 500;
}

/* Product Options */
.product-options {
    margin-bottom: 25px;
}

.option-group {
    margin-bottom: 20px;
}

.option-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 500;
}

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

.option {
    padding: 10px 20px;
    border: 2px solid #ddd;
    border-radius: 4px;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.option:hover,
.option.selected {
    border-color: #ff6b35;
}

.option.selected {
    background: #fff3ee;
    color: #ff6b35;
    font-weight: 500;
}

.quantity-selector {
    display: flex;
    align-items: center;
    gap: 15px;
}

.quantity-controls {
    display: flex;
    align-items: center;
}

.qty-btn {
    width: 40px;
    height: 40px;
    border: 2px solid #ddd;
    background: white;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    transition: border-color 0.3s ease;
}

.qty-btn:hover {
    border-color: #ff6b35;
}

#quantity {
    width: 60px;
    height: 40px;
    text-align: center;
    border: 2px solid #ddd;
    border-left: none;
    border-right: none;
    font-size: 16px;
    outline: none;
}

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

.btn {
    padding: 15px 30px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: #ff6b35;
    color: white;
    flex: 2;
}

.btn-primary:hover {
    background: #e55a2b;
}

.btn-secondary {
    background: #4caf50;
    color: white;
    flex: 2;
}

.btn-secondary:hover {
    background: #43a047;
}

.btn-wishlist {
    background: #f5f5f5;
    color: #666;
    flex: 1;
    border: 2px solid #ddd;
}

.btn-wishlist:hover {
    background: #e0e0e0;
}

/* Shipping Info */
.shipping-info {
    margin-bottom: 25px;
    padding: 20px;
    background: #f0f8ff;
    border-radius: 8px;
}

.shipping-info h3 {
    margin-bottom: 15px;
    color: #333;
}

.shipping-option {
    margin-bottom: 10px;
}

.shipping-option input {
    margin-right: 10px;
}

/* Seller Info */
.seller-info {
    padding: 20px;
    background: #fff8e1;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.seller-profile {
    display: flex;
    align-items: center;
    gap: 15px;
}

.seller-profile img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
}

.seller-details h4 {
    margin-bottom: 5px;
    color: #333;
}

.seller-rating {
    margin-bottom: 5px;
    font-size: 14px;
}

.seller-stats {
    font-size: 12px;
    color: #666;
}

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

.btn-outline {
    padding: 10px 20px;
    background: transparent;
    color: #ff6b35;
    border: 2px solid #ff6b35;
    border-radius: 4px;
    font-weight: 500;
    transition: background 0.3s ease;
}

.btn-outline:hover {
    background: #fff3ee;
}

/* Product Tabs */
.product-tabs {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 40px;
    overflow: hidden;
}

.tabs {
    display: flex;
    border-bottom: 2px solid #eee;
    background: #f9f9f9;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 15px 30px;
    background: none;
    border: none;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-btn.active {
    background: white;
    border-bottom: 3px solid #ff6b35;
    color: #ff6b35;
}

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

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

.tab-content h3,
.product-card-info h3 {
    margin-bottom: 20px;
    color: #333;
}

.tab-content p {
    margin-bottom: 15px;
    line-height: 1.8;
}

.content-image {
    max-width: 100%;
    border-radius: 8px;
    margin: 20px 0;
}

/* Specifications Table */
.spec-table {
    width: 100%;
    border-collapse: collapse;
}

.spec-table tr {
    border-bottom: 1px solid #eee;
}

.spec-table td {
    padding: 12px 15px;
}

.spec-table td:first-child {
    font-weight: 500;
    color: #666;
    width: 30%;
}

/* Reviews */
.reviews-summary {
    display: flex;
    gap: 40px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.rating-overview {
    text-align: center;
    min-width: 200px;
}

.average-rating {
    font-size: 48px;
    font-weight: bold;
    color: #ff6b35;
}

.rating-stars {
    font-size: 24px;
    color: #ffd700;
    margin: 10px 0;
}

.total-reviews {
    color: #666;
}

.rating-distribution {
    flex: 1;
    min-width: 300px;
}

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

.rating-bar span:first-child {
    width: 40px;
    color: #666;
}

.bar-container {
    flex: 1;
    height: 8px;
    background: #eee;
    border-radius: 4px;
    overflow: hidden;
}

.bar {
    height: 100%;
    background: #ff6b35;
    border-radius: 4px;
    width: 0;
    will-change: width;
}

/* JS akan mengisi lebar bar sesuai rating */
.review-item {
    padding: 20px;
    border: 1px solid #eee;
    border-radius: 8px;
    margin-bottom: 20px;
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.reviewer-info strong {
    display: block;
    margin-bottom: 5px;
}

.review-stars {
    color: #ffd700;
    font-size: 14px;
}

.review-date {
    color: #999;
    font-size: 14px;
}

.review-text {
    margin-bottom: 15px;
    line-height: 1.6;
}

.review-images {
    display: flex;
    gap: 10px;
}

.review-images img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
}

/* Related Products */
.related-products {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.related-products h2 {
    margin-bottom: 25px;
    color: #333;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
}

.product-card {
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.product-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

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

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

.product-card-price {
    font-size: 18px;
    font-weight: bold;
    color: #ff6b35;
    margin-bottom: 5px;
}

.product-card-rating {
    color: #666;
    font-size: 14px;
}

/* Footer */
.main-footer {
    background: #333;
    color: white;
    padding: 40px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-section h3 {
    margin-bottom: 20px;
    color: white;
}

.footer-section ul {
    list-style: none;
}

.footer-section li {
    margin-bottom: 10px;
}

.footer-section a {
    color: #ccc;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: white;
}

.social-links {
    display: flex;
    gap: 15px;
    font-size: 24px;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #555;
    color: #ccc;
    font-size: 14px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .product-content {
        grid-template-columns: 1fr;
        padding: 20px;
    }

    .header-top {
        flex-direction: column;
        gap: 15px;
    }

    .search-bar {
        max-width: 100%;
        margin: 0;
        width: 100%;
    }

    .tabs {
        flex-wrap: wrap;
    }

    .tab-btn {
        flex: 1;
        min-width: 120px;
        padding: 12px 15px;
        font-size: 14px;
    }

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

    .btn {
        width: 100%;
    }

    .seller-info {
        flex-direction: column;
        text-align: center;
    }

    .seller-actions {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

    .gallery-thumbnails {
        flex-wrap: wrap;
    }

    .options {
        flex-direction: column;
    }

    .option {
        width: 100%;
    }

    .reviews-summary {
        flex-direction: column;
    }
}