/* ================================================
   Gowebix Tools Card — Hybrid Premium Style 2.0
   ================================================ */

/* 1. CARD BASE */
.gwx-tools-card {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 30px;
    box-sizing: border-box;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.35s cubic-bezier(0.4, 0, 0.2, 1), 
                transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                border-color 0.35s ease;
    text-decoration: none;
    color: inherit;
    cursor: default;
}

.gwx-tools-clickable {
    cursor: pointer;
}

/* ===== MODO SERVICIO (icono arriba, más compacto) ===== */
.gwx-tools-mode-service {
    padding: 40px 36px;
    min-height: 320px;
}

.gwx-tools-mode-service .gwx-tools-card-inner {
    padding: 0;
}

/* ===== MODO PRODUCTO (imagen + badge) ===== */
.gwx-tools-mode-product .gwx-tools-card-inner {
    padding: 0 0 28px;
}

/* 2. ELEGANT HOVER */
.gwx-tools-card:not(.gwx-tools-hover-cta):hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px rgba(0, 194, 229, 0.12), 
                0 8px 16px rgba(0, 0, 0, 0.08);
    border-color: #00c2e5;
}

/* 3. CTA BLACK HOVER */
.gwx-tools-hover-cta .gwx-tools-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.65);
    opacity: 0;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    z-index: 1;
    border-radius: 16px;
}

.gwx-tools-hover-cta:hover .gwx-tools-overlay {
    opacity: 1;
}

.gwx-tools-hover-cta:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.12), 
                0 4px 8px rgba(0, 0, 0, 0.06);
    border-color: transparent;
}

/* CTA mode — text colors MEJORADOS */
.gwx-tools-hover-cta:hover .gwx-tools-title {
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.4);
    position: relative;
    z-index: 2;
    font-weight: 700;
}

.gwx-tools-hover-cta:hover .gwx-tools-desc {
    color: #f1f5f9;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
    position: relative;
    z-index: 2;
    line-height: 1.8;
    font-weight: 400;
}

.gwx-tools-hover-cta:hover .gwx-tools-desc,
.gwx-tools-hover-cta:hover .gwx-tools-desc p,
.gwx-tools-hover-cta:hover .gwx-tools-desc span,
.gwx-tools-hover-cta:hover .gwx-tools-desc div,
.gwx-tools-hover-cta:hover .gwx-tools-desc * {
    color: #f8fafc !important;
    opacity: 1 !important;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3) !important;
}

.gwx-tools-hover-cta:hover .gwx-tools-link {
    color: #00e5ff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    position: relative;
    z-index: 2;
    font-weight: 700;
}

.gwx-tools-hover-cta:hover .gwx-tools-icon {
    color: #00c2e5;
    position: relative;
    z-index: 2;
    text-shadow: 0 2px 8px rgba(0, 194, 229, 0.4);
}

.gwx-tools-hover-cta:hover .gwx-tools-badge {
    background: linear-gradient(135deg, #00d4f5 0%, #00c2e5 100%);
    box-shadow: 0 4px 16px rgba(0, 194, 229, 0.5);
    position: relative;
    z-index: 2;
}

.gwx-tools-hover-cta:hover .gwx-tools-image-wrap {
    border-color: rgba(255, 255, 255, 0.15);
    position: relative;
    z-index: 2;
}

/* 4. INNER */
.gwx-tools-card-inner {
    display: flex;
    flex-direction: column;
    flex: 1;
    position: relative;
    z-index: 2;
}

/* 5. BADGE (modo producto) */
.gwx-tools-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    margin: 20px 24px 0;
    background: linear-gradient(135deg, #00c2e5 0%, #00a8c7 100%);
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border-radius: 20px;
    width: fit-content;
    box-shadow: 0 2px 8px rgba(0, 194, 229, 0.3);
    position: relative;
    z-index: 3;
    transition: all 0.3s ease;
}

/* 6. ICON (modo servicio) */
.gwx-tools-icon {
    font-size: 38px;
    color: #00c2e5;
    margin-bottom: 18px;
    line-height: 1;
    transition: color 0.3s ease, transform 0.3s ease;
}

.gwx-tools-card:hover .gwx-tools-icon {
    transform: scale(1.1);
}

/* 7. IMAGE WRAP (modo producto) */
.gwx-tools-image-wrap {
    margin: 16px 24px 20px;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    transition: border-color 0.3s ease;
}

.gwx-tools-image-wrap::before {
    content: "";
    display: block;
    padding-top: 56.25%; /* 16:9 */
}

.gwx-tools-image-wrap img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.gwx-tools-card:hover .gwx-tools-image-wrap img {
    transform: scale(1.08);
}

/* 8. TITLE */
.gwx-tools-title {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.3;
    margin: 0 24px 12px;
    color: #0f172a;
    transition: color 0.3s ease;
    position: relative;
}

.gwx-tools-mode-service .gwx-tools-title {
    margin: 0 0 12px;
}

.gwx-tools-card:not(.gwx-tools-hover-cta):hover .gwx-tools-title {
    color: #00c2e5;
}

/* 9. DESCRIPTION — TRUNCATE */
.gwx-tools-truncate .gwx-tools-desc {
    font-size: 15px;
    line-height: 1.7;
    color: #64748b;
    margin: 0 24px 20px;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.gwx-tools-mode-service.gwx-tools-truncate .gwx-tools-desc {
    margin: 0 0 20px;
}

/* DESCRIPTION — FULL TEXT */
.gwx-tools-card:not(.gwx-tools-truncate) .gwx-tools-desc {
    font-size: 15px;
    line-height: 1.7;
    color: #64748b;
    margin: 0 24px 20px;
    flex-grow: 1;
}

.gwx-tools-mode-service:not(.gwx-tools-truncate) .gwx-tools-desc {
    margin: 0 0 20px;
}

.gwx-tools-desc p {
    margin: 0 0 12px;
}

.gwx-tools-desc p:last-child {
    margin-bottom: 0;
}

/* 10. LINK */
.gwx-tools-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 24px;
    padding: 10px 0;
    font-size: 14px;
    font-weight: 600;
    color: #00c2e5;
    transition: color 0.25s ease, gap 0.25s ease;
    width: fit-content;
    text-decoration: none;
    position: relative;
}

.gwx-tools-mode-service .gwx-tools-link {
    margin: 0;
}

.gwx-tools-link::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 6px;
    width: 0;
    height: 2px;
    background: currentColor;
    transition: width 0.3s ease;
}

.gwx-tools-link:hover::after {
    width: 100%;
}

.gwx-tools-link svg {
    transition: transform 0.25s ease;
}

.gwx-tools-link:hover svg {
    transform: translateX(4px);
}

/* Full card link — no underline */
.gwx-tools-clickable .gwx-tools-link::after {
    display: none;
}

/* 11. EQUAL HEIGHT */
.vc_row.vc_row-o-equal-height .gwx-tools-card,
.vc_row.vc_equal-height .gwx-tools-card {
    height: 100%;
}

.vc_row.vc_row-o-equal-height .wpb_wrapper,
.vc_row.vc_equal-height .wpb_wrapper {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.vc_row.vc_row-o-equal-height .wpb_wrapper > .gwx-tools-card,
.vc_row.vc_equal-height .wpb_wrapper > .gwx-tools-card {
    flex: 1;
}

/* 12. RESPONSIVE */
@media (max-width: 768px) {
    .gwx-tools-card {
        border-radius: 12px;
        margin-bottom: 20px;
    }
    
    .gwx-tools-mode-service {
        padding: 30px 22px;
        min-height: auto;
    }
    
    .gwx-tools-mode-product .gwx-tools-card-inner,
    .gwx-tools-mode-service .gwx-tools-card-inner {
        padding-bottom: 22px;
    }
    
    .gwx-tools-badge {
        margin: 16px 18px 0;
        padding: 5px 12px;
        font-size: 10px;
    }
    
    .gwx-tools-icon {
        font-size: 32px;
        margin-bottom: 14px;
    }
    
    .gwx-tools-image-wrap {
        margin: 12px 18px 16px;
        border-radius: 10px;
    }
    
    .gwx-tools-title {
        font-size: 18px;
        margin: 0 18px 10px;
    }
    
    .gwx-tools-mode-service .gwx-tools-title {
        margin: 0 0 10px;
    }
    
    .gwx-tools-desc {
        margin: 0 18px 16px !important;
        font-size: 14px;
    }
    
    .gwx-tools-mode-service .gwx-tools-desc {
        margin: 0 0 16px !important;
    }
    
    .gwx-tools-link {
        margin: 0 18px;
    }
    
    .gwx-tools-mode-service .gwx-tools-link {
        margin: 0;
    }
    
    .gwx-tools-hover-cta:hover .gwx-tools-overlay {
        opacity: 0.92;
    }
}

/* 13. DARK MODE */
@media (prefers-color-scheme: dark) {
    .gwx-tools-card {
        background: #1e293b;
        border-color: #334155;
    }
    
    .gwx-tools-card:not(.gwx-tools-hover-cta):hover {
        border-color: #00c2e5;
    }
    
    .gwx-tools-title {
        color: #f1f5f9;
    }
    
    .gwx-tools-desc {
        color: #94a3b8;
    }
    
    .gwx-tools-image-wrap {
        background: #0f172a;
        border-color: #334155;
    }
}