/* ═══════════════════════════════════════════════════════
   DG24 Product Table — Frontend CSS
   Color: #012245
   ═══════════════════════════════════════════════════════ */

/* ─── Container ─── */
.dg24-pt-container {
    position: relative;
    margin: 20px 0;
    font-family: inherit;
}

/* ─── Toolbar ─── */
.dg24-pt-toolbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    padding: 12px 16px;
    background: #f7f7f7;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
}

.dg24-pt-toolbar-left {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    flex: 1;
}

.dg24-pt-toolbar-right {
    flex-shrink: 0;
}

/* ─── Search box (icon inside input) ─── */
.dg24-pt-search-box {
    position: relative;
    flex: 1;
    min-width: 180px;
    max-width: 320px;
}

.dg24-pt-search-box .dg24-pt-input-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    pointer-events: none;
}

.dg24-pt-search {
    width: 100%;
    padding: 8px 12px 8px 34px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
    background: #fff;
    margin-bottom: 0em !important;
    padding: 0.95em 2em !important;
}

.dg24-pt-search:focus {
    border-color: #012245;
    box-shadow: 0 0 0 2px rgba(1, 34, 69, 0.12);
}

/* ─── Filter box (icon inside select + clear button) ─── */
.dg24-pt-filter-box {
    position: relative;
    display: flex;
    align-items: center;
    min-width: 160px;
}

.dg24-pt-filter-box .dg24-pt-input-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    pointer-events: none;
    z-index: 1;
}

.dg24-pt-filter-select {
    width: 100%;
    padding: 8px 12px 8px 32px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: #fff;
    cursor: pointer;
    outline: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath fill='%23666' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    padding-right: 28px;
    margin-bottom: 0em;
}

.dg24-pt-filter-select:focus {
    border-color: #012245;
    box-shadow: 0 0 0 2px rgba(1, 34, 69, 0.12);
}

/* Clear filter button */
.dg24-pt-filter-clear {
    position: absolute;
    right: -32px;
    top: 50%;
    transform: translateY(-50%);
    width: 26px;
    height: 26px;
    border: 1px solid #dc3232;
    border-radius: 50%;
    background: #fff;
    color: #dc3232;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    line-height: 1;
    padding: 0;
    margin: 0;
}

.dg24-pt-filter-clear:hover {
    background: #dc3232;
    color: #fff;
}

/* ─── Fullscreen button ─── */
.dg24-pt-fullscreen-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: #012245;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
    line-height: 1;
}

.dg24-pt-fullscreen-btn:hover {
    background: #011a36;
}

.dg24-pt-fullscreen-btn svg {
    width: 16px;
    height: 16px;
}

/* ─── Table ─── */
.dg24-pt-table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
}

.dg24-pt-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    line-height: 1.5;
}

.dg24-pt-table thead {
    background: #012245;
    color: #fff;
}

.dg24-pt-table thead th {
    padding: 12px 14px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
    border: none;
}

.dg24-pt-table thead th.dg24-pt-th-num {
    width: 45px;
    text-align: center;
}

.dg24-pt-table tbody tr {
    border-bottom: 1px solid #eee;
    transition: background 0.15s;
}

.dg24-pt-table tbody tr:nth-child(even) {
    background: #fafbfc;
}

.dg24-pt-table tbody tr:hover {
    background: #eaf0f7;
}

.dg24-pt-table tbody td {
    padding: 10px 14px;
    vertical-align: middle;
    border: none;
}

.dg24-pt-table tbody td.dg24-pt-td-num {
    text-align: center;
    font-weight: 600;
    color: #999;
}

.dg24-pt-empty {
    text-align: center;
    padding: 30px 14px !important;
    color: #888;
    font-style: italic;
}

/* ─── Footer ─── */
.dg24-pt-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
    font-size: 13px;
    color: #666;
}

.dg24-pt-updated {
    font-size: 12px;
    color: #888;
    display: flex;
    align-items: center;
}

/* Pagination */
.dg24-pt-pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.dg24-pt-page-info {
    font-size: 13px;
    color: #666;
    margin-right: 6px;
}

.dg24-pt-page-btns {
    display: flex;
    gap: 4px;
}

.dg24-pt-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    color: #333;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
    line-height: 1;
}

.dg24-pt-page-btn:hover {
    background: #012245;
    color: #fff;
    border-color: #012245;
}

.dg24-pt-page-btn.active {
    background: #012245;
    color: #fff;
    border-color: #012245;
    font-weight: 700;
}

/* ─── Loading overlay ─── */
.dg24-pt-loading {
    display: none;
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.75);
    z-index: 10;
    align-items: center;
    justify-content: center;
}

.dg24-pt-loading.active {
    display: flex;
}

.dg24-pt-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #ddd;
    border-top-color: #012245;
    border-radius: 50%;
    animation: dg24-spin 0.6s linear infinite;
}

@keyframes dg24-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ─── Fullscreen backdrop ─── */
.dg24-pt-backdrop {
    display: none;
}

.dg24-pt-fullscreen .dg24-pt-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: -1;
    cursor: pointer;
}

/* ─── Fullscreen mode ─── */
.dg24-pt-fullscreen {
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: transparent;
    overflow: visible;
    padding: 60px 100px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

.dg24-pt-fullscreen>.dg24-pt-toolbar,
.dg24-pt-fullscreen>.dg24-pt-table-scroll,
.dg24-pt-fullscreen>.dg24-pt-footer,
.dg24-pt-fullscreen>.dg24-pt-loading {
    position: relative;
    z-index: 1;
}

.dg24-pt-fullscreen>.dg24-pt-toolbar {
    margin: 0 0 0px;
    flex-shrink: 0;
    background: #fff;
    border-radius: 6px 6px 0 0;
}

.dg24-pt-fullscreen>.dg24-pt-table-scroll {
    flex: 1;
    overflow-y: auto;
    background: #fff;
    margin: 0;
    border-radius: 0;
}

.dg24-pt-fullscreen>.dg24-pt-footer {
    margin: 0;
    flex-shrink: 0;
    background: #fff;
    padding: 10px 16px;
    border-radius: 0 0 6px 6px;
    border: 1px solid #e5e5e5;
    border-top: none;
}

body.dg24-pt-body-lock {
    overflow: hidden;
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
    .dg24-pt-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .dg24-pt-toolbar-left {
        flex-direction: column;
    }

    .dg24-pt-search-box {
        max-width: 100%;
    }

    .dg24-pt-filter-box {
        width: 100%;
    }

    .dg24-pt-filter-select {
        flex: 1;
    }

    .dg24-pt-footer {
        flex-direction: column;
        align-items: flex-start;
    }

    /* Card-style on mobile */
    .dg24-pt-table thead {
        display: none;
    }

    .dg24-pt-table,
    .dg24-pt-table tbody,
    .dg24-pt-table tbody tr,
    .dg24-pt-table tbody td {
        display: block;
        width: 100%;
    }

    .dg24-pt-table tbody tr {
        border: 1px solid #e5e5e5;
        border-radius: 8px;
        margin-bottom: 12px;
        padding: 10px 14px;
        background: #fff;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    }

    .dg24-pt-table tbody tr:nth-child(even) {
        background: #fff;
    }

    .dg24-pt-table tbody td {
        padding: 6px 0;
        border: none;
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 10px;
    }

    .dg24-pt-table tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #012245;
        min-width: 100px;
        flex-shrink: 0;
        font-size: 12px;
        text-transform: uppercase;
    }

    .dg24-pt-table tbody td.dg24-pt-td-num {
        display: none;
    }

    .dg24-pt-table-scroll {
        border: none;
        border-radius: 0;
    }

    /* Fullscreen on mobile */
    .dg24-pt-fullscreen {
        padding: 20px 10px;
    }
}

@media (max-width: 480px) {
    .dg24-pt-page-btns {
        flex-wrap: wrap;
    }

    .dg24-pt-page-btn {
        min-width: 30px;
        height: 30px;
        font-size: 12px;
    }
}