/* Catalog Section Styles */
.catalog-section {
    padding: 60px 0;
    background: #f9f9f9;
}

.catalog-header {
    text-align: center;
    margin-bottom: 40px;
}

.catalog-header h2 {
    font-size: 36px;
    color: #333;
    margin-bottom: 10px;
}

.catalog-header p {
    color: #666;
    font-size: 16px;
}

/* Category Section */
.catalog-category {
    margin-bottom: 50px;
}

.catalog-category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    margin-bottom: 25px;
    gap: 15px;
}

.catalog-category-title {
    display: inline-flex;
    align-items: center;
    gap: 15px;
    padding: 0;
    background: transparent;
    color: #333;
    font-size: 28px;
    font-weight: 700;
    border-radius: 0;
    box-shadow: none;
    cursor: default;
    transition: none;
    text-transform: none;
    letter-spacing: 0;
    position: relative;
    margin-bottom: 5px;
}

.catalog-category-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, #9abc31, transparent);
    border-radius: 2px;
}

.catalog-category-title.pine::after {
    background: linear-gradient(90deg, #5d8a28, transparent);
}

.catalog-category-title.substrate::after {
    background: linear-gradient(90deg, #3498db, transparent);
}

.catalog-category-title:hover {
    transform: none;
    box-shadow: none;
}

.catalog-category-title .category-icon {
    font-size: 32px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

/* Quality Toggle Switch */
.quality-toggle {
    display: flex;
    background: #fff;
    border-radius: 50px;
    padding: 5px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border: 2px solid #e0e0e0;
}

.quality-btn {
    padding: 10px 25px;
    border: none;
    background: transparent;
    color: #666;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 50px;
    transition: all 0.3s ease;
}

.quality-btn.active {
    background: #9abc31;
    color: #fff;
    box-shadow: 0 2px 8px rgba(154, 188, 49, 0.4);
}

.quality-btn:hover:not(.active) {
    color: #9abc31;
}

.quality-btn.premium.active {
    background: #f0ad4e;
    box-shadow: 0 2px 8px rgba(240, 173, 78, 0.4);
}

/* Category Tabs */
.catalog-tabs {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.catalog-tab {
    padding: 15px 30px;
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    color: #555;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.catalog-tab:hover {
    border-color: #9abc31;
    color: #9abc31;
}

.catalog-tab.active {
    background: #9abc31;
    border-color: #9abc31;
    color: #fff;
}

.catalog-tab .tab-icon {
    font-size: 24px;
}

/* Sub-tabs for Quality */
.catalog-subtabs {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 25px;
}

.catalog-subtab {
    padding: 10px 25px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    color: #666;
    transition: all 0.3s ease;
}

.catalog-subtab:hover {
    border-color: #9abc31;
    color: #9abc31;
}

.catalog-subtab.active {
    background: #9abc31;
    border-color: #9abc31;
    color: #fff;
}

/* Product Grid - 4 items per row */
.catalog-products {
    display: flex;
    flex-wrap: wrap;
    gap: 25px;
    padding: 0 15px;
}

.catalog-products .product-card {
    flex: 1 1 calc(25% - 25px);
    min-width: 250px;
    max-width: calc(25% - 25px);
}

/* 3 items per row - wider cards to fill same total width as 4 items */
/* 4 cards fill: 100% - 75px (3 gaps), so 3 cards should also fill: 100% - 75px */
/* Each of 3 cards = (100% - 75px) / 3 */
.catalog-products-3 {
    display: flex;
    flex-wrap: wrap;
    gap: 25px;
    padding: 0 15px;
    justify-content: flex-start;
}

.catalog-products-3 .product-card {
    flex: 1 1 calc((100% - 75px) / 3);
    min-width: 280px;
    max-width: calc((100% - 75px) / 3);
}

@media (max-width: 1200px) {
    .catalog-products .product-card {
        flex: 1 1 calc(33.333% - 25px);
        max-width: calc(33.333% - 25px);
    }
    .catalog-products-3 .product-card {
        flex: 1 1 calc(33.333% - 25px);
        max-width: calc(33.333% - 25px);
    }
}

@media (max-width: 900px) {
    .catalog-products .product-card,
    .catalog-products-3 .product-card {
        flex: 1 1 calc(50% - 25px);
        max-width: calc(50% - 25px);
    }
}

@media (max-width: 600px) {
    .catalog-products .product-card,
    .catalog-products-3 .product-card {
        flex: 1 1 100%;
        max-width: 100%;
    }
}

/* Product Card */
.product-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 3px 15px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    position: relative;
}

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

.product-card-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

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

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

.product-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #9abc31;
    color: #fff;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 500;
}

.product-badge.premium {
    background: #f0ad4e;
}

.product-card-content {
    padding: 20px;
}

.product-card-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.product-card-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.product-card-title a:hover {
    color: #9abc31;
}

.product-card-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    color: #666;
    font-size: 14px;
}

.product-card-volume {
    display: flex;
    align-items: center;
    gap: 5px;
}

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

/* Розничная цена - перечёркнутая */
.product-card-price-retail {
    font-size: 16px;
    font-weight: 400;
    color: #999;
    text-decoration: line-through;
    margin-bottom: 5px;
}

/* Цена заказа через сайт - красная */
.product-card-price-sale {
    font-size: 24px;
    font-weight: 700;
    color: #e74c3c;
}

.product-card-price-sale span {
    font-size: 14px;
    font-weight: 400;
    color: #e74c3c;
}

/* Для субстрата - просто красная цена без розничной */
.product-card-price-single {
    font-size: 24px;
    font-weight: 700;
    color: #e74c3c;
    margin-bottom: 15px;
}

.product-card-price-single span {
    font-size: 14px;
    font-weight: 400;
    color: #e74c3c;
}

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

.product-card-actions .btn {
    flex: 1;
    padding: 12px;
    font-size: 14px;
    border-radius: 6px;
    text-align: center;
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn-order {
    background: #9abc31;
    color: #fff;
    border: none;
    cursor: pointer;
}

.btn-order:hover {
    background: #8aa92c;
}

.btn-details {
    background: transparent;
    color: #9abc31;
    border: 1px solid #9abc31;
}

.btn-details:hover {
    background: #9abc31;
    color: #fff;
}

/* Catalog Link */
.catalog-link {
    text-align: center;
    margin-top: 40px;
}

.catalog-link .btn {
    padding: 15px 40px;
    font-size: 16px;
}

/* Responsive */
@media (max-width: 768px) {
    .catalog-tabs {
        flex-direction: column;
        align-items: center;
    }
    
    .catalog-tab {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }
    
    .catalog-products {
        grid-template-columns: 1fr;
    }
    
    .product-card-actions {
        flex-direction: column;
    }
}

/* Hidden state for catalog content */
.catalog-content {
    display: none;
}

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

/* Order Popup Styles */
#orderPopup {
    position: fixed;
    top: -100%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    background: #fff;
    width: 450px;
    max-width: 90%;
    padding: 80px 50px 50px;
    box-shadow: 0 15px 30px rgba(0,0,0,0.08);
    transition: 0.5s;
    visibility: hidden;
}

#orderPopup.active {
    visibility: visible;
    top: 50%;
}

#orderPopup .popup-content h2 {
    font-size: 24px;
    font-weight: 500;
    color: #333;
    text-align: center;
    margin-bottom: 10px;
}

#orderPopup .popup-content p {
    text-align: center;
    font-size: 16px;
    color: #666;
    margin-bottom: 20px;
}

#orderPopup .popup-content .form-control {
    margin-bottom: 15px;
}

#orderPopup .popup-content .close {
    position: absolute;
    top: 20px;
    right: 30px;
    cursor: pointer;
    font-size: 24px;
    color: #999;
    text-decoration: none;
}

#orderPopup .popup-content .close:hover {
    color: #333;
}

@media (max-width: 480px) {
    #orderPopup {
        padding: 60px 25px 40px;
    }
}

/* Product Specs Styles - Характеристики товара */
.product-specs h4 {
    color: #9abc31 !important;
}

.product-specs table td strong {
    color: #9abc31;
}

.product-specs table td:last-child {
    color: #5d8a28;
}
