/* includes/product-card.php — винесено з inline <style> 20260908_2104 */
.products-grid {
    display: grid;
    grid-template-columns: repeat(3, 360px);
    gap: 30px;
    margin-bottom: 40px;
    padding: 0 10px;
    justify-content: center;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.product-card {
    background: white;
    border-radius: 12px;
    padding: 0;
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    width: 360px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.18);
}

.main-image {
    display: block;
    text-decoration: none;
}

.main-photo {
    width: 100%;
    aspect-ratio: 3/4;
    object-fit: cover;
    border-radius: 0;
    display: block;
    transition: opacity 0.3s ease;
}

.main-photo:hover {
    opacity: 0.9;
}

.product-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 15px 20px 20px 20px;
}

.product-title {
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 8px 0;
}

.product-description {
    font-size: 14px;
    color: #555;
    margin-bottom: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
}

.size-header {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.size-header.single-size {
    justify-content: center;
}

.size-chart-btn {
    background: none;
    border: 1px solid #000;
    color: #000;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
}

.size-chart-btn:hover {
    background: #000;
    color: white;
}

.details-btn {
    background-color: #4A90E2;
    color: white;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 13px;
    text-decoration: none;
}

.details-btn:hover {
    background-color: #3A7BC8;
}

.size-options {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 4px;
    margin-bottom: 20px;
}

.size-option {
    background: white;
    border: 1px solid #000;
    border-radius: 6px;
    padding: 8px 2px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 700;
}

.size-option:hover {
    border-color: #4A90E2;
}

.size-option.active {
    border-color: #4A90E2;
    background: #4A90E2;
    color: white;
}

.size-option.out-of-stock {
    background: #f5f5f5;
    border-color: #ddd;
    color: #999;
    cursor: not-allowed;
}

.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 10px;
}

.product-prices {
    display: flex;
    align-items: center;
    gap: 12px;
}

.product-price {
    font-size: 26px;
    font-weight: 700;
    color: #d4540a;
}

.old-price {
    font-size: 16px;
    color: #666;
    text-decoration: line-through;
    font-weight: 500;
}

.buy-button {
    background-color: #007A35;
    color: white;
    padding: 14px 28px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
}

.buy-button:hover {
    background-color: #005a28;
}

.size-chart-modal, .size-selection-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
}

.size-chart-modal-content {
    background: white;
    margin: 5% auto;
    padding: 40px;
    border-radius: 12px;
    width: 90%;
    max-width: 920px;
    position: relative;
    display: flex;
    gap: 35px;
    align-items: flex-start;
}

.size-selection-modal-content {
    background: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    position: relative;
}

.size-chart-close, .size-selection-close {
    position: absolute;
    top: -15px;
    right: -15px;
    font-size: 24px;
    cursor: pointer;
    color: #fff;
    background: #333;
    line-height: 1;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    z-index: 10;
    transition: background 0.2s;
}

.size-chart-close:hover, .size-selection-close:hover {
    background: #000;
}

.size-selection-title {
    font-size: 24px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 30px;
    color: #1f2937;
}

.size-guide-image {
    flex: 0 0 345px;
    display: flex;
    align-items: flex-start;
}

.size-chart-table {
    flex: 1;
    min-width: 0;
}

.size-chart-table table {
    width: 100%;
    border-collapse: collapse;
}

.size-chart-table th {
    background: #4A90E2;
    color: white;
    padding: 14px 10px;
    font-size: 16px;
}

.size-chart-table td {
    padding: 10px;
    text-align: center;
    border-bottom: 1px solid #e9ecef;
    font-size: 16px;
}

.size-guide-img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.size-selection-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    max-width: 400px;
    margin: 0 auto;
}

.size-option-modal {
    background: white;
    border: 1px solid #000;
    border-radius: 8px;
    padding: 20px;
    cursor: pointer;
    font-size: 24px;
    font-weight: 700;
    transition: all 0.2s;
}

.size-option-modal:hover:not(.out-of-stock) {
    border-color: #4A90E2;
    background: #f0f7ff;
}

.size-option-modal.out-of-stock {
    background: #f5f5f5;
    border-color: #ddd;
    color: #999;
    cursor: not-allowed;
}

@media (max-width: 1200px) {
    .products-grid {
        grid-template-columns: repeat(2, 360px);
    }
}

@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: 1fr;
        padding: 0 15px;
    }
    
    .product-card {
        width: 100%;
        max-width: 400px;
        margin: 0 auto;
    }
    
    .product-title {
        text-align: center;
    }
    
    .size-options {
        grid-template-columns: repeat(5, 1fr);
    }

    .product-footer {
        flex-direction: row;
        gap: 15px;
        align-items: center;
        justify-content: space-between;
    }

    .product-prices {
        flex-direction: column;
        align-items: center;
        gap: 2px;
        flex: 1;
    }

    .buy-button {
        flex: 1;
        padding: 16px 20px;
        white-space: nowrap;
        font-size: 15px;
        min-height: 48px;
    }

    .size-chart-modal-content {
        flex-direction: column;
        max-height: 90vh;
        overflow-y: auto;
        overflow-x: hidden;
        padding: 20px;
        margin: 5% auto;
        align-items: center;
        width: 95%;
        max-width: 95%;
    }

    .size-guide-image {
        flex: none;
        width: 100%;
        max-width: 100%;
        text-align: center;
        margin-bottom: 0;
        display: flex;
        justify-content: center;
    }

    .size-guide-img {
        max-width: 224px;
        width: 100%;
        height: auto;
    }

    .size-chart-table {
        width: 100%;
        max-width: 100%;
        display: flex;
        justify-content: center;
        overflow-x: hidden;
    }

    .size-chart-table table {
        width: 100%;
        max-width: 100%;
        table-layout: auto;
    }

    .size-chart-table td {
        padding: 6px 4px;
        font-size: 14px;
    }

    .size-chart-table th {
        padding: 10px 4px;
        font-size: 14px;
    }

    .size-chart-close, .size-selection-close {
        position: fixed;
        top: auto;
        right: auto;
        width: 38px;
        height: 38px;
        font-size: 20px;
        z-index: 2001;
    }

    .size-chart-modal-content .size-chart-close {
        position: absolute;
        top: 5px;
        right: 5px;
    }

    .size-selection-modal-content .size-selection-close {
        position: absolute;
        top: 5px;
        right: 5px;
    }
}
    
