/**
 * CRM & ERP Features Module Plugin - Frontend Stylesheet
 * Scoped under .crm-mod-wrap and .crm-mod-modal-overlay
 * Safe isolation with zero leaks to theme or WP core.
 */

:root {
    --crm-primary: #8A2DF8;
    --crm-primary-hover: #e05d0e;.crm-mod-btn-outline
    --crm-text-dark: #0f172a;
    --crm-text-muted: #64748b;
    --crm-border-color: #e2e8f0;
    --crm-bg-soft: #f8fafc;
    --crm-card-shadow: 0 4px 16px rgba(15, 23, 42, 0.05);
    --crm-card-shadow-hover: 0 10px 28px rgba(15, 23, 42, 0.12);
}

/* Reset inside wrapper */
.crm-mod-wrap {
    font-family: outfit;
    color: var(--crm-text-dark);
    line-height: 1.5;
    box-sizing: border-box;
    width: 100%;
    margin: 40px auto;
    max-width: 1240px;
    padding: 0 20px;
}

.crm-mod-wrap *,
.crm-mod-wrap *::before,
.crm-mod-wrap *::after,
.crm-mod-modal-overlay *,
.crm-mod-modal-overlay *::before,
.crm-mod-modal-overlay *::after {
    box-sizing: border-box;
}

/* Section Header */
.crm-mod-header {
    text-align: center;
    margin-bottom: 42px;
}
span.crm-mod-pkg-check {
    color: #8A2DF8 !important;
}
.crm-mod-main-title {
    font-size: 38px;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 12px 0;
    letter-spacing: -0.5px;
    line-height: 1.2;
}
h4.crm-mod-pkg-title {
    color: #8A2DF8 !important;
}
.crm-mod-main-subtitle {
    font-size: 16px;
    color: #64748b;
    margin: 0 auto;
    max-width: 680px;
    line-height: 1.6;
}

/* Main 2-Column Container */
.crm-mod-header {
    display: none;
}
.crm-mod-container {
    display: grid;
    grid-template-columns: 4.8fr 5.2fr;
    gap: 40px;
    align-items: start;
}

.crm-mod-col-title {
    font-size: 20px;
    font-weight: 700;
    color: #000000;
    margin: 0 0 22px 0;
    text-align: center;
}

/* Left Column: ERP Modules 3x4 Grid */
.crm-mod-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}
.crm-mod-column.crm-mod-right-col {
    width: 640px;
}
.crm-mod-column.crm-mod-left-col {
    width: 400px;
}
.crm-mod-card {
    background: #ffffff;
    border: 1px solid #f1f5f9;
    border-radius: 16px;
    padding: 24px 14px 20px 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--crm-card-shadow);
    transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.22s ease, border-color 0.22s ease;
    text-align: center;
    position: relative;
    width: 100%;
    min-height: 112px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.crm-mod-card:hover,
.crm-mod-card:focus-visible {
    transform: translateY(-4px);
    box-shadow: var(--crm-card-shadow-hover);
    border-color: #e2e8f0;
}

.crm-mod-card:active {
    transform: translateY(-1px);
}

.crm-mod-card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    height: 48px;
    width: 48px;
}

.crm-mod-card-icon svg {
    max-width: 100%;
    max-height: 100%;
    display: block;
}

.crm-mod-card-icon img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}

.crm-mod-card-title {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
}

/* Right Column: Total Package 2x2 Grid */
.crm-mod-package-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
}

.crm-mod-pkg-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 20px 22px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.crm-mod-pkg-title {
    font-size: 17px;
    font-weight: 700;
    margin: 0 0 14px 0;
    line-height: 1.3;
}

.crm-mod-pkg-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
}

.crm-mod-pkg-list li {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    color: #334155;
    line-height: 1.4;
}

.crm-mod-pkg-check {
    font-weight: 700;
    font-size: 13px;
    flex-shrink: 0;
}

.crm-mod-pkg-text {
    font-weight: 500;
}

/* ==========================================================================
   MODAL LIGHTBOX
   ========================================================================== */
.crm-mod-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.68);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.crm-mod-modal-overlay.crm-mod-is-open {
    opacity: 1;
    visibility: visible;
}

.crm-mod-modal-container {
    background: #ffffff;
    border-radius: 18px;
    width: 100%;
    max-width: 1040px;
    max-height: 90vh;
    box-shadow: 0 25px 65px rgba(0, 0, 0, 0.28);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    transform: scale(0.95) translateY(12px);
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.crm-mod-modal-overlay.crm-mod-is-open .crm-mod-modal-container {
    transform: scale(1) translateY(0);
}

/* Modal Header */
.crm-mod-modal-header {
    padding: 24px 32px 18px 32px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    border-bottom: 1px solid #f1f5f9;
}

.crm-mod-modal-title {
    font-size: 28px;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 4px 0;
    line-height: 1.2;
}

.crm-mod-modal-tagline {
    font-size: 14.5px;
    color: #64748b;
    margin: 0;
    line-height: 1.4;
}

.crm-mod-modal-close {
    background: transparent;
    border: none;
    cursor: pointer;
    color: #64748b;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.18s ease, color 0.18s ease;
    padding: 0;
    margin-left: 16px;
    flex-shrink: 0;
}

.crm-mod-modal-close:hover {
    background: #f1f5f9;
    color: #0f172a;
}

/* Modal Body */
.crm-mod-modal-body {
    padding: 24px 32px;
    display: flex;
    gap: 30px;
    overflow-y: auto;
    flex: 1 1 auto;
    align-items: stretch;
}

/* Left Column: Feature Tabs */
.crm-mod-tabs-col {
    width: 38%;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}

.crm-mod-tabs-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.crm-mod-tab-btn {
    background: transparent;
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 12px 16px;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 13.5px;
    line-height: 1.45;
    color: #475569;
    font-weight: 500;
    transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, color 0.18s ease;
    outline: none;
    width: 100%;
}

.crm-mod-tab-btn:hover {
    background: #f8fafc;
    color: #1e293b;
}

.crm-mod-tab-check {
    font-size: 15px;
    font-weight: 700;
    color: #cbd5e1;
    margin-top: 1px;
    flex-shrink: 0;
    transition: color 0.18s ease;
}

/* Active Tab (matches screenshot 2) */
.crm-mod-tab-btn.crm-mod-active {
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    color: #0f172a;
    font-weight: 700;
}

.crm-mod-tab-btn.crm-mod-active .crm-mod-tab-check {
    color: var(--crm-primary, #8A2DF8);
}

/* Right Column: Preview Showcase */
.crm-mod-preview-col {
    width: 62%;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
}

.crm-mod-showcase-box {
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 22px 20px 18px 20px;
    background: #fafbfc;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.02);
}

.crm-mod-preview-heading {
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
    text-align: center;
    margin-bottom: 16px;
    min-height: 24px;
    line-height: 1.4;
}

.crm-mod-slider-viewport {
    position: relative;
    width: 100%;
    min-height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    overflow: hidden;
}

.crm-mod-slides-track {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.crm-mod-slide-item {
    width: 100%;
    display: none;
    opacity: 0;
    transition: opacity 0.25s ease-in-out;
}

.crm-mod-slide-item.crm-mod-active {
    display: block;
    opacity: 1;
}

.crm-mod-slide-item img {
    width: 100%;
    height: auto;
    max-height: 380px;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    display: block;
}

.crm-mod-slide-item svg {
    width: 100%;
    height: auto;
    max-height: 380px;
    display: block;
}

/* Navigation Chevrons */
.crm-mod-nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #8A2DF8, 
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    color:  #8A2DF8;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    padding: 0;
    transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
    outline: none;
}

.crm-mod-nav-arrow:hover {
    background: #000;
    transform: translateY(-50%) scale(1.08);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}

.crm-mod-prev-arrow {
    left: -8px;
}

.crm-mod-next-arrow {
    right: -8px;
}

/* Pagination Dots */
.crm-mod-dots {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 18px;
}

.crm-mod-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #cbd5e1;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.crm-mod-dot.crm-mod-active {
    background: var(--crm-primary, #8A2DF8);
    transform: scale(1.25);
}

/* Modal Footer */
.crm-mod-modal-footer {
    padding: 18px 32px;
    display: flex;
    align-items: center;
    gap: 14px;
    border-top: 1px solid #f1f5f9;
    background: #ffffff;
}

.crm-mod-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 14.5px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
    border: 1.5px solid transparent;
    line-height: 1.3;
}

.crm-mod-btn-primary {
    background:  #8A2DF8;
    color: #ffffff; 
}

.crm-mod-btn-primary:hover,
.crm-mod-btn-primary:focus {
    background: var(--crm-primary-hover, #e05d0e);
    border-color: var(--crm-primary-hover, #e05d0e);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(243, 112, 33, 0.3);
}

.crm-mod-btn-outline {
    background: transparent;
    color:  #8A2DF8;
    border-color:#8A2DF8;
}

.crm-mod-btn-outline:hover, .crm-mod-btn-outline:focus {
    background: #fff7ed;
    color: #8A2DF8;
    border-color: #8A2DF8;
}
/* ==========================================================================
   RESPONSIVE BREAKPOINTS
   ========================================================================== */
@media (max-width: 1024px) {
    .crm-mod-container {
        grid-template-columns: 1fr;
        gap: 36px;
    }

    .crm-mod-left-col {
        max-width: 600px;
        margin: 0 auto;
        width: 100%;
    }

    .crm-mod-modal-body {
        gap: 20px;
    }

    .crm-mod-tabs-col {
        width: 42%;
    }

    .crm-mod-preview-col {
        width: 58%;
    }
}

@media (max-width: 768px) {
    .crm-mod-wrap {
        padding: 0 14px;
        margin: 24px auto;
    }

    .crm-mod-main-title {
        font-size: 28px;
    }

    .crm-mod-main-subtitle {
        font-size: 14.5px;
    }

    .crm-mod-package-grid {
        grid-template-columns: 1fr;
    }

    /* Modal Mobile Stack */
    .crm-mod-modal-container {
        max-height: 94vh;
        width: 96%;
        border-radius: 14px;
    }

    .crm-mod-modal-header {
        padding: 16px 20px;
    }

    .crm-mod-modal-title {
        font-size: 22px;
    }

    .crm-mod-modal-body {
        flex-direction: column;
        padding: 16px 18px;
        gap: 20px;
        overflow-y: auto;
    }

    .crm-mod-tabs-col {
        width: 100%;
    }

    .crm-mod-tabs-list {
        display: grid;
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .crm-mod-tab-btn {
        padding: 10px 14px;
        font-size: 13px;
    }

    .crm-mod-preview-col {
        width: 100%;
    }

    .crm-mod-showcase-box {
        padding: 16px 12px 14px 12px;
    }

    .crm-mod-prev-arrow {
        left: -4px;
    }

    .crm-mod-next-arrow {
        right: -4px;
    }

    .crm-mod-modal-footer {
        padding: 14px 20px;
    }

    .crm-mod-btn {
        flex: 1;
        text-align: center;
        padding: 10px 16px;
    }
}

@media (max-width: 480px) {
    .crm-mod-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .crm-mod-card {
        padding: 18px 10px 16px 10px;
        min-height: 100px;
    }

    .crm-mod-card-icon {
        height: 40px;
        width: 40px;
        margin-bottom: 8px;
    }

    .crm-mod-card-title {
        font-size: 13px;
    }
}
@media (max-width: 768px) {
    .crm-mod-column.crm-mod-right-col {
        width:100%;
    }
    .crm-mod-column.crm-mod-left-col {
      width:100%;
    }
}