/**
 * Item Detail Page Styles
 * Marketplace Product Detail View - Using Project Color Scheme
 */

/* CSS Variables & Theme Configuration */
:root {
    --primary-color: #001A2B;
    --accent-color: #D4AF37;
    --success-color: #008000;
    --error-color: #C80000;
    --text-color: #FFFFFF;
    --text-color-dark: #001A2B;
    --background-light: #f8f9fa;
    --shadow-color: rgba(0, 26, 43, 0.1);
}

/* Base Layout */
.marketplace-product-page {
    background-color: var(--background-light);
    min-height: 100vh;
}

.product-navigation {
    box-shadow: 0 2px 4px var(--shadow-color);
    background: linear-gradient(135deg, var(--primary-color) 0%, #003d5c 100%);
    color: var(--text-color);
}

.product-navigation .breadcrumb a {
    color: var(--accent-color);
    text-decoration: none;
}

.product-navigation .breadcrumb a:hover {
    text-decoration: underline;
    color: #f4d03f;
}

.product-navigation .breadcrumb-item.active {
    color: var(--text-color);
}

/* Product Gallery Styles */
.product-gallery {
    position: sticky;
    top: 20px;
}

.main-image-container {
    position: relative;
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 20px var(--shadow-color);
    overflow: hidden;
    border: 1px solid #e9ecef;
}

.main-image {
    width: 100%;
    height: 500px;
    object-fit: contain;
    transition: transform 0.3s ease;
    cursor: zoom-in;
}

.main-image:hover {
    transform: scale(1.02);
}

.image-badges {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 10;
}

.new-badge {
    font-size: 0.75rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    background-color: var(--success-color) !important;
}

.image-zoom-overlay {
    position: absolute;
    top: 20px;
    right: 20px;
    background: var(--primary-color);
    color: var(--text-color);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.main-image-container:hover .image-zoom-overlay {
    opacity: 1;
}

.thumbnail-gallery {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 10px 0;
    justify-content: center;
}

.thumbnail {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 3px solid transparent;
}

.thumbnail:hover {
    border-color: var(--accent-color);
    transform: scale(1.1);
}

.thumbnail.active {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.25);
}

/* Product Info Styles */
.product-info {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px var(--shadow-color);
    height: fit-content;
    border: 1px solid #e9ecef;
}

.detail-product-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-color-dark);
    margin-bottom: 1rem;
}

.product-rating {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.rating-stars {
    color: var(--accent-color);
    font-size: 1.1rem;
}

.rating-text {
    color: #6c757d;
    margin-left: 10px;
}

.product-id {
    color: #6c757d;
    font-size: 0.9rem;
}

.product-categories {
    margin: 1rem 0;
}

.category-badge {
    font-size: 0.8rem;
    padding: 0.5rem 1rem;
    margin-right: 0.5rem;
    border-radius: 20px;
}

.category-badge.bg-primary {
    background-color: var(--primary-color) !important;
}

.category-badge.bg-secondary {
    background-color: #6c757d !important;
}

.status-badge {
    background-color: var(--success-color) !important;
}

/* Pricing Styles */
.product-pricing {
    background: linear-gradient(135deg, var(--primary-color) 0%, #003d5c 100%);
    color: var(--text-color);
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.product-pricing.has-price {
    background: linear-gradient(135deg, #003d5c 0%, var(--primary-color) 100%);
    box-shadow: 0 4px 20px rgba(0, 128, 0, 0.3);
    border-color: var(--accent-color);
}

.item-detail-current-price {
    font-size: 1.8rem;
    font-weight: 700;
    display: block;
    margin-bottom: 5px;
    color: var(--accent-color);
}

.price-note {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 10px;
}

.price-features {
    background: rgba(255, 255, 255, 0.1);
    padding: 10px;
    border-radius: 6px;
    margin-top: 10px;
}

.price-features small {
    line-height: 1.6;
}

/* Product Actions */
.product-actions .btn {
    font-weight: 600;
    border-radius: 8px;
    padding: 12px 20px;
    transition: all 0.3s ease;
}

.product-actions .btn-primary {
    background: linear-gradient(135deg, var(--primary-color), #003d5c);
    border: none;
    box-shadow: 0 4px 15px rgba(0, 26, 43, 0.3);
}

.product-actions .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 26, 43, 0.4);
    background: linear-gradient(135deg, #003d5c, var(--primary-color));
}

.product-actions .btn-outline-primary {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.product-actions .btn-outline-primary:hover {
    transform: translateY(-2px);
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.product-actions .btn-outline-secondary:hover {
    transform: translateY(-2px);
    border-color: var(--accent-color);
    color: var(--accent-color);
}

/* Key Features */
.key-features {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid var(--accent-color);
}

.key-features h5 {
    color: var(--text-color-dark);
}

.feature-list {
    list-style: none;
    padding: 0;
}

.feature-list li {
    padding: 5px 0;
    position: relative;
    padding-left: 25px;
    color: var(--text-color-dark);
}

.feature-list li:before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--success-color);
    font-weight: bold;
}

/* Supplier Info */
.supplier-info {
    border-top: 1px solid #e9ecef;
    padding-top: 20px;
}

.supplier-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 20px;
    border-radius: 10px;
    border: 1px solid var(--accent-color);
}

.supplier-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.supplier-icon {
    font-size: 2rem;
    color: var(--accent-color);
}

.supplier-name {
    margin: 0;
    color: var(--text-color-dark);
    font-weight: 600;
}

.supplier-rating {
    color: var(--accent-color);
    font-size: 0.9rem;
}

.supplier-stats {
    display: flex;
    justify-content: space-around;
    text-align: center;
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-number {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-label {
    font-size: 0.8rem;
    color: #6c757d;
}

/* Product Details Tabs */
.product-details-section {
    background: white;
    border-radius: 12px;
    margin-top: 1em;
    margin-bottom: 2em;
    box-shadow: 0 4px 20px var(--shadow-color);
    overflow: hidden;
    border: 1px solid #e9ecef;
}

.product-tabs {
    background: linear-gradient(135deg, var(--primary-color) 0%, #003d5c 100%);
    padding: 0;
    margin: 0;
    border-bottom: 1px solid #e9ecef;
}

.product-tabs .nav-link {
    border: none;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 600;
    padding: 20px 30px;
    border-radius: 0;
    transition: all 0.3s ease;
}

.product-tabs .nav-link.active {
    background: white;
    color: var(--primary-color);
    border-bottom: 3px solid var(--accent-color);
}

.product-tabs .nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--accent-color);
}

.product-tab-content {
    padding: 40px;
}

/* Description Styles */
.description-content h4 {
    color: var(--text-color-dark);
    margin-bottom: 30px;
}

.language-tabs .nav-tabs {
    border-bottom: 2px solid #e9ecef;
}

.language-tabs .nav-link {
    border: none;
    color: #6c757d;
    padding: 10px 20px;
    border-radius: 8px 8px 0 0;
}

.language-tabs .nav-link.active {
    background: var(--primary-color);
    color: var(--text-color);
}

.language-tabs .nav-link:hover {
    color: var(--accent-color);
}

.description-text {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 10px;
    border-left: 4px solid var(--accent-color);
    min-height: 150px;
    line-height: 1.6;
    font-size: 1rem;
    color: var(--text-color-dark);
}

/* Specifications Styles */
.spec-group {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    border: 1px solid #e9ecef;
}

.spec-group h6 {
    color: var(--text-color-dark);
    font-weight: 700;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--accent-color);
}

.spec-table td {
    padding: 10px 0;
    border-bottom: 1px solid #e9ecef;
    color: var(--text-color-dark);
}

.spec-label {
    font-weight: 600;
    color: #495057;
    width: 40%;
}

.dynamic-specs {
    max-height: 300px;
    overflow-y: auto;
}

.dynamic-field {
    background: white;
    border: 1px solid var(--accent-color);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.dynamic-field h6 {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 10px;
}

.dynamic-field-value {
    background: #f8f9fa;
    padding: 10px;
    border-radius: 6px;
    border-left: 3px solid var(--accent-color);
    color: var(--text-color-dark);
}

/* Reviews Styles */
.rating-overview {
    text-align: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 30px;
    border-radius: 10px;
    border: 1px solid var(--accent-color);
}

.overall-rating .rating-number {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-color);
    display: block;
}

.overall-rating .rating-stars {
    font-size: 1.5rem;
    color: var(--accent-color);
    margin: 10px 0;
}

.rating-breakdown {
    padding: 20px;
}

.rating-row {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
}

.rating-row span:first-child {
    width: 60px;
    font-size: 0.9rem;
    color: var(--text-color-dark);
}

.rating-row .progress {
    flex-grow: 1;
    height: 8px;
    background: #e9ecef;
}

.rating-row .progress-bar {
    background-color: var(--accent-color);
}

.rating-row span:last-child {
    width: 30px;
    text-align: right;
    font-size: 0.9rem;
    color: var(--text-color-dark);
}

.review-item {
    border-bottom: 1px solid #e9ecef;
    padding: 20px 0;
}

.reviewer-info {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
}

.reviewer-info strong {
    color: var(--text-color-dark);
}

.review-date {
    color: #6c757d;
    font-size: 0.9rem;
}

.review-text {
    color: var(--text-color-dark);
}

/* Shipping Styles */
.shipping-option {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    border-left: 4px solid var(--accent-color);
}

.shipping-option h6 {
    color: var(--text-color-dark);
    margin-bottom: 10px;
}

.shipping-option p {
    color: var(--text-color-dark);
    margin-bottom: 5px;
}

.shipping-option .price {
    color: var(--primary-color);
    font-weight: 600;
    margin: 0;
}

.shipping-policies {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    padding: 20px;
    border-radius: 10px;
    border: 1px solid var(--accent-color);
}

.shipping-policies h6 {
    color: var(--text-color-dark);
}

.shipping-policies ul {
    list-style: none;
    padding: 0;
}

.shipping-policies li {
    padding: 5px 0;
    position: relative;
    padding-left: 25px;
    color: var(--text-color-dark);
}

.shipping-policies li:before {
    content: '📦';
    position: absolute;
    left: 0;
}

/* =============================================================================
   ITEM LIST PAGE STYLES
   ============================================================================= */

/* Container Styles */
.product-list-container {
    background-color: #f8f9fa;
}

/* Category Sidebar Styles */
.category-sidebar {
    background-color: white;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.sidebar-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #333;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #eee;
}

.sidebar-subtitle {
    font-size: 0.9rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
}

.category-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-item {
    border-bottom: 1px solid #f5f5f5;
}

.category-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    color: #666;
    text-decoration: none;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.category-link:hover {
    color: var(--accent-color);
    padding-left: 0.5rem;
}

.category-link.active {
    color: var(--accent-color);
    font-weight: 600;
}

.item-count {
    color: #999;
    font-size: 0.75rem;
}

/* Search Box Styles */
.search-box .input-group {
    max-width: 400px;
}

.search-box .form-control {
    border-radius: 4px 0 0 4px;
    border: 1px solid #e0e0e0;
    font-size: 0.85rem;
}

.search-box .btn {
    border-radius: 0 4px 4px 0;
    padding: 0.25rem 0.5rem;
}

/* Filters Section */
.filters-section .dropdown-toggle {
    text-align: left;
}

/* Loading and Error States */
.loading-container, .error-container {
    text-align: center;
    padding: 3rem 1rem;
}

.loading-spinner {
    width: 3rem;
    height: 3rem;
    margin-bottom: 1rem;
}

.error-message {
    color: var(--error-color);
    margin-bottom: 1rem;
}

/* Product Grid */
.product-grid {
    min-height: 400px;
}

/* Product Card Styles */
.product-item .card {
    border: none;
    background-color: #fff;
    border-radius: 4px;
    transition: box-shadow 0.2s ease;
    cursor: pointer;
}

.product-item .card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

/* Product Image Styles */
.product-image-link {
    text-decoration: none;
    display: block;
}

.product-image {
    position: relative;
    padding-top: 100%;
    background-color: #fff;
    overflow: hidden;
    border-radius: 4px 4px 0 0;
}

.product-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 8px;
    transition: transform 0.2s ease;
}

.product-image:hover img {
    transform: scale(1.05);
}

.placeholder-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f9fa;
    color: #ccc;
    font-size: 2rem;
}

/* Product Badge Styles */
.product-badges {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 10;
}

.badge {
    font-size: 0.7rem;
    padding: 0.25em 0.5em;
    font-weight: normal;
}

/* Product Info Styles */
.product-title {
    font-size: 0.85rem;
    line-height: 1.4;
    height: 2.8em;    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    margin-bottom: 0.5rem;
}

.product-title a {
    color: #333;
    text-decoration: none;
}

.product-title a:hover {
    text-decoration: underline;
    color: var(--primary-color);
}

/* Price Styles */
.price-section {
    line-height: 1.2;
}

.current-price {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--primary-color);
}

.original-price {
    font-size: 0.9rem;
    color: #999;
    text-decoration: line-through;
}

.points-info {
    font-size: 0.75rem;
    color: #666;
}

/* Additional Info Styles */
.additional-info {
    font-size: 0.75rem;
    margin-bottom: 0.5rem;
}

.shipping-info {
    margin-bottom: 0.25rem;
}

.stock-status {
    margin-bottom: 0.25rem;
}

.shop-badge {
    margin-top: 0.25rem;
}

.shop-badge .badge {
    font-weight: normal;
    background-color: #f8f9fa;
    color: #666;
    border: 1px solid #dee2e6;
}

/* Rating Styles */
.rating-section {
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.stars {
    display: inline-flex;
    gap: 1px;
}

.stars i {
    font-size: 0.8rem;
    color: var(--accent-color);
}

/* Quick Actions Styles */
.quick-actions {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.product-item:hover .quick-actions {
    opacity: 1;
}

.btn-action {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.9);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: relative;
    z-index: 10;
}

.btn-action:hover {
    background-color: #fff;
    color: var(--accent-color);
    transform: scale(1.1);
}

.btn-action.active {
    color: var(--accent-color);
    background-color: #fff;
}

.wishlist-btn.active i {
    font-weight: 900;
}

/* Pagination Styles */
.pagination-container {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
}

.pagination-container .pagination {
    gap: 0.25rem;
}

.pagination-container .page-link {
    color: var(--primary-color);
    border-color: #dee2e6;
}

.pagination-container .page-link:hover {
    color: var(--accent-color);
    background-color: #f8f9fa;
}

.pagination-container .page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* No Products Found */
.no-products {
    text-align: center;
    padding: 3rem 1rem;
    color: #666;
}

.no-products i {
    font-size: 4rem;
    color: #ccc;
    margin-bottom: 1rem;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .product-title {
        font-size: 1.5rem;
    }

    .main-image {
        height: 300px;
    }

    .product-info {
        margin-top: 20px;
    }

    .product-tabs .nav-link {
        padding: 15px 10px;
        font-size: 0.9rem;
    }

    .product-tab-content {
        padding: 20px;
    }

    .supplier-stats {
        flex-direction: column;
        gap: 10px;
    }
}

@media (max-width: 576px) {
    .product-rating {
        flex-direction: column;
        align-items: flex-start;
    }

    .rating-row {
        flex-direction: column;
        align-items: stretch;
        gap: 5px;
    }

    .thumbnail-gallery {
        justify-content: flex-start;
    }
}

@media (max-width: 768px) {
    .category-sidebar {
        margin-bottom: 1rem;
    }
    
    .sidebar-title {
        font-size: 0.9rem;
    }
}

@media (max-width: 576px) {
    .product-title {
        font-size: 0.8rem;
    }
    
    .current-price {
        font-size: 1rem;
    }
    
    .additional-info {
        font-size: 0.7rem;
    }
    
    .quick-actions {
        opacity: 1;
        transform: none;
    }
    
    .btn-action {
        width: 28px;
        height: 28px;
        font-size: 0.9rem;
    }
}
