/* CMS Admin Styles - Full Dashboard Update */
body:not(.cms-edit-mode) .cms-prod-ctrl,
body:not(.cms-edit-mode) .cms-add-prod-row,
body:not(.cms-edit-mode) .cms-add-dl-item,
body:not(.cms-edit-mode) #cms-global-image-edit-btn,
body:not(.cms-edit-mode) .cms-file-picker-btn {
    display: none !important;
}

#cms-admin-bar {
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    height: 46px;
    background: #1e2830 !important;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    z-index: 100000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    border-bottom: 2px solid #d11f26;
}

body.cms-edit-mode, body.cms-preview-mode {
    padding-top: 46px !important;
}

/* Keep the sticky site-header below the CMS bar on scroll (prevents logo overlap) */
body.cms-edit-mode .ttm-stickable-header.fixed-header,
body.cms-preview-mode .ttm-stickable-header.fixed-header {
    top: 46px !important;
}

.cms-mode-indicator {
    background: #f1c40f !important;
    color: #000 !important;
    padding: 4px 14px !important;
    border-radius: 50px !important;
    font-weight: 700 !important;
    font-size: 0.72rem !important;
    text-transform: uppercase !important;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* ── LAYOUT STABILITY & CMS OVERRIDES ── */

/* Lock Heading Sizes (User Request: Fix Size Always) */
[data-cms="hero-title"] {
    font-size: 40px !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    text-transform: uppercase !important;
}
[data-cms="hero-subtitle"] {
    font-size: 1.1rem !important;
    font-weight: 600 !important;
    letter-spacing: 1px !important;
    text-transform: uppercase !important;
}

.ttm-bgcolor-darkgrey [data-cms],
.application-type [data-cms] {
    color: #ffffff !important;
}
/* Exception for market flat cards (white card on dark bg — text must stay dark) */
.ttm-bgcolor-darkgrey .market-flat-card .mfc-label,
.ttm-bgcolor-darkgrey [data-cms].market-flat-card .mfc-label,
.ttm-bgcolor-darkgrey .market-flat-card [data-cms].mfc-label {
    color: #1d2535 !important;
}
.ttm-bgcolor-darkgrey .market-flat-card .mfc-icon i,
.ttm-bgcolor-darkgrey [data-cms].market-flat-card .mfc-icon i,
.ttm-bgcolor-darkgrey .market-flat-card [data-cms] .mfc-icon i {
    color: #e8192c !important;
}
.ttm-bgcolor-darkgrey .market-flat-card:hover .mfc-label,
.ttm-bgcolor-darkgrey [data-cms].market-flat-card:hover .mfc-label {
    color: #fff !important;
}
.ttm-bgcolor-darkgrey .market-flat-card:hover .mfc-icon i,
.ttm-bgcolor-darkgrey [data-cms].market-flat-card:hover .mfc-icon i {
    color: #fff !important;
}
/* Exception for FAQ answers on white background */
.ttm-bgcolor-darkgrey .faq-answer,
.ttm-bgcolor-darkgrey .faq-answer * {
    color: #222222 !important;
}
.ttm-bgcolor-darkgrey .section-intro {
    color: rgba(255,255,255,0.9) !important;
}

/* Fix Distortion Bug (User Request: Dynamic sections collapsing) */
[data-cms-wrapper] {
    display: contents !important; /* Prevents wrapper div from breaking Bootstrap Grid/Flex */
}
.tab-pane.active {
    min-height: 300px; /* Prevents height collapse during editing */
}

/* ────────────────────────────────────── */

.cms-brand-text {
    color: #d11f26;
    font-weight: 800;
    font-size: 0.8rem;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 40%;
    flex-shrink: 1;
}

.cms-mode-indicator {
    background: #4caf50;
    color: white;
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 1px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: background 0.3s;
}

.cms-mode-indicator.preview-mode {
    background: #ffc107;
    color: #000;
}

/* Admin Actions */
.cms-admin-actions {
    display: flex;
    gap: 10px;
}

/* Sub-Application Link Cards UI (Image 1 Alignment) */
.sub-app-links {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 25px;
    max-width: 550px;
}

.sub-app-link-card {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    background: #f1f6fa;
    border: 1px solid #d1e1f1;
    border-radius: 8px;
    text-decoration: none !important;
    transition: all 0.2s ease;
}

.sub-app-link-card i {
    color: #e8192c;
    margin-right: 18px;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.sub-app-link-card span {
    color: #1a1a1a;
    font-weight: 700;
    font-size: 0.95rem;
    line-height: 1.4;
}

.sub-app-link-card:hover {
    background: #e9f2f9;
    transform: translateX(5px);
    border-color: #b8cedf;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.sub-app-link-card.active {
    background: #dde9f1;
    border-color: #c4d7e6;
}


.sub-app-link-card.active i {
    color: #b01a20;
}

/* ── CMS CHECK LIST (Auto-Bullets) ── */
/* User Request: Press Enter and get a red checkmark automatically */
.cms-check-list {
    list-style: none !important;
    padding-left: 0 !important;
}

.cms-check-list li {
    position: relative;
    padding-left: 30px !important;
    margin-bottom: 12px !important;
    color: rgba(255,255,255,0.8);
    line-height: 1.6;
}

.cms-check-list li::before {
    content: "\f00c"; /* FontAwesome Check icon */
    font-family: "FontAwesome";
    position: absolute;
    left: 0;
    top: 2px;
    color: #e8192c; /* Theme Red */
    font-size: 14px;
    font-weight: 300;
}

.cms-check-list li strong {
    color: #ffffff;
    margin-right: 5px;
}


.cms-btn {
    border: none;
    border-radius: 4px;
    padding: 5px 12px;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 6px;
    color: white;
}

.cms-btn i {
    font-size: 1rem;
}

.cms-btn-save {
    background-color: #28a745;
}

.cms-btn-save:hover {
    background-color: #218838;
}

.cms-btn-reset {
    background-color: #6c757d;
}

.cms-btn-reset:hover {
    background-color: #5a6268;
}

.cms-btn-dashboard {
    background-color: #343a40;
}

.cms-btn-dashboard:hover {
    background-color: #23272b;
}

.cms-btn-preview {
    background-color: #d11f26;
}

.cms-btn-preview:hover {
    background-color: #b01a20;
}

.cms-btn-logout {
    background-color: #212529;
}

.cms-btn-logout:hover {
    background-color: #000;
}

/* Dashboard Modal */
.cms-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 2000000; /* Ensure dashboard is above the global image edit button (1,000,000) */
    justify-content: center;
    align-items: center;
    font-family: 'Rubik', sans-serif;
}

.cms-dashboard-container {
    background: white;
    width: 1000px;
    max-width: 95%;
    height: 600px;
    border-radius: 12px;
    display: flex;
    overflow: hidden;
    position: relative;
}

/* Sidebar */
.cms-sidebar {
    width: 250px;
    flex-shrink: 0;
    background: #f8f9fa;
    border-right: 1px solid #eee;
    padding: 20px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.cms-sidebar h3 {
    font-size: 1.2rem;
    color: #d11f26;
    margin-bottom: 2px;
    font-weight: 800;
    text-transform: uppercase;
}

.cms-sidebar .sub-text {
    font-size: 0.7rem;
    color: #777;
    text-transform: uppercase;
    margin-bottom: 20px;
    display: block;
}

.cms-select-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: #999;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.cms-page-select {
    width: 100%;
    padding: 8px;
    border-radius: 5px;
    border: 1px solid #ddd;
    margin-bottom: 20px;
}

.cms-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    flex-grow: 1;
}

.cms-menu-item {
    padding: 10px 15px;
    margin-bottom: 5px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #444;
    font-weight: 600;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.cms-menu-item:hover {
    background: #f0f0f0;
}

.cms-menu-item.active {
    background: #d11f26;
    color: white;
}

.cms-sidebar-footer {
    border-top: 1px solid #eee;
    padding-top: 20px;
}

.cms-main-content {
    flex-grow: 1;
    padding: 30px;
    display: flex;
    flex-direction: column;
    min-width: 0;
    /* CRITICAL for preventing flexbox blowout on horizontal scrolls */
    overflow-y: auto;
    /* Allow the main content area to scroll vertically */
}

/* Scrollable Container inside Tabs */
.cms-tab-scroll {
    overflow-y: auto;
    overflow-x: hidden;
    flex-grow: 1;
    padding-right: 5px;
}

.cms-content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.cms-content-header h2 {
    font-weight: 700;
    text-transform: uppercase;
    font-size: 1.3rem;
    margin: 0;
}

.cms-close-btn {
    cursor: pointer;
    font-size: 1.5rem;
    color: #999;
}

/* Stats Cards */
.cms-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.cms-stat-card {
    padding: 20px;
    border-radius: 10px;
    background: #fff5f5;
    border: 1px solid #ffe3e3;
}

.cms-stat-label {
    font-size: 0.65rem;
    font-weight: 700;
    color: #d11f26;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.cms-stat-value {
    font-size: 1.4rem;
    font-weight: 800;
    color: #222;
}

/* Quick Actions */
.cms-quick-actions {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 30px;
}

.cms-quick-actions h4 {
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 20px;
    text-transform: uppercase;
}

.cms-actions-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

.cms-action-card {
    background: white;
    padding: 16px 10px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition: transform 0.2s;
}

.cms-action-card:hover {
    transform: translateY(-5px);
}

.cms-action-card i {
    font-size: 1.5rem;
    margin-bottom: 8px;
    display: block;
}

.cms-action-card span {
    display: block;
    font-weight: 700;
    font-size: 0.8rem;
}

.cms-action-card small {
    color: #999;
    font-size: 0.65rem;
}

/* Scrollbar */
.cms-sidebar::-webkit-scrollbar {
    width: 5px;
}

.cms-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.cms-sidebar::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 10px;
}

/* Real-time Editing Helper */
.cms-edit-mode [data-cms] {
    transition: outline 0.2s ease, background-color 0.2s ease;
}

.cms-edit-mode [data-cms]:hover {
    outline: 1px dashed rgba(255, 255, 255, 0.3) !important;
    outline-offset: 4px;
    cursor: text;
}

.cms-edit-mode img[data-cms]:hover {
    outline: 2px solid #d11f26 !important;
    cursor: pointer;
}

.cms-edit-mode [data-cms]:focus {
    outline: none !important;
    background-color: rgba(255, 255, 255, 0.05);
}

.cms-image-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(209, 31, 38, 0.95);
    color: white;
    padding: 10px 15px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    z-index: 100000;
    display: none;
    pointer-events: auto;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    white-space: nowrap;
    cursor: pointer;
}

body.cms-admin-active {
    padding-top: 46px !important;
}
body.cms-admin-active .ttm-stickable-header.fixed-header {
    top: 46px !important;
}

/* Dashboard Forms */
.cms-form-group {
    margin-bottom: 25px;
    background: #fdfdfd;
    padding: 15px;
    border: 1px solid #eee;
    border-radius: 8px;
}

.cms-form-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    font-weight: 800;
    color: #666;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.cms-form-label span {
    color: #aaa;
    font-weight: 500;
}

.cms-input,
.cms-textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.2s;
    background: white;
    color: #222; /* Ensure text is always dark on white background */
    direction: ltr !important;
    text-align: left !important;
}

[contenteditable="true"] {
    outline: none !important;
    direction: ltr !important;
    text-align: inherit !important;
    unicode-bidi: isolate !important;
}

[contenteditable="true"]:focus {
    outline: none !important;
    background: rgba(209, 31, 38, 0.05); /* Very faint red tint to show focus */
}

.cms-input:focus,
.cms-textarea:focus {
    border-color: #d11f26;
    outline: none;
    box-shadow: 0 0 0 3px rgba(209, 31, 38, 0.1);
}

.cms-textarea {
    min-height: 100px;
    resize: vertical;
}

.cms-media-preview-box {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 5px;
}

.cms-media-thumb {
    width: 120px;
    height: 80px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #ddd;
}

.cms-media-actions {
    flex-grow: 1;
}

.cms-media-actions .cms-input {
    margin-bottom: 10px;
    font-size: 0.85rem;
    color: #666;
}

/* Empty State */
.cms-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #777;
    background: #f8f9fa;
    border-radius: 10px;
    border: 1px dashed #ddd;
}

.cms-empty-state i {
    font-size: 3rem;
    margin-bottom: 15px;
    color: #ccc;
}

#cms-tab-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.cms-tab-scroll {
    flex-grow: 1;
    overflow-y: auto;
    padding-right: 15px;
    height: 100%;
}

.cms-tab-scroll::-webkit-scrollbar {
    width: 5px;
}

.cms-tab-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.cms-tab-scroll::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 10px;
}

/* History Table */
.cms-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    color: #555;
    font-size: 0.95rem;
}

.cms-history-table-wrapper {
    border: 1px solid #eee;
    border-radius: 8px;
    background: white;
}

.cms-history-table {
    width: 100%;
    border-collapse: collapse;
}

.cms-history-table th {
    background: #fdfdfd;
    color: #999;
    font-size: 0.75rem;
    font-weight: 800;
    text-align: left;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    text-transform: uppercase;
}

.cms-history-table td {
    padding: 20px;
    border-bottom: 1px solid #f5f5f5;
    vertical-align: middle;
}

.cms-history-table tr:last-child td {
    border-bottom: none;
}

.cms-btn-restore {
    background: #f4f4f4;
    color: #555;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.cms-btn-restore:hover {
    background: #e9e9e9;
    color: #d11f26;
}

/* Bespoke Dashboard Modules */
.cms-module-title {
    font-size: 0.7rem;
    font-weight: 800;
    color: #999;
    text-transform: uppercase;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.cms-module-card {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 15px;
    position: relative;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 20px;
}

.cms-module-card:hover {
    border-color: #d11f26;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.cms-module-card .number-badge {
    width: 32px;
    height: 32px;
    background: #f8f9fa;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: #ccc;
    font-size: 0.8rem;
}

.cms-module-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.cms-hero-bg-preview {
    width: 200px;
    height: 120px;
    border-radius: 8px;
    background-size: cover;
    background-position: center;
    border: 1px solid #ddd;
    margin-bottom: 10px;
}

.cms-add-btn {
    float: right;
    background: #d11f26;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.75rem;
    cursor: pointer;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 20px;
}

.cms-card-actions {
    margin-left: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    color: #ccc;
}

.cms-card-actions i {
    cursor: pointer;
    transition: color 0.2s;
}

.cms-card-actions i:hover {
    color: #d11f26;
}

.cms-post-card {
    display: grid;
    grid-template-columns: 180px 1fr 40px;
    gap: 20px;
    align-items: start;
}

.cms-post-thumb {
    width: 100%;
    height: 110px;
    border-radius: 6px;
    object-fit: cover;
    border: 1px solid #eee;
}

.cms-module-card [contenteditable]:focus {
    outline: 2px solid #d11f26;
    outline-offset: 2px;
    background: #fffafa;
    border-radius: 4px;
}

.cms-post-meta-line {
    font-size: 0.7rem;
    color: #aaa;
    text-transform: uppercase;
    font-weight: 700;
    margin-bottom: 5px;
}

/* Restore Highlights */
.cms-restoring-highlight {
    outline: 5px solid #0066cc !important;
    outline-offset: 4px !important;
    box-shadow: 0 0 30px rgba(0, 102, 204, 0.6) !important;
    animation: cms-pulse-restore 1.5s infinite ease-in-out;
    position: relative;
    z-index: 10001 !important;
}

@keyframes cms-pulse-restore {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.01);
        opacity: 0.8;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

#cms-restore-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #d11f26;
    color: white;
    padding: 15px 30px;
    z-index: 99999;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
    font-family: 'Rubik', sans-serif;
    animation: cms-slide-up 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes cms-slide-up {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

body.cms-restore-active {
    padding-bottom: 80px !important;
}

/* Product Stats Section for Detail Pages */
.product-stats {
    display: flex;
    justify-content: space-around;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
    margin-top: 25px;
    border-top: 1px solid #eee;
    padding-top: 25px;
    text-align: center;
}

.product-stats div {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    min-width: 140px;
    gap: 5px;
}

.product-stats strong {
    color: #d11f26;
    /* Premium Baselok Red */
    font-size: 1.9rem;
    font-weight: 900;
    text-transform: uppercase;
    line-height: 1;
    margin-bottom: 2px;
    white-space: nowrap;
}

.product-stats span {
    font-size: 0.85rem;
    color: #555;
    font-weight: 700;
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

@media (max-width: 768px) {
    .product-stats {
        gap: 20px;
        justify-content: center;
    }

    .product-stats strong {
        font-size: 1.5rem;
    }

    .product-stats div {
        min-width: 45%;
    }
}




/* --- SUCCESS STORY CARD LINKS --- */
.product-card-link {
    text-decoration: none !important;
    color: inherit !important;
    display: block !important;
    height: 100% !important;
}

.product-card-link:hover .product-card {
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1) !important;
    border-color: #d11f26 !important;
    transform: translateY(-5px) !important;
}

/* --- PREMIUM CRUD ELEMENTS --- */
.cms-btn-upload {
    background: linear-gradient(135deg, #1a5fa8 0%, #007bff 100%);
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
}

.cms-btn-upload:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.4);
}

.cms-btn-delete {
    background: #ff4d4d;
    color: white;
}

.cms-btn-delete:hover {
    background: #ff1a1a;
}

/* Card Improvements */
.cms-module-card {
    width: 100%;
    box-sizing: border-box;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    background: #fff;
}

.cms-card-actions i {
    font-size: 1.1rem;
    padding: 8px;
    border-radius: 50%;
    background: #f8f9fa;
    transition: all 0.2s;
}

.cms-card-actions i.fa-trash-o:hover {
    background: #fff5f5;
    color: #ff4d4d;
    transform: scale(1.1);
}

.cms-card-actions i.fa-pencil:hover {
    background: #f0f7ff;
    color: #007bff;
    transform: scale(1.1);
}

/* Form Styling */
.cms-form-group {
    border: none;
    background: #fdfdfd;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
}

.cms-input:focus {
    border-color: #1a5fa8;
}

/* Modal Enhancements */
.cms-dashboard-container {
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.cms-sidebar {
    background: linear-gradient(to bottom, #fdfdfd 0%, #f7f8f9 100%);
}

/* Upload Progress Sim */
.cms-upload-progress {
    height: 3px;
    width: 0%;
    background: #00b05b;
    position: absolute;
    bottom: 0;
    left: 0;
    transition: width 0.3s;
}

/* --- BLOG CARD STYLES --- */
.featured-imagebox-post {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08) !important;
    transition: all 0.3s ease !important;
}

.featured-imagebox-post:hover {
    transform: translateY(-10px) !important;
}

/* --- SUCCESS STORY & RESOURCE CARDS --- */
.product-card {
    background: #fff !important;
    border: 1px solid #eef0f2 !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05) !important;
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    transition: all 0.3s ease !important;
    margin-bottom: 30px !important;
}

.product-img {
    width: 100% !important;
    overflow: hidden !important;
    aspect-ratio: 16 / 10 !important;
}

.product-img img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    transition: transform 0.3s ease !important;
}

.product-card h6 {
    font-size: 1.15rem !important;
    font-weight: 700 !important;
    margin: 15px 0 10px 0 !important;
    color: #1a1a1a !important;
}

.product-card p {
    font-size: 0.9rem !important;
    color: #555 !important;
    line-height: 1.5 !important;
    margin: 0 !important;
    display: block !important;
    -webkit-line-clamp: unset !important;
    line-clamp: unset !important;
    overflow: visible !important;
    min-height: auto !important;
}

.product-card .pt-3 {
    padding: 0 20px 20px 20px !important;
    flex-grow: 1 !important;
}

/* Toast Notifications */
.cms-toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #333;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    z-index: 30000;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.cms-toast.show {
    transform: translateY(0);
    opacity: 1;
}

.cms-toast-success {
    border-left: 4px solid #28a745;
}

.cms-toast-error {
    border-left: 4px solid #d11f26;
}

.cms-toast-info {
    border-left: 4px solid #007bff;
}


/* Custom Confirm Modal */
.cms-alert-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    z-index: 3000000;
    display: none;
    justify-content: center;
    align-items: center;
    font-family: 'Rubik', sans-serif;
    animation: cmsFadeIn 0.3s ease;
}

.cms-confirm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 40000;
    opacity: 0;
    transition: all 0.3s ease;
}

.cms-confirm-overlay.show {
    display: flex;
    opacity: 1;
}

.cms-confirm-modal {
    background: white;
    padding: 35px;
    border-radius: 16px;
    width: 420px;
    max-width: 90%;
    text-align: center;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.3);
    transform: translateY(40px) scale(0.95);
    transition: all 0.35s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

.cms-confirm-overlay.show .cms-confirm-modal {
    transform: translateY(0) scale(1);
}

.cms-confirm-modal i {
    font-size: 3rem;
    color: #d11f26;
    margin-bottom: 15px;
}

.cms-confirm-modal h3 {
    font-size: 1.25rem;
    margin-bottom: 10px;
    color: #333;
}

.cms-confirm-modal p {
    color: #666;
    margin-bottom: 25px;
    font-size: 0.95rem;
}

.cms-confirm-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.cms-confirm-btn {
    padding: 10px 25px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.btn-confirm-yes {
    background: #d11f26;
    color: white;
}

.btn-confirm-yes:hover {
    background: #b01a20;
}

.btn-confirm-no {
    background: #eee;
    color: #333;
}

.btn-confirm-no:hover {
    background: #ddd;
}

/* Dashboard Sub-Menu Pills */
.cms-resource-submenu {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 10px 5px 20px 5px;
    margin-bottom: 25px;
    scrollbar-width: thin;
    scrollbar-color: #d11f26 transparent;
    -webkit-overflow-scrolling: touch;
    min-height: 70px;
    /* Force minimum height to prevent clipping */
}

.cms-resource-submenu::-webkit-scrollbar {
    height: 6px;
}

.cms-resource-submenu::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 10px;
}

.cms-resource-submenu::-webkit-scrollbar-track {
    background: #f9f9f9;
}

.cms-pill {
    white-space: nowrap;
    padding: 10px 20px;
    border-radius: 6px;
    background: #ffffff;
    border: 1px solid #dee2e6;
    color: #444444 !important;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.cms-pill:hover {
    background: #f8f9fa;
    border-color: #ced4da;
    color: #222222 !important;
    transform: translateY(-1px);
}

.cms-pill.active {
    background: #d11f26 !important;
    border-color: #d11f26 !important;
    color: #ffffff !important;
    box-shadow: 0 4px 15px rgba(209, 31, 38, 0.2);
}

/* ==========================================================================
   Responsive Refinements (Tablet & Mobile)
   ========================================================================== */
@media screen and (max-width: 900px) {
    .cms-dashboard-container {
        width: 95%;
        height: 85vh;
        flex-direction: column;
    }

    .cms-sidebar {
        width: 100%;
        height: auto;
        flex-shrink: 0;
        border-right: none;
        border-bottom: 1px solid #eee;
        padding: 15px;
        flex-direction: row;
        align-items: center;
        gap: 15px;
        overflow-y: hidden;
        overflow-x: auto;
        white-space: nowrap;
    }

    .cms-sidebar-header {
        display: none;
        /* Hide standard header logic if needed, or adjust */
    }

    .cms-sidebar h3 {
        display: none;
    }

    .cms-sidebar .sub-text {
        display: none;
    }

    .cms-page-select {
        width: 150px;
        margin-bottom: 0;
    }

    .cms-menu {
        display: flex;
        flex-direction: row;
        gap: 10px;
    }

    .cms-menu-item {
        margin-bottom: 0;
        padding: 8px 12px;
        white-space: nowrap;
    }

    .cms-sidebar-footer {
        display: none;
    }

    .cms-main-content {
        padding: 15px;
        flex-grow: 1;
        overflow-y: auto;
    }

    .cms-content-header {
        margin-bottom: 15px;
    }

    .cms-content-header h2 {
        font-size: 1.1rem;
    }
}

@media screen and (max-width: 500px) {
    .cms-dashboard-container {
        width: 100%;
        height: 100vh;
        border-radius: 0;
        max-width: 100%;
    }

    .cms-resource-submenu {
        flex-wrap: nowrap;
    }
}

/* --- VERTICAL PRODUCT FILTER for RESOURCES PAGE --- */
.vertical-product-filter {
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: -webkit-sticky; /* for Safari */
    position: sticky;
    top: 110px; /* Offset for the sticky header (approx 80px-100px) */
    z-index: 9;
    align-self: flex-start; /* Required for sticky to work correctly in flex containers */
}

.vertical-product-filter .product-btn {
    background-color: #000;
    color: #fff;
    border: none;
    padding: 18px 20px;
    text-align: left;
    font-weight: 800;
    text-transform: uppercase;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    transition: background-color 0.3s ease;
    letter-spacing: 0.5px;
}

.vertical-product-filter .product-btn:hover {
    background-color: #222;
}

.vertical-product-filter .product-btn.active {
    background-color: #d11f26;
}

/* MOBILE: vertical filter → horizontal scrollable row (tablet & below) */
@media (max-width: 767px) {
    .vertical-product-filter {
        flex-direction: row;
        overflow-x: auto;
        overflow-y: hidden;
        gap: 0;
        position: static;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
        border-bottom: 2px solid #d11f26;
        margin-bottom: 16px !important;
    }

    .vertical-product-filter::-webkit-scrollbar {
        display: none;
    }

    .vertical-product-filter .product-btn {
        flex: 0 0 auto;
        padding: 10px 16px;
        text-align: center;
        font-size: 11px !important;
        white-space: nowrap !important;
        border-right: 1px solid #222;
        background-color: #000;
    }

    .vertical-product-filter .product-btn:last-child {
        border-right: none;
    }

    .vertical-product-filter .product-btn.active {
        background-color: #d11f26;
    }
}

/* Make Tabs look like the screenshot */
.resource-tabs {
    border-bottom: 1px solid #eee;
    margin-bottom: 20px;
}

.resource-tabs .nav-link {
    color: #555;
    font-weight: 800;
    text-transform: uppercase;
    font-size: 11px;
    border: none !important;
    border-bottom: 2px solid transparent !important;
    padding: 15px 15px;
    background: transparent !important;
    letter-spacing: 0.5px;
}

.resource-tabs .nav-link:hover {
    color: #d11f26;
}

.resource-tabs .nav-link.active {
    color: #d11f26 !important;
    border-bottom: 2px solid #d11f26 !important;
}

/* Prevent flicker of old content during CMS initialization */
[data-cms] {
    transition: opacity 0.4s ease-in-out;
}

body.cms-content-loading [data-cms] {
    opacity: 0 !important;
    pointer-events: none;
}

/* Enhanced Page-Level Blackout for 1s Loader - REMOVED because it hides the preloader itself */

#preloader {
    z-index: 10001 !important; /* Above CMS admin bar */
}

/* --- GEOGRID DOWNLOAD SECTION REDESIGN --- */
.downloads-dark-section {
    background-color: #1e2c34;
    padding: 30px;
    border-radius: 4px;
    margin-top: 10px;
}

.download-text-link {
    color: #fff !important;
    text-decoration: none !important;
    font-size: 0.95rem;
    font-weight: 500;
    display: inline-flex;
    align-items: flex-start;
    gap: 8px;
    transition: color 0.2s ease;
    margin-bottom: 12px;
}

.download-text-link:hover {
    color: #d11f26 !important;
}

.download-text-link i {
    font-size: 1.1rem;
    color: #fff;
    transition: color 0.2s ease;
    margin-top: 3px;
}

.download-text-link:hover i {
    color: #d11f26;
}

/* --- GLOBAL THUMBNAIL FIX FOR CONSISTENT COVERAGE --- */
.featured-imagebox-portfolio.style2 .featured-thumbnail,
.featured-imagebox-post.style1 .featured-thumbnail {
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #f4f4f4;
}

.featured-imagebox-portfolio.style2 .featured-thumbnail img,
.featured-imagebox-post.style1 .featured-thumbnail img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}
/* RESET GLOBAL SCROLL - Force single scrollbar on HTML only */
html {
    overflow-y: scroll !important; /* Force scrollbar space to avoid layout jump */
    height: auto !important;
}

body {
    overflow: visible !important;
    height: auto !important;
    min-height: 100vh;
}

/* Fix for Page Scrolling and Hidden Content */
.page {
    overflow: visible !important; /* Force override of overflow: hidden in main.css */
    height: auto !important;
    min-height: 100vh;
}

/* Ensure no internal containers capture scroll */
.site-main, 
.product-section, 
.ttm-row, 
#grid-stories {
    overflow: visible !important;
    height: auto !important;
}

/* Standardized Product Cards (Solutions & Success Stories) */
.product-item {
    display: flex;
}

.product-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    border: 1px solid #eee;
    width: 100%;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    border-color: #d11f26;
}

.product-img {
    position: relative;
    overflow: hidden;
    background: #fdfdfd;
    flex-shrink: 0;
}

.product-img img {
    aspect-ratio: 4 / 3;
    object-fit: cover;
    width: 100%;
    transition: transform 0.5s ease;
}

.product-card:hover .product-img img {
    transform: scale(1.05);
}

#resourceTabContent .product-img {
    background: transparent !important;
    aspect-ratio: 427 / 542 !important;
    height: auto !important;
}

#resourceTabContent .product-card {
    height: 100% !important;
}

#resourceTabContent .product-card .pt-3 {
    padding-bottom: 15px !important;
}

#resourceTabContent .resource-meta {
    margin-top: auto !important;
}

#resourceTabContent .product-img img {
    aspect-ratio: 427 / 542 !important;
    object-fit: cover !important;
    object-position: top;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border: 1px solid #f0f0f0;
    width: 100%;
}

.product-card .pt-3 {
    padding: 20px !important;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.product-card h6 {
    color: #222;
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 12px;
    line-height: 1.3;
}

.product-card h6 a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
}

.product-card h6 a:hover {
    color: #d11f26;
}

.product-card p {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.6;
    margin-bottom: 20px;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 4.8em; /* Ensure uniform space for description */
}

.product-card .read-more-link {
    margin-top: auto;
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: gap 0.2s;
    color: #d11f26;
    text-decoration: none;
}

.product-card .read-more-link:hover {
    gap: 12px;
    color: #b01a20;
}

/* Success Story Specific Overlay/Badge */
.story-meta {
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ── BLUR LOADER: every image starts blurred and HOLDS the blur for ~2s after the
      page loads, giving the saved (SFTP) image time to arrive behind it, then reveals.
      Pure CSS animation — runs once per image, no JS dependency. ── */
img:not(#logo-img):not(.cms-no-blur) {
    animation: cmsImgBlurReveal 2.4s ease-in-out forwards;
}
@keyframes cmsImgBlurReveal {
    0%   { filter: blur(16px); }
    80%  { filter: blur(16px); }   /* hold blur ~2s so SFTP images load behind it */
    100% { filter: blur(0); }
}
/* Never blur images inside the CMS admin UI (toolbar, dashboard, media library, previews) */
#cms-admin-bar img,
.cms-modal img,
#cms-dashboard-modal img,
.cms-media-preview-box img,
#cms-media-preview-modal img {
    animation: none !important;
    filter: none !important;
}

/* Outlined Buttons */
.cms-btn-outline {
    background: transparent !important;
    border: 1px solid #6c757d !important;
    color: #6c757d !important;
    border-radius: 4px;
    padding: 8px 16px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.cms-btn-outline:hover {
    background: #6c757d !important;
    color: white !important;
}

/* Edit Outline Button */
.cms-btn-outline-edit {
    background: transparent !important;
    border: 1px solid #007bff !important;
    color: #007bff !important;
    border-radius: 4px;
    padding: 8px 16px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.cms-btn-outline-edit:hover {
    background: #007bff !important;
    color: white !important;
}

/* Delete Outline Button */
.cms-btn-outline-delete {
    background: transparent !important;
    border: 1px solid #d11f26 !important;
    color: #d11f26 !important;
    border-radius: 4px;
    padding: 8px 16px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.cms-btn-outline-delete:hover {
    background: #d11f26 !important;
    background: #d11f26 !important;
    color: white !important;
}

/* --- FOOTER MENU SPACING ENHANCEMENTS --- */
.widget_nav_menu ul.menu li,
.widget-recent-post ul.menu li {
    margin-bottom: 6px;
}

.widget_nav_menu ul.menu li:last-child,
.widget-recent-post ul.menu li:last-child {
    margin-bottom: 0;
}

.widget_nav_menu ul.menu li a,
.widget-recent-post ul.menu li a {
    line-height: 1.6;
    display: inline-block;
    padding: 2px 0;
    transition: all 0.3s ease;
}

.widget_nav_menu ul.menu li a:hover,
.widget-recent-post ul.menu li a:hover {
    color: #ffb120;
    padding-left: 5px;
}

/* Prevent 1366px site-wide scaling from affecting dashboard modal headings */
@media (min-width: 1200px) and (max-width: 1500px) {
    .cms-dashboard-container h1,
    .cms-dashboard-container h2,
    .cms-dashboard-container h3,
    .cms-dashboard-container h4,
    .cms-dashboard-container h5,
    .cms-dashboard-container h6 {
        font-size: unset !important;
        line-height: unset !important;
    }
}

/* Custom styling for Project Highlights Slider Arrows to match Theme */
#cms-related-highlights-row .slick-prev,
#cms-related-highlights-row .slick-next,
#related-highlights-row .slick-prev,
#related-highlights-row .slick-next {
    width: 48px !important;
    height: 48px !important;
    border-radius: 50% !important;
    background-color: #e8192c !important;
    color: #ffffff !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: absolute !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    z-index: 10 !important;
    border: none !important;
    cursor: pointer !important;
    box-shadow: 0 4px 6px rgba(0,0,0,0.15) !important;
    transition: all 0.3s ease !important;
    font-size: 0; /* Hide text if any */
}

#cms-related-highlights-row .slick-prev:hover,
#cms-related-highlights-row .slick-next:hover,
#related-highlights-row .slick-prev:hover,
#related-highlights-row .slick-next:hover {
    background-color: #000000 !important;
}

#cms-related-highlights-row .slick-prev i,
#cms-related-highlights-row .slick-next i,
#related-highlights-row .slick-prev i,
#related-highlights-row .slick-next i {
    font-size: 20px !important;
    line-height: 1 !important;
}

#cms-related-highlights-row .slick-prev,
#related-highlights-row .slick-prev {
    left: -20px !important;
}

#cms-related-highlights-row .slick-next,
#related-highlights-row .slick-next {
    right: -20px !important;
}



/* Fix 9: Mobile Credit Bar */
.mobile-credit-bar { background: #1a1a1a; text-align: center; padding: 8px 16px; }
.mobile-credit-link { color: #fff; font-size: 0.78rem; font-weight: 700; text-decoration: none; letter-spacing: 0.3px; }
.mobile-credit-link i { color: #d11f26; margin-right: 5px; }

/* Webinar & Blog Image Adjustments */
#pane-webinar .product-img,
#pane-blog .product-img {
    aspect-ratio: 4 / 3 !important;
    height: auto !important;
    width: 100% !important;
    background: transparent !important;
    padding: 0 !important;
    border: none !important;
}

#pane-videos .product-img {
    aspect-ratio: 16 / 9 !important;
    height: auto !important;
    width: 100% !important;
    background: transparent !important;
    padding: 0 !important;
    border: none !important;
}

#pane-webinar .product-img a,
#pane-blog .product-img a,
#pane-videos .product-img a {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
}

#pane-webinar .product-img img,
#pane-blog .product-img img {
    height: 100% !important;
    width: 100% !important;
    aspect-ratio: 4 / 3 !important;
    object-fit: cover !important;
    object-position: center !important;
    border: none !important;
    box-shadow: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

#pane-videos .product-img iframe,
#pane-videos .product-img img {
    height: 100% !important;
    width: 100% !important;
    aspect-ratio: 16 / 9 !important;
    object-fit: cover !important;
    object-position: center !important;
    border: none !important;
    box-shadow: none !important;
    margin: 0 !important;
    padding: 0 !important;
    display: block !important;
}


/* Responsive Slick Arrows for Project Highlights */
.cms-slick-prev { left: -24px !important; right: auto !important; z-index: 20 !important; }
.cms-slick-next { right: -24px !important; left: auto !important; z-index: 20 !important; }

@media (max-width: 767px) {
    .cms-slick-prev { left: 25px !important; }
    .cms-slick-next { right: 25px !important; }
}
