/*
 * Styles for the Aberhol Product Card
 */

:root {
    --aberhol-color-primary: #02ad41;
    --aberhol-color-primary-hover: #028837;
    --aberhol-color-text: #333333;
    --aberhol-color-text-muted: #999999;
    --aberhol-color-discount: #e65e5e;
    --aberhol-color-border: #e0e0e0;
    --aberhol-spacing-xs: 5px;
    --aberhol-spacing-sm: 10px;
    --aberhol-spacing-md: 15px;
    --aberhol-spacing-lg: 20px;
    --aberhol-radius-sm: 4px;
    --aberhol-radius-md: 8px;
}

/* Grid container */
.aberhol-product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--aberhol-spacing-lg);
}

/* Base card styling */
.aberhol-product-card {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--aberhol-color-border);
    border-radius: var(--aberhol-radius-md);
    overflow: hidden;
    height: 100%; /* Ensure cards have same height */
}

/* Image wrapper */
.aberhol-product-image-wrapper {
    position: relative;
}

.aberhol-product-image-wrapper a {
    display: block;
    position: relative;
}

.aberhol-product-image-wrapper img {
    width: 100%;
    height: auto;
    display: block;
}

/* Discount badge */
.aberhol-discount-badge {
    position: absolute;
    top: var(--aberhol-spacing-sm);
    right: var(--aberhol-spacing-sm);
    background-color: var(--aberhol-color-discount);
    color: #ffffff;
    padding: var(--aberhol-spacing-xs) 8px;
    border-radius: var(--aberhol-radius-sm);
    font-size: 14px;
    font-weight: bold;
    z-index: 1;
}

/* Product info (title) */
.aberhol-product-info {
    padding: var(--aberhol-spacing-md);
    flex-grow: 1; /* Allows this section to grow and push purchase to bottom */
}

.aberhol-product-title a {
    text-decoration: none;
    color: var(--aberhol-color-text);
    font-size: 16px;
    font-weight: 500;
}

/* Purchase section (price and button) */
.aberhol-product-purchase {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 var(--aberhol-spacing-md) var(--aberhol-spacing-md);
    margin-top: auto; /* Pushes to the bottom */
}

/* Price block */
.aberhol-product-price {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.aberhol-regular-price {
    color: var(--aberhol-color-text-muted);
    font-size: 14px;
    text-decoration: line-through;
}

.aberhol-sale-price {
    color: var(--aberhol-color-primary);
    font-size: 18px; /* 14px * 1.25 = 17.5px, rounded to 18px */
    font-weight: bold;
}

/* Add to cart button */
.aberhol-add-to-cart-btn {
    background-color: var(--aberhol-color-primary);
    color: #ffffff;
    border: none !important;
    padding: 8px 12px !important; /* Adjusted padding */
    font-size: 20px; /* Icon size */
    border-radius: var(--aberhol-radius-sm);
    line-height: 1; /* Align icon better */
}

.aberhol-add-to-cart-btn:hover {
    background-color: var(--aberhol-color-primary-hover);
    opacity: 1;
}

/* --- Mobile Styles --- */
@media (max-width: 768px) {
    .aberhol-product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--aberhol-spacing-md);
    }

    .aberhol-product-title a {
        font-size: 12px; /* 16px * 0.75 = 12px */
    }

    .aberhol-regular-price {
        font-size: 11px; /* 14px * 0.75 = 10.5px, rounded to 11px */
    }

    .aberhol-sale-price {
        font-size: 14px; /* 18px * 0.75 = 13.5px, rounded to 14px */
    }

    .aberhol-add-to-cart-btn {
        font-size: 20px; /* 24px * 0.75 = 18px, adjusted to 20px */
    }
}
