/* Base card styling */
.custom-product-card {
    border: 1px solid #e5e5e5;
    padding: 20px;
    border-radius: 8px;
    background: #fff;
}

/* TOP layout (default stacked) */
.custom-product-card.image-top {
    text-align: center;
}

.custom-product-card.image-top img {
    max-width: 100%;
    margin-bottom: 15px;
}

/* SIDE layouts (left / right) */
.custom-product-card.image-side {
    display: flex;
    gap: 20px;
    align-items: stretch; /* allows full-height alignment */
}

/* Image container becomes a vertical flexbox */
.custom-product-card.image-side .image {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
}

/* Image inside side layout */
.custom-product-card.image-side .image img {
    max-width: 180px;
    height: auto;
    display: block;
}

/* LEFT layout */
.custom-product-card.image-side.left .image {
    order: 0;
}

/* RIGHT layout */
.custom-product-card.image-side.right .image {
    order: 2;
}

/* Button under image */
.custom-product-card.image-side .image .image-button {
    display: inline-block;
    padding: 10px 20px;
    background: #0073e6;
    color: #fff;
    border-radius: 4px;
    text-decoration: none;
    margin-top: 12px;
}

/* Hide content button in side layouts */
.custom-product-card.image-side .content .button {
    display: none;
}

/* Content area */
.custom-product-card .content h3 {
    margin-bottom: 10px;
}

.custom-product-card .content .price {
    color: #0073e6;
    font-weight: bold;
    margin-bottom: 15px;
}

.custom-product-card .content .product-desc {
    margin-bottom: 15px;
}

/* -----------------------------------------
   BUTTON ALIGNMENT (controlled via Elementor)
------------------------------------------ */

/* TOP alignment */
.custom-product-card.image-side.button-align-top .image {
    justify-content: flex-start;
}

.custom-product-card.image-side.button-align-top .image .image-button {
    margin-top: 12px;
}

/* CENTER alignment */
.custom-product-card.image-side.button-align-center .image {
    justify-content: center;
}

.custom-product-card.image-side.button-align-center .image .image-button {
    margin-top: 20px;
}

/* BOTTOM alignment */
.custom-product-card.image-side.button-align-bottom .image {
    justify-content: flex-start; /* image stays at top */
}

.custom-product-card.image-side.button-align-bottom .image .image-button {
    margin-top: auto; /* pushes button to bottom of card */
}

/* -----------------------------------------
   RESPONSIVE BEHAVIOR
   Collapse left/right layouts into top layout
------------------------------------------ */
@media (max-width: 768px) {

    .custom-product-card.image-side {
        flex-direction: column;
        text-align: center;
        align-items: center;
    }

    .custom-product-card.image-side .image {
        order: 0 !important;
        margin-bottom: 15px;
        width: 100%;
    }

    .custom-product-card.image-side .image img {
        max-width: 100%;
    }

    .custom-product-card.image-side .content {
        text-align: center;
    }

    /* Reset button alignment on mobile */
    .custom-product-card.image-side .image .image-button {
        margin-top: 15px;
    }
}

/* Even smaller screens */
@media (max-width: 480px) {

    .custom-product-card {
        padding: 15px;
    }

    .custom-product-card .content h3 {
        font-size: 1.1rem;
    }

    .custom-product-card .content .price {
        font-size: 1rem;
    }

    .custom-product-card .content .button,
    .custom-product-card.image-side .image .image-button {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
}
