/* --- 1. Main Wrapper & Layout --- */
.wc-manager-wrapper {
    width: 100%;
    max-width: 100%;
    margin: 20px 0;
    overflow-y: auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.wc-main-title {
    color: #000b4a;
    font-size: 2em;
    font-weight: 700;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #ff9100;
}

/* --- 2. THE SCROLL CONTAINER (The fix for your issue) --- */
.wc-table-scroll-wrap {
    width: 100%;
    overflow-x: auto; /* Enable horizontal scrolling */
    overflow-y: hidden;
    display: block;
    border: 1px solid #ddd;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-radius: 4px;
    margin-top: 10px;
}

/* Force scrollbar to be visible and styled with client colors */
.wc-table-scroll-wrap::-webkit-scrollbar {
    height: 12px;
}

.wc-table-scroll-wrap::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.wc-table-scroll-wrap::-webkit-scrollbar-thumb {
    background-color: #000b4a; /* Header Blue */
    border-radius: 10px;
    border: 2px solid #f1f1f1;
}

.wc-table-scroll-wrap::-webkit-scrollbar-thumb:hover {
    background-color: #ff9100; /* Button Orange */
}

/* --- 3. Filter Bar Styling --- */
.oev-filters {
    background: #f1f1f1;
    border-left: 5px solid #000b4a;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 20px;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.oev-filters label {
    color: #000b4a;
    font-weight: 600;
    font-size: 0.9em;
    display: block;
    margin-bottom: 5px;
}

.oev-filters input[type="text"], 
.oev-filters select {
    border: 1px solid #ccc;
    border-radius: 4px;
    height: 40px;
    padding: 0 10px;
    font-size: 14px;
    color: #333;
    background-color: #fff;
}

.oev-filters input[type="text"]:focus, 
.oev-filters select:focus {
    border-color: #ff9100;
    outline: none;
    box-shadow: 0 0 0 1px #ff9100;
}

/* --- 4. Data Table Styling --- */
.wc-data-table {
    table-layout: fixed; /* Fixed prevents cells from stretching based on content */
    width: 1800px;       /* Fixed total width to ensure scrollbar works */
    border-collapse: separate;
    border-spacing: 0;
}

.wc-data-table thead th {
    width: 200px !important;        /* TH is now the max size */
    position: sticky; 
    top: 0;
    z-index: 10;
    background-color: #000b4a;
    color: #ffffff;
    padding: 15px;
    text-align: left;
    white-space: nowrap;
    text-transform: uppercase;
    font-size: 0.85em;
    letter-spacing: 0.5px;
}

.wc-data-table td {
    overflow: hidden;
    text-overflow: ellipsis; /* Long text stays inside the TH size */
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
    color: #444;
    vertical-align: middle;
    white-space: nowrap;
    font-size: 0.95em;
}

/* Double Scrollbar Styling */
.wc-top-scroll-wrapper {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    height: 12px;
}

.wc-top-scroll-wrapper::-webkit-scrollbar, 
.wc-table-scroll-wrap::-webkit-scrollbar {
    height: 10px;
}

.wc-top-scroll-wrapper::-webkit-scrollbar-thumb, 
.wc-table-scroll-wrap::-webkit-scrollbar-thumb {
    background: #000b4a;
    border-radius: 10px;
}

.wc-data-table tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}

.wc-data-table tbody tr:hover {
    background-color: #fff8e1;
}

.wc-data-table button, 
.wc-data-table a {
    background: transparent;
    border: none;
    color: #000b4a;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 4px;
    transition: all 0.2s;
}

.wc-data-table button:hover, 
.wc-data-table a:hover {
    color: #ff9100;
    background: rgba(255, 145, 0, 0.1);
}

/* --- 5. Popup Styling --- */
.wc-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 11, 74, 0.7);
    z-index: 10000;
    backdrop-filter: blur(3px);
}

.wc-popup-data {
    position: absolute;
    background: #fff;
    width: 90%;
    max-width: 900px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.3);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.wc-popup-data h3 {
    color: #000b4a;
    border-bottom: 2px solid #ff9100;
    padding-bottom: 10px;
    margin-top: 0;
}

.wc-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background-color: #ff9100;
    color: #fff;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    text-transform: uppercase;
    transition: background 0.2s;
}

.wc-close-btn:hover {
    background-color: #e68200;
}

/* --- 6. Carousel & Content --- */
.carousel {
    display: flex;
    align-items: center;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

.carousel-window {
    overflow: hidden;
    width: 100%;
    max-width: 840px;
    border: 1px solid #eee;
    padding: 10px;
    background: #fdfdfd;
}

.carousel-track {
    display: flex; /* Fixed images horizontal row */
    transition: transform 0.4s ease-in-out;
}

.carousel-track a {
    flex-shrink: 0; /* Prevents images from squishing */
    width: 200px;
    height: 150px;
    display: block;
    margin-right: 10px;
    border-radius: 4px;
    overflow: hidden;
}

.carousel-track img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.chevron {
    background-color: #000b4a;
    color: #fff;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.3s;
}

.chevron:hover {
    background-color: #ff9100;
}

.wc-popup-data ul {
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.wc-popup-data ul li {
    background: #f4f6f8;
    border: 1px solid #e1e4e8;
    padding: 5px 12px;
    border-radius: 20px;
    color: #333;
    font-size: 14px;
}

.wc-popup-id-viewer { text-align: center; }
.wc-popup-id-viewer img { max-width: 100%; max-height: 60vh; transition: transform 0.3s ease; margin: 20px 0; }
.rotate-controls { margin-top: 10px; }
.editable-cell { border-bottom: 1px dashed #999; cursor: pointer; min-height: 20px; display:inline-block; width:100%; }
.editable-cell:hover { background-color: #f0f0f1; }
.editable-input { width: 100%; }
.wc-address-block { margin-bottom: 15px; border-bottom: 1px solid #eee; padding-bottom: 10px; }
.wc-address-block label { font-weight: bold; display: block; color: #555; }
.wc-address-block p { margin: 5px 0 0; }

.wc-details-table { width: 100%; border-collapse: collapse; margin-top: 10px; }
.wc-details-table th, .wc-details-table td { padding: 8px; border-bottom: 1px solid #eee; text-align: left; }
.wc-details-table th { background: #f9f9f9; width: 40%; font-weight: 600; }
@media print {
    @page {
        margin: 0;
    }
    .elementor,
    .elementor-section,
    .elementor-container,
    .elementor-column,
    .elementor-widget-wrap {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        left: 0 !important;
    }
    body {
        margin: 0 !important;
        padding: 0 !important;
    }
    #wpadminbar, 
    #adminmenumain, 
    .wc-manager-wrapper, 
    .wc-close-btn, 
    .wc-print-btn,
    .elementor-widget-heading,
    .ekit-template-content-header,
    .ekit-template-content-footer,
	#logout {
        display: none !important;
    }
    .elementor-widget-wrap {
        box-shadow: none !important;
    }
    body, html {
        visibility: visible !important;
        overflow: visible !important;
        height: auto !important;
        background: white !important;
    }
    .wc-popup {
        display: none !important;
    }
    #detailsPopup {
        display: block !important;
        visibility: visible !important;
        position: absolute !important;
        top: 0 !important;
        left: -50% !important;
        width: 100% !important;
        height: auto !important;
        padding: 0 !important;
        margin: 0 !important;
        z-index: 999999;
    }
    #detailsPopup .wc-popup-data {
        visibility: visible !important;
        display: block !important;
        max-height: none !important; /* Allow it to grow */
        overflow: visible !important; /* No scrollbars */
        width: 100% !important;
        max-width: 100% !important;
        box-shadow: none !important;
        border: none !important;
        transform: none !important;
        margin: 0 !important;
        padding: 10px !important;
    }
    .wc-details-table {
        width: 100% !important;
        visibility: visible !important;
    }
    
    .wc-details-table * {
        visibility: visible !important;
    }
}

.oev-filters {
    display: flex;
    flex-direction: column;
}

.filter-inputs,
.filter-buttons {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    width: 100%;
    gap: 25px;
    align-items: center;
}

.oev-filters.sticky-filters {
    position: fixed;
    top: 32px;
    z-index: 999;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    border-top: none;
    margin: 0; /* Reset margins so it aligns perfectly */
    animation: slideDown 0.3s ease-out;
    /* width and left will be set via JS */
}

@keyframes slideDown {
    from { transform: translateY(-20px); opacity: 0.8; }
    to { transform: translateY(0); opacity: 1; }
}

/* Adjust for mobile admin bar */
@media screen and (max-width: 782px) {
    .oev-filters.sticky-filters {
        top: 46px;
    }
}