/* Product Header Banner */
.product-header {
    background: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), 
        var(--header-bg) no-repeat center center/cover;
    padding: 60px 0;
    text-align: center;
    color: white;
    margin-bottom: 20px;
}

/* Header background variations */
[data-active-type="finished"] .product-header {
    --header-bg: url('../images/products/dus damar.JPG');
}

[data-active-type="raw"] .product-header {
    --header-bg: url('../images/products/biji plastik.JPG');
}

/* Main Categories Tabs */
.main-categories-tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.main-category-tab {
    flex: 1;
    text-align: center;
    padding: 15px 20px;
    background-color: #f0f0f0;
    border: none;
    font-size: 16px;
    font-weight: 600;
    color: var(--gray);
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.main-category-tab:first-child {
    border-top-left-radius: 10px;
    border-bottom-left-radius: 10px;
}

.main-category-tab:last-child {
    border-top-right-radius: 10px;
    border-bottom-right-radius: 10px;
}

.main-category-tab.active {
    background-color: var(--primary);
    color: white;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    z-index: 1;
}

.main-category-tab i {
    margin-right: 8px;
}

/* Product Categories Filter */
.products-filter {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 40px;
}

.filter-button {
    padding: 10px 20px;
    background-color: white;
    border: 1px solid var(--light-gray);
    border-radius: 30px;
    font-size: 14px;
    font-weight: 500;
    color: var(--gray);
    cursor: pointer;
    transition: all 0.3s;
}

.filter-button:hover, .filter-button.active {
    background-color: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Product Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
}

.product-card {
    background-color: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
    position: relative;
}

.product-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.product-img {
    position: relative;
    padding-top: 75%;
    overflow: hidden;
    background-color: #ffffff;
}

/* Product Tags/Badges */
.product-tag {
    position: absolute;
    top: 15px;
    left: 0;
    padding: 5px 15px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    border-top-right-radius: 20px;
    border-bottom-right-radius: 20px;
    z-index: 1;
    color: white;
}

.new-tag {
    background-color: #00C853; /* Hijau untuk produk baru */
}

.bestseller-tag {
    background-color: #FF6D00; /* Oranye untuk produk bestseller */
}

.product-img img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    transition: transform 0.5s;
    padding: 10px;
}

.product-card:hover .product-img img {
    transform: scale(1.05);
}

.product-info {
    padding: 25px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-content {
    flex-grow: 1;
}

.product-info h3 {
    font-size: 20px;
    margin-bottom: 10px;
    color: var(--primary);
}

.product-category {
    font-size: 13px;
    color: var(--accent);
    font-weight: 500;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.product-info p {
    color: var(--gray);
    margin-bottom: 20px;
    font-size: 15px;
}

.product-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.product-specs {
    font-size: 14px;
    color: var(--gray);
}

.product-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: gap 0.3s;
}

.product-link:hover {
    gap: 10px;
}

/* Product Price Badge */
.price-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background-color: var(--primary);
    color: white;
    font-weight: 700;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 15px;
    z-index: 2;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.login-to-view {
    position: absolute;
    top: 15px;
    right: 15px;
    background-color: var(--gray);
    color: white;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 13px;
    z-index: 2;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.3s;
}

.login-to-view:hover {
    background-color: var(--primary);
}

/* Technical Specs Table */
.specs-section {
    margin: 15px 0;
}

.specs-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 10px;
}

.specs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.specs-table tr {
    border-bottom: 1px solid var(--light-gray);
}

.specs-table tr:last-child {
    border-bottom: none;
}

.specs-table td {
    padding: 6px 0;
}

.specs-table td:first-child {
    color: var(--gray);
    width: 40%;
}

.specs-table td:last-child {
    font-weight: 500;
}

/* CTA Buttons Section */
.product-cta {
    margin-top: auto;
    padding-top: 15px;
}

.btn-whatsapp {
    width: 100%;
    text-align: center;
    padding: 12px 15px;
    background-color: #25D366;
    color: white;
    border-radius: 6px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.btn-whatsapp:hover {
    background-color: #128C7E;
}

/* Pagination Container */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 40px 0 30px;
    padding: 0 20px;
}

/* Laravel Default Pagination Styling */
.pagination {
    display: flex !important;
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    justify-content: center;
    gap: 8px;
}

.pagination li {
    display: inline-block;
}

.pagination > li > a,
.pagination > li > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    margin: 0;
    border-radius: 8px;
    background-color: white;
    border: 1px solid var(--light-gray);
    color: var(--primary);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    line-height: 1;
}

.pagination > li > a:hover {
    background-color: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.pagination > .active > span,
.pagination > .active > span:hover {
    background-color: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.pagination > .disabled > span,
.pagination > .disabled > span:hover {
    background-color: #f8f9fa;
    color: #6c757d;
    border-color: #dee2e6;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Fix untuk SVG icons di Laravel pagination */
.pagination svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
    margin: 0;
}

/* Previous/Next text styling jika ada */
.pagination a[rel="prev"],
.pagination a[rel="next"] {
    font-weight: 600;
    padding: 0 16px;
}

/* Loading State */
.pagination a.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.pagination a.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid var(--primary);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Global loading overlay */
body.loading::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

body.loading::before {
    content: '';
    position: fixed;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 4px solid var(--primary);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    z-index: 10000;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Page transition animation */
.page-transition {
    animation: fadeInUp 0.5s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Catalog Section */
.catalog-section {
    margin: 40px 0;
    padding: 20px;
    scroll-margin-top: 100px; /* Menambahkan margin untuk scroll */
}

.catalog-card {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    border-radius: 15px;
    padding: 30px;
    text-align: center;
    color: white;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    max-width: 800px; /* Membatasi lebar maksimal */
    margin: 0 auto; /* Membuat card center */
}

.catalog-icon {
    font-size: 36px; /* Mengurangi ukuran icon */
    margin-bottom: 15px;
}

.catalog-content h3 {
    font-size: 24px; /* Mengurangi ukuran heading */
    margin-bottom: 10px;
    color: white;
}

.catalog-content p {
    font-size: 14px; /* Mengurangi ukuran text */
    margin-bottom: 20px;
    opacity: 0.9;
}

.catalog-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: white;
    color: var(--primary);
    padding: 12px 24px; /* Mengurangi padding */
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px; /* Mengurangi ukuran font */
    text-decoration: none;
    transition: all 0.3s ease;
}

.catalog-download-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Smooth Scroll Behavior */
html {
    scroll-behavior: smooth;
}

/* Floating Download Button */
.download-catalog-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: var(--primary);
    color: white;
    border-radius: 50px;
    padding: 12px 24px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 99;
    transition: all 0.3s;
}

.download-catalog-btn:hover {
    background-color: var(--accent);
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

.download-catalog-btn i {
    font-size: 16px;
}

/* No Products Message */
.no-products {
    text-align: center;
    padding: 50px 20px;
    background-color: #f9f9f9;
    border-radius: 10px;
    margin: 30px auto;
    max-width: 600px;
}

.no-products i {
    font-size: 48px;
    color: var(--gray);
    margin-bottom: 20px;
    opacity: 0.5;
}

.no-products h3 {
    font-size: 24px;
    color: var(--primary);
    margin-bottom: 15px;
}

.no-products p {
    color: var(--gray);
    margin-bottom: 20px;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .product-header h1 {
        font-size: 30px;
    }
    
    .product-header p {
        font-size: 16px;
    }
}

@media (max-width: 768px) {
    .catalog-card {
        padding: 30px 20px;
    }

    .catalog-content h3 {
        font-size: 24px;
    }

    .catalog-content p {
        font-size: 14px;
    }

    .catalog-download-btn {
        padding: 12px 24px;
    }
}

@media (max-width: 576px) {
    .products-filter {
        flex-direction: column;
        align-items: center;
    }
    
    .filter-button {
        width: 100%;
        max-width: 250px;
        text-align: center;
    }
    
    /* Responsive Pagination */
    .pagination {
        flex-wrap: wrap;
        gap: 6px;
    }
    
    .pagination > li > a, 
    .pagination > li > span {
        min-width: 36px;
        height: 36px;
        font-size: 13px;
        padding: 0 10px;
    }
    
    .pagination a[rel="prev"],
    .pagination a[rel="next"] {
        padding: 0 12px;
    }
    
    .download-catalog-btn {
        bottom: 20px;
        right: 20px;
        padding: 10px 20px;
        font-size: 13px;
    }
}

/* Search Bar Styling */
.search-bar {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
}

.search-form {
    display: flex;
    gap: 15px;
    width: 100%;
    max-width: 600px;
}

.search-input {
    flex: 1;
    text-align: left;
    padding: 10px 20px;
    border: 1px solid var(--light-gray);
    border-radius: 30px;
    font-size: 14px;
    font-weight: 500;
    color: var(--gray);
    background-color: white;
    transition: all 0.3s ease;
}

.search-input::placeholder {
    color: var(--gray);
}

.search-button {
    padding: 10px 20px;
    background-color: var(--primary);
    border: 1px solid var(--primary);
    border-radius: 30px;
    font-size: 14px;
    font-weight: 500;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-button:hover {
    background-color: var(--accent);
    border-color: var(--accent);
    transform: translateY(-2px);
}

.search-button i {
    margin-right: 5px;
}

.search-input:hover, .search-input:focus {
    border-color: var(--accent);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
    outline: none;
}