/**
 * Category Products Variants CSS - Individual Combinations View
 *
 * @author    iarea <contact@iarea.pl>
 * @copyright 2025 iarea
 * @license   https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
 */

/* Category page specific styles */
.cpv-products-section {
    margin: 20px 0;
}

.cpv-combinations-wrapper {
    background: #fff;
    padding: 0;
    border-radius: 0;
}

.cpv-combinations-table {
    margin-bottom: 20px;
    background: #fff;
}

.cpv-combinations-table thead {
    background: #25b9d7;
    color: #fff;
}

.cpv-combinations-table thead th {
    border: none;
    font-weight: 600;
    padding: 15px 10px;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
}

.cpv-combinations-table tbody td {
    padding: 12px 10px;
    vertical-align: middle;
    border-color: #dee2e6;
}

.cpv-combination-row {
    transition: all 0.2s ease;
}

.cpv-combination-row:hover {
    background-color: #f8f9fa !important;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.cpv-col-img {
    width: 80px;
}

.cpv-col-product {
    min-width: 200px;
}

.cpv-col-variant {
    min-width: 180px;
}

.cpv-col-ref {
    min-width: 140px;
}

.cpv-col-price {
    min-width: 100px;
}

.cpv-col-stock {
    min-width: 120px;
}

.cpv-product-name {
    color: #232323;
    font-size: 14px;
    text-decoration: none;
}

.cpv-product-name:hover {
    color: #25b9d7;
    text-decoration: underline;
}

.cpv-attr-badge {
    display: inline-block;
    margin: 2px;
    padding: 4px 8px;
    font-size: 11px;
    background: #25b9d7 !important;
    border: none;
}

.cpv-summary {
    margin-top: 20px;
}

.cpv-bottom-info {
    margin-top: 20px;
    text-align: center;
}

/* Responsive */
@media (max-width: 768px) {
    .cpv-combinations-table {
        font-size: 12px;
    }
    
    .cpv-combinations-table th,
    .cpv-combinations-table td {
        padding: 8px 5px;
    }
}

.cpv-container {
    margin: 20px 0;
    padding: 20px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.cpv-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #007bff;
}

.cpv-title {
    color: #333;
    font-size: 24px;
    font-weight: 600;
    margin: 0 0 10px 0;
}

.cpv-filter-info {
    color: #6c757d;
    font-size: 14px;
    margin: 5px 0 0 0;
}

.cpv-combinations-list {
    margin-top: 20px;
}

.cpv-table-wrapper {
    overflow-x: auto;
    margin-bottom: 15px;
}

.cpv-combinations-table {
    width: 100%;
    margin: 0;
    border-collapse: collapse;
    background: #fff;
    font-size: 14px;
}

.cpv-combinations-table thead {
    background: #343a40;
    color: #fff;
}

.cpv-combinations-table thead th {
    padding: 12px 10px;
    font-weight: 600;
    text-align: left;
    border: 1px solid #454d55;
    white-space: nowrap;
}

.cpv-combinations-table tbody td {
    padding: 12px 10px;
    vertical-align: middle;
    border: 1px solid #dee2e6;
}

.cpv-combination-row {
    transition: background-color 0.2s ease;
}

.cpv-combination-row:hover {
    background-color: #f8f9fa;
}

.cpv-combination-row.cpv-out-of-stock {
    background-color: #fff5f5;
}

.cpv-combination-row.cpv-low-stock {
    background-color: #fff9e6;
}

/* Column widths */
.cpv-col-image {
    width: 80px;
    text-align: center;
}

.cpv-col-product {
    width: 25%;
    min-width: 180px;
}

.cpv-col-variant {
    width: 20%;
    min-width: 150px;
}

.cpv-col-reference {
    width: 15%;
    min-width: 120px;
}

.cpv-col-price {
    width: 15%;
    min-width: 100px;
}

.cpv-col-quantity {
    width: 120px;
    text-align: center;
}

/* Cell styles */
.cpv-cell-image {
    text-align: center;
    padding: 8px;
}

.cpv-product-img {
    max-width: 60px;
    height: auto;
    border-radius: 4px;
    border: 1px solid #dee2e6;
}

.cpv-no-image {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 10px;
    color: #6c757d;
    margin: 0 auto;
    text-align: center;
}

.cpv-cell-product {
    font-size: 14px;
}

.cpv-product-link {
    color: #007bff;
    text-decoration: none;
    transition: color 0.3s ease;
}

.cpv-product-link:hover {
    color: #0056b3;
    text-decoration: underline;
}

.cpv-product-ref {
    color: #6c757d;
    font-size: 12px;
}

.cpv-cell-variant {
    font-size: 13px;
}

.cpv-attr-item {
    display: inline-block;
    margin: 2px 0;
    color: #495057;
}

.cpv-attr-item strong {
    color: #212529;
}

.cpv-no-variants {
    color: #6c757d;
    font-size: 12px;
}

.cpv-cell-reference code {
    font-family: 'Courier New', Courier, monospace;
    font-size: 12px;
    background: #f8f9fa;
    padding: 2px 6px;
    border-radius: 3px;
    color: #495057;
}

.cpv-cell-price {
    font-size: 14px;
}

.cpv-base-price {
    font-weight: 600;
    color: #212529;
}

.cpv-price-add {
    color: #28a745;
    font-size: 12px;
}

.cpv-price-sub {
    color: #dc3545;
    font-size: 12px;
}

.cpv-cell-quantity {
    text-align: center;
}

.cpv-qty-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 16px;
    font-weight: 700;
    font-size: 16px;
    color: #fff;
    min-width: 40px;
}

.cpv-badge-success {
    background-color: #28a745;
}

.cpv-badge-warning {
    background-color: #ffc107;
    color: #000;
}

.cpv-badge-danger {
    background-color: #dc3545;
}

.cpv-stock-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    margin-top: 5px;
}

.cpv-text-success {
    color: #28a745;
}

.cpv-text-warning {
    color: #e5a000;
}

.cpv-text-danger {
    color: #dc3545;
}

.cpv-summary {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 4px;
    text-align: right;
    font-size: 14px;
}

.cpv-summary strong {
    color: #007bff;
    font-size: 18px;
}

.cpv-no-results {
    padding: 30px;
    text-align: center;
    font-size: 16px;
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    border-radius: 4px;
    color: #0c5460;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .cpv-combinations-table {
        font-size: 13px;
    }
    
    .cpv-combinations-table thead th,
    .cpv-combinations-table tbody td {
        padding: 10px 8px;
    }
}

@media (max-width: 992px) {
    .cpv-container {
        padding: 15px;
    }
    
    .cpv-combinations-table {
        font-size: 12px;
    }
    
    .cpv-col-product,
    .cpv-col-variant,
    .cpv-col-reference,
    .cpv-col-price {
        min-width: auto;
    }
}

@media (max-width: 768px) {
    .cpv-title {
        font-size: 20px;
    }
    
    .cpv-table-wrapper {
        margin-bottom: 10px;
    }
    
    .cpv-combinations-table {
        font-size: 11px;
    }
    
    .cpv-combinations-table thead th,
    .cpv-combinations-table tbody td {
        padding: 8px 5px;
    }
    
    .cpv-product-img {
        max-width: 40px;
    }
    
    .cpv-qty-badge {
        padding: 4px 8px;
        font-size: 14px;
    }
}

@media (max-width: 576px) {
    .cpv-container {
        padding: 10px;
        margin: 10px 0;
    }
    
    .cpv-title {
        font-size: 18px;
    }
    
    .cpv-combinations-table {
        font-size: 10px;
    }
    
    /* Stack table on very small screens */
    .cpv-combinations-table,
    .cpv-combinations-table thead,
    .cpv-combinations-table tbody,
    .cpv-combinations-table th,
    .cpv-combinations-table td,
    .cpv-combinations-table tr {
        display: block;
    }
    
    .cpv-combinations-table thead tr {
        display: none;
    }
    
    .cpv-combinations-table tbody tr {
        margin-bottom: 15px;
        border: 1px solid #dee2e6;
        border-radius: 4px;
    }
    
    .cpv-combinations-table td {
        border: none;
        position: relative;
        padding-left: 50%;
        text-align: right;
    }
    
    .cpv-combinations-table td:before {
        content: attr(data-label);
        position: absolute;
        left: 10px;
        width: 45%;
        padding-right: 10px;
        text-align: left;
        font-weight: bold;
    }
}

/* Print styles */
@media print {
    .cpv-container {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .cpv-combination-row:hover {
        background-color: transparent;
    }
    
    .cpv-product-link {
        color: #000;
        text-decoration: none;
    }
}
