/**
 * Hartman Related Products Styles
 */

.hartman-related-products-wrapper {
    width: 100%;
    margin: 0 auto;
}

.hartman-related-products-grid {
    display: flex;
    flex-wrap: wrap;
    margin: 0;
}

/* Column layouts */
.hartman-related-columns-1 .hartman-related-product-item {
    width: 100%;
}

.hartman-related-columns-2 .hartman-related-product-item {
    width: 50%;
}

.hartman-related-columns-3 .hartman-related-product-item {
    width: 33.333%;
}

.hartman-related-columns-4 .hartman-related-product-item {
    width: 25%;
}

.hartman-related-columns-5 .hartman-related-product-item {
    width: 20%;
}

.hartman-related-columns-6 .hartman-related-product-item {
    width: 16.666%;
}

/* Product item styles */
.hartman-related-product-item {
    box-sizing: border-box;
    margin-bottom: 35px;
}

.hartman-related-product-inner {
    background: #2a353e;
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}

.hartman-related-product-inner:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.4);
}

/* Product image styles */
.hartman-related-product-image {
    position: relative;
    overflow: hidden;
}

.hartman-related-product-image a {
    display: block;
    line-height: 0;
}

.hartman-related-product-image img {
    width: 100%;
    height: auto;
    transition: all 0.3s ease;
    display: block;
}

.related-border {
    padding: 0 0 0 10px;
    border-left: 4px solid #2A353E;
}

.related-heading {
    color: #2A353E;
    font-size: 30px;
    line-height: 45px;
    font-weight: 400;
    font-family: "Gill Sans MT", Sans-serif !important;    
    margin-bottom: 65px;
}

/* Product title styles */
.hartman-related-product-title {
    margin: 10px;
    font-size: 14px;
    font-weight: 400;
    text-align: center;
    font-family: "Segoe UI", Sans-serif !important;
}

.hartman-related-product-title a {
    color: #fff !important;
    text-decoration: none !important;
    transition: color 0.3s ease;
}

.hartman-related-product-title a:hover {
    color: #fff !important;
    text-decoration: none !important;
}

/* Product rating styles */
.hartman-related-product-rating {
    margin: 0 10px 10px 10px;
    text-align: center;
}

.hartman-related-product-rating .star-rating {
    font-size: 14px;
    color: #ffa500;
}

/* Product price styles */
.hartman-related-product-price {
    margin: 0 10px 15px 10px;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    text-align: center;
}

.hartman-related-product-price .price {
    color: inherit;
}

.hartman-related-product-price .price del {
    color: #999;
    font-weight: normal;
    margin-right: 5px;
}

.hartman-related-product-price .price ins {
    color: #e74c3c;
    text-decoration: none;
    font-weight: 600;
}

/* Add to cart button styles */
.hartman-related-product-add-to-cart {
    margin-top: auto;
    padding: 0 10px 20px 10px;
}

.hartman-related-product-add-to-cart .button {
    width: 100%;
    background: #0073aa;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    line-height: 1;
}

.hartman-related-product-add-to-cart .button:hover {
    background: #005a87;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 115, 170, 0.3);
}

.hartman-related-product-add-to-cart .button.loading {
    opacity: 0.7;
    cursor: not-allowed;
}

.hartman-related-product-add-to-cart .button.added {
    background: #27ae60;
}

.hartman-related-product-add-to-cart .button.added::after {
    content: "✓";
    margin-left: 5px;
}

/* Sale badge */
.hartman-related-product-image .onsale {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #e74c3c;
    color: #fff;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    z-index: 1;
}

/* Out of stock overlay */
.hartman-related-product-item.out-of-stock .hartman-related-product-image::after {
    content: "Out of Stock";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: #666;
    border-radius: 4px;
}

/* Responsive styles */
@media (max-width: 1024px) {
    .hartman-related-columns-5 .hartman-related-product-item,
    .hartman-related-columns-6 .hartman-related-product-item {
        width: 25%;
    }
}

@media (max-width: 768px) {
    .hartman-related-columns-3 .hartman-related-product-item,
    .hartman-related-columns-4 .hartman-related-product-item,
    .hartman-related-columns-5 .hartman-related-product-item,
    .hartman-related-columns-6 .hartman-related-product-item {
        width: 50%;
    }
    
    
    .hartman-related-product-inner {
        padding: 0;
        background: transparent;
    }
    
    .hartman-related-product-image {
        width: 100%;
        margin-bottom: 0;
    }
    
    .hartman-related-product-image img {
        width: 100%;
        height: auto;
        display: block;
        object-fit: cover;
    }
    
    .hartman-related-product-title {
        font-size: 14px;
        background: #2a353e;
        padding: 20px 10px 10px 10px;
        margin: 0;
    }
    
    .hartman-related-product-rating {
        background: #2a353e;
        margin: 0;
        padding: 0 10px 10px 10px;
    }
    
    .hartman-related-product-price {
        font-size: 14px;
        background: #2a353e;
        margin: 0;
        padding: 0 10px 15px 10px;
    }
    
    .hartman-related-product-add-to-cart {
        background: #2a353e;
        margin: 0;
        padding: 0 10px 20px 10px;
    }
}

@media (max-width: 480px) {
    .hartman-related-columns-2 .hartman-related-product-item,
    .hartman-related-columns-3 .hartman-related-product-item,
    .hartman-related-columns-4 .hartman-related-product-item,
    .hartman-related-columns-5 .hartman-related-product-item,
    .hartman-related-columns-6 .hartman-related-product-item {
        width: 100%;
        max-width: 270px;
        margin-left: auto;
        margin-right: auto;
    }
    
    .hartman-related-product-inner {
        padding: 0;
        background: transparent;
    }
    
    .hartman-related-product-image {
        width: 100%;
        margin-bottom: 0;
    }
    
    .hartman-related-product-image img {
        width: 100%;
        height: auto;
        display: block;
        object-fit: cover;
    }
    
    .hartman-related-product-title {
        font-size: 14px;
        background: #2a353e;
        padding: 20px 10px 10px 10px;
        margin: 0;
    }
    
    .hartman-related-product-rating {
        background: #2a353e;
        margin: 0;
        padding: 0 10px 10px 10px;
    }
    
    .hartman-related-product-price {
        font-size: 14px;
        background: #2a353e;
        margin: 0;
        padding: 0 10px 15px 10px;
    }
    
    .hartman-related-product-add-to-cart {
        background: #2a353e;
        margin: 0;
        padding: 0 10px 20px 10px;
    }
}

/* Loading animation */
@keyframes hartman-related-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.hartman-related-product-add-to-cart .button.loading::before {
    content: "";
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid #fff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: hartman-related-spin 1s linear infinite;
    margin-right: 8px;
}

/* Fade transition for image hover */
.hartman-related-product-image img {
    opacity: 1;
    transition: opacity 1s ease, transform 1s ease;
}