/* 
 * SEOR Flex Layout Styles
 * This provides the core CSS for the row and column flex system.
 * Highly optimized by using CSS variables set on the element inline.
 */

.seor-flex-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--row-gap, 20px);
    margin-top: var(--row-m-t, 0px) !important;
    margin-bottom: var(--row-m-b, 0px) !important;
    align-items: var(--row-align, stretch);
    justify-content: var(--row-justify, flex-start);
    width: 100%;
    box-sizing: border-box;
}

/* Base column style (Mobile first) */
.seor-flex-col {
    position: relative;
    box-sizing: border-box;
    /* Default to 100% (1) on mobile */
    width: calc(100% * var(--col-m, 1) - var(--row-gap, 20px) * (1 - var(--col-m, 1)));
    max-width: calc(100% * var(--col-m, 1) - var(--row-gap, 20px) * (1 - var(--col-m, 1)));
    flex-grow: 0;
    flex-shrink: 0;
    flex-basis: calc(100% * var(--col-m, 1) - var(--row-gap, 20px) * (1 - var(--col-m, 1)));
}

/* If variable is set to auto or grow, adjust flex behavior */
.seor-flex-col[style*="--col-m: auto"] {
    flex: 0 0 auto;
    width: auto;
    max-width: none;
}

.seor-flex-col[style*="--col-m: grow"] {
    flex: 1 1 0%;
    width: auto;
    max-width: none;
}

.seor-flex-col[style*="--col-m: none"] {
    display: none;
}

/* Tablet Breakpoint (typically > 768px) */
@media (min-width: 768px) {
    .seor-flex-col {
        width: calc(100% * var(--col-t, var(--col-m, 1)) - var(--row-gap, 20px) * (1 - var(--col-t, var(--col-m, 1))));
        max-width: calc(100% * var(--col-t, var(--col-m, 1)) - var(--row-gap, 20px) * (1 - var(--col-t, var(--col-m, 1))));
        flex-basis: calc(100% * var(--col-t, var(--col-m, 1)) - var(--row-gap, 20px) * (1 - var(--col-t, var(--col-m, 1))));
    }

    .seor-flex-col[style*="--col-t: auto"] {
        flex: 0 0 auto;
        width: auto;
        max-width: none;
    }

    .seor-flex-col[style*="--col-t: grow"] {
        flex: 1 1 0%;
        width: auto;
        max-width: none;
    }

    .seor-flex-col[style*="--col-t: none"] {
        display: none;
    }

    /* Show if tablet is explicitly NOT none, even if mobile WAS none */
    .seor-flex-col[style*="--col-t:"]:not([style*="--col-t: none"])[style*="--col-m: none"] {
        display: block;
    }
}

/* Desktop Breakpoint (typically > 1024px) */
@media (min-width: 1024px) {
    .seor-flex-col {
        width: calc(100% * var(--col-d, var(--col-t, var(--col-m, 1))) - var(--row-gap, 20px) * (1 - var(--col-d, var(--col-t, var(--col-m, 1)))));
        max-width: calc(100% * var(--col-d, var(--col-t, var(--col-m, 1))) - var(--row-gap, 20px) * (1 - var(--col-d, var(--col-t, var(--col-m, 1)))));
        flex-basis: calc(100% * var(--col-d, var(--col-t, var(--col-m, 1))) - var(--row-gap, 20px) * (1 - var(--col-d, var(--col-t, var(--col-m, 1)))));
    }

    .seor-flex-col[style*="--col-d: auto"] {
        flex: 0 0 auto;
        width: auto;
        max-width: none;
    }

    .seor-flex-col[style*="--col-d: grow"] {
        flex: 1 1 0%;
        width: auto;
        max-width: none;
    }

    .seor-flex-col[style*="--col-d: none"] {
        display: none;
    }

    /* Show if desktop is explicitly NOT none, even if tablet/mobile WAS none */
    .seor-flex-col[style*="--col-d:"]:not([style*="--col-d: none"])[style*="--col-t: none"],
    .seor-flex-col[style*="--col-d:"]:not([style*="--col-d: none"]):not([style*="--col-t:"])[style*="--col-m: none"] {
        display: block;
    }
}

/* Fix for nested rows */
.seor-flex-col>.seor-flex-row {
    margin-left: 0;
    margin-right: 0;
}

/* Placeholder for testing empty columns */
.seor-flex-col:empty {
    min-height: 150px;
    background-color: rgba(0, 0, 0, 0.08);
    /* Transparent to allow stacking/shading effect */
    border: 1px dashed rgba(0, 0, 255, 0.85);
    opacity: 1;
}

/* Column as a Link */
.seor-flex-col.tiene_link {
    text-decoration: none !important;
    color: inherit !important;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.seor-flex-col.tiene_link:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    z-index: 10;
}

/* Double Notch Animation for Columns (Optional or for Linked columns) */
.seor-flex-col.has-notch-animated,
.seor-flex-col.tiene_link {
    position: relative;
    overflow: hidden;
}

.seor-flex-col.has-notch-animated::before,
.seor-flex-col.has-notch-animated::after,
.seor-flex-col.tiene_link::before,
.seor-flex-col.tiene_link::after {
    content: "";
    position: absolute;
    bottom: 0;
    right: 0;
    pointer-events: none;
    transform-origin: bottom right;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease;
    clip-path: polygon(100% 0, 100% 100%, 0 100%);
    z-index: 99;
    transform: scale(0);
    opacity: 0;
}

.seor-flex-col.has-notch-animated::before,
.seor-flex-col.tiene_link::before {
    width: 150px;
    height: 150px;
    background-color: color-mix(in srgb, var(--wp--preset--color--secondary, var(--wp--preset--color--primary)) 30%, transparent);
}

.seor-flex-col.has-notch-animated::after,
.seor-flex-col.tiene_link::after {
    width: 60px;
    height: 60px;
    background-color: var(--wp--preset--color--secondary, var(--wp--preset--color--primary));
}

.seor-flex-col.has-notch-animated:hover::before,
.seor-flex-col.tiene_link:hover::before {
    transform: scale(1);
    opacity: 1;
}

.seor-flex-col.has-notch-animated:hover::after,
.seor-flex-col.tiene_link:hover::after {
    transform: scale(1);
    opacity: 1;
    transition-delay: 0.1s;
}

/* Ensure inner content is layered correctly if needed */
.seor-flex-col.has-notch-animated > div,
.seor-flex-col.tiene_link > div {
    position: relative;
}
/* UTILITY CLASSES */

/* Reorder column to be last on mobile */
.seor-order-last-mobile {
    order: 99;
}

@media (min-width: 768px) {
    .seor-order-last-mobile {
        order: 0;
    }
}
