/**
 * edcategoryshowcase
 *
 * @author    Ernesto Digital <https://ernestodigital.es/>
 * @copyright Ernesto Digital
 * @license   Commercial
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* Section Base */
.ed-category-showcase-section {
    display: block;
    clear: both;
    width: 100%;
    padding: 3rem 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: transparent;
}

.ed-container {
    width: 100%;
    margin-right: auto;
    margin-left: auto;
    padding-right: 15px;
    padding-left: 15px;
}

.ed-container-fluid {
    width: 100%;
    margin-right: auto;
    margin-left: auto;
    padding-right: 30px;
    padding-left: 30px;
}

/* Responsive container widths matching standard theme rules */
@media (min-width: 576px) {
    .ed-container { max-width: 540px; }
}
@media (min-width: 768px) {
    .ed-container { max-width: 720px; }
}
@media (min-width: 992px) {
    .ed-container { max-width: 960px; }
}
@media (min-width: 1200px) {
    .ed-container { max-width: 1140px; }
}

/* Showcase Title uses default theme styles */


/* Category Card */
.ed-category-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none !important;
    background: #ffffff;
    border: 1px solid rgba(17, 24, 39, 0.06);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    cursor: pointer;
}

.ed-category-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 35px rgba(79, 70, 229, 0.08);
    border-color: rgba(79, 70, 229, 0.15);
}

/* Card Image */
.ed-card-img-wrapper {
    position: relative;
    padding-top: 70%; /* Aspect ratio 10:7 */
    overflow: hidden;
    background-color: #f3f4f6;
}

.ed-card-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.ed-category-card:hover .ed-card-img {
    transform: scale(1.08);
}

/* Card Content */
.ed-card-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.ed-card-name {
    font-size: 1.2rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 0.75rem 0;
    line-height: 1.4;
    transition: color 0.25s ease;
}

.ed-category-card:hover .ed-card-name {
    color: #4f46e5;
}

/* Card Meta Badges */
.ed-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.ed-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.65rem;
    border-radius: 8px;
    font-size: 0.775rem;
    font-weight: 500;
    line-height: 1;
}

.ed-badge-subcats {
    background-color: rgba(79, 70, 229, 0.07);
    color: #4f46e5;
}

.ed-badge-products {
    background-color: rgba(16, 185, 129, 0.07);
    color: #10b981;
}

.ed-icon {
    flex-shrink: 0;
}

/* Card Action Text */
.ed-card-action {
    margin-top: auto;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #4f46e5;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    transition: gap 0.25s ease;
}

.ed-action-arrow {
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.ed-category-card:hover .ed-action-arrow {
    transform: translateX(4px);
}

/* Grid Layout */
.ed-grid-wrapper {
    display: grid;
    gap: 1.75rem;
}

/* Grid Columns on desktop */
@media (min-width: 992px) {
    .ed-grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
    .ed-grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
    .ed-grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
    .ed-grid-cols-6 { grid-template-columns: repeat(6, 1fr); }
}

/* Grid columns on tablets */
@media (min-width: 576px) and (max-width: 991.98px) {
    .ed-grid-wrapper {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* Grid columns on mobile */
@media (max-width: 575.98px) {
    .ed-grid-wrapper {
        grid-template-columns: 1fr !important;
        gap: 1.25rem;
    }
}

/* Carousel Layout */
.ed-carousel-wrapper {
    position: relative;
    width: 100%;
}

.ed-carousel-track {
    display: flex;
    gap: 1.75rem;
    overflow-x: auto;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding: 0.5rem 0.25rem 1.5rem 0.25rem;
    scrollbar-width: none; /* Firefox */
}

.ed-carousel-track::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

/* Carousel Item Sizing */
.ed-carousel-wrapper .ed-showcase-item {
    flex: 0 0 100%;
    scroll-snap-align: start;
}

@media (min-width: 576px) {
    .ed-carousel-wrapper .ed-showcase-item {
        flex: 0 0 calc(50% - 0.875rem);
    }
}

@media (min-width: 992px) {
    /* Set sizes according to configured layout spacing */
    .ed-carousel-wrapper .ed-showcase-item {
        flex: 0 0 calc(25% - 1.3125rem); /* Default 4 items */
    }
}

/* Navigation Buttons */
.ed-carousel-btn {
    position: absolute;
    top: calc(50% - 0.75rem);
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    color: #374151;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.25s ease;
    padding: 0;
}

.ed-carousel-btn:hover {
    background-color: #4f46e5;
    color: #ffffff;
    border-color: #4f46e5;
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.25);
}

.ed-carousel-btn:focus {
    outline: none;
}

.ed-carousel-btn-prev {
    left: -22px;
}

.ed-carousel-btn-next {
    right: -22px;
}

@media (max-width: 767.98px) {
    /* Hide nav buttons on small touchscreens, native swipe is better */
    .ed-carousel-btn {
        display: none !important;
    }
    .ed-carousel-track {
        padding-bottom: 0.75rem;
    }
}

/* List Layout */
.ed-list-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ed-list-item {
    display: flex;
    align-items: center;
    padding: 1.25rem 1.5rem;
    background: #ffffff;
    border: 1px solid rgba(17, 24, 39, 0.05);
    border-radius: 14px;
    text-decoration: none !important;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.01);
}

.ed-list-item:hover {
    transform: translateX(4px);
    border-color: rgba(79, 70, 229, 0.15);
    box-shadow: 0 8px 25px rgba(79, 70, 229, 0.05);
}

.ed-list-item-img-wrapper {
    width: 64px;
    height: 64px;
    border-radius: 10px;
    overflow: hidden;
    margin-right: 1.25rem;
    flex-shrink: 0;
    background-color: #f3f4f6;
    border: 1px solid rgba(0,0,0,0.02);
}

.ed-list-item-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ed-list-item-content {
    flex-grow: 1;
    min-width: 0; /* Prevents overflow */
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.ed-list-item-name {
    font-size: 1.15rem;
    font-weight: 600;
    color: #1f2937;
    transition: color 0.25s ease;
}

.ed-list-item:hover .ed-list-item-name {
    color: #4f46e5;
}

.ed-list-item-desc {
    font-size: 0.875rem;
    color: #4b5563;
    margin: 0;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ed-list-meta-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: #6b7280;
    margin-top: 0.15rem;
}

.ed-list-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.ed-list-meta-item svg {
    color: #9ca3af;
}

.ed-list-meta-sep {
    color: #d1d5db;
}

.ed-list-item-arrow {
    color: #9ca3af;
    margin-left: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    flex-shrink: 0;
}

.ed-list-item:hover .ed-list-item-arrow {
    color: #4f46e5;
    transform: translateX(4px);
}
