.ecoc-cards-grid {
    display: grid;
    grid-template-columns: repeat(var(--ecoc-cols-desktop, 3), 1fr);
    gap: var(--ecoc-gap, 30px);
    width: 100%;
    box-sizing: border-box;
}

.ecoc-card {
    position: relative;
    overflow: hidden;
    display: block;
    width: 100%;
    text-decoration: none !important;
    color: inherit;
    box-sizing: border-box;
    z-index: 1;
}

/* Aspect Ratios */
.portrait-3-4 .ecoc-card {
    aspect-ratio: 3 / 4;
}

.portrait-2-3 .ecoc-card {
    aspect-ratio: 2 / 3;
}

.square .ecoc-card {
    aspect-ratio: 1 / 1;
}

.landscape-16-9 .ecoc-card {
    aspect-ratio: 16 / 9;
}

/* Standard height fallbacks if aspect-ratio is not supported */
@supports not (aspect-ratio: 1/1) {
    .portrait-3-4 .ecoc-card { height: 480px; }
    .portrait-2-3 .ecoc-card { height: 520px; }
    .square .ecoc-card { height: 380px; }
    .landscape-16-9 .ecoc-card { height: 260px; }
}

/* Image Wrapper and Image */
.ecoc-card-image-wrap {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.ecoc-card-image-wrap img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center;
    transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

/* Hover Zoom Effect */
.ecoc-zoom-hover .ecoc-card:hover .ecoc-card-image-wrap img {
    transform: scale(1.06);
}

/* Overlay Top & Bottom Gradient */
.ecoc-card-overlay-top {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 40%;
    z-index: 2;
    pointer-events: none;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.45) 0%, rgba(0, 0, 0, 0) 100%);
}

.ecoc-card-overlay-bottom {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60%;
    z-index: 2;
    pointer-events: none;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0) 100%);
}

/* Top-Right Number Positioning */
.ecoc-card-number {
    position: absolute;
    top: 28px;
    right: 28px;
    z-index: 3;
    color: rgba(255, 255, 255, 0.7);
    font-size: 19px;
    font-weight: 700;
    font-family: inherit;
    line-height: 1;
}

/* Bottom Content Positioning */
.ecoc-card-content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 32px 28px;
    z-index: 3;
    box-sizing: border-box;
    text-align: right; /* Default matches user screenshot */
}

/* Title & Description styles */
.ecoc-card-title {
    margin: 0 0 6px 0;
    padding: 0;
    color: #ffffff;
    font-size: 26px;
    font-weight: 700;
    line-height: 1.25;
    font-family: inherit;
}

.ecoc-card-description {
    margin: 0;
    padding: 0;
    color: rgba(255, 255, 255, 0.85);
    font-size: 15px;
    font-weight: 400;
    line-height: 1.5;
    font-family: inherit;
}

/* Tablets (1024px and below) */
@media (max-width: 1024px) {
    .ecoc-cards-grid {
        grid-template-columns: repeat(var(--ecoc-cols-tablet, 2), 1fr);
        gap: 20px;
    }
    
    .ecoc-card-content {
        padding: 24px;
    }
    
    .ecoc-card-title {
        font-size: 22px;
    }
    
    .ecoc-card-description {
        font-size: 14px;
    }
    
    .ecoc-card-number {
        top: 22px;
        right: 22px;
        font-size: 17px;
    }
}

/* Mobiles (767px and below) */
@media (max-width: 767px) {
    .ecoc-cards-grid {
        grid-template-columns: repeat(var(--ecoc-cols-mobile, 1), 1fr);
        gap: 16px;
    }

    .portrait-3-4 .ecoc-card,
    .portrait-2-3 .ecoc-card {
        aspect-ratio: 4 / 5; /* Slightly taller for smaller viewports */
    }

    .ecoc-card-content {
        padding: 20px;
    }

    .ecoc-card-title {
        font-size: 20px;
        margin-bottom: 4px;
    }

    .ecoc-card-description {
        font-size: 13px;
        line-height: 1.4;
    }

    .ecoc-card-number {
        top: 18px;
        right: 18px;
        font-size: 16px;
    }
}
