.twp-wrap,
.twp-wrap * {
    box-sizing: border-box;
}

.twp-wrap {
    --twp-surface: #ffffff;
    --twp-surface-soft: #ecf8f4;
    --twp-border: #cfe7df;
    --twp-border-strong: #8bbcaf;
    --twp-text: #17324a;
    --twp-text-soft: #52707b;
    --twp-accent: #244e73;
    --twp-accent-strong: #183a56;
    --twp-success: #2d7a63;
    --twp-danger: #c53030;
    --twp-shadow: 0 22px 40px rgba(23, 50, 74, 0.08);
    background: linear-gradient(180deg, #edf8f4 0%, #f7fcfa 100%);
    border: 1px solid var(--twp-border);
    border-radius: 24px;
    color: var(--twp-text);
    font-family: "Segoe UI", Tahoma, sans-serif;
    padding: 24px;
    box-shadow: var(--twp-shadow);
    position: relative;
}

.twp-header {
    align-items: end;
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    justify-content: space-between;
    margin-bottom: 18px;
}

.twp-kicker {
    color: var(--twp-accent-strong);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.12em;
    margin: 0 0 6px;
    text-transform: uppercase;
}

.twp-title {
    font-size: 28px;
    line-height: 1.1;
    margin: 0;
}

.twp-search {
    min-width: min(100%, 320px);
}

.twp-search-input {
    appearance: none;
    background: var(--twp-surface);
    border: 1px solid var(--twp-border-strong);
    border-radius: 999px;
    color: var(--twp-text);
    font: inherit;
    font-size: 14px;
    min-height: 48px;
    outline: none;
    padding: 0 18px;
    width: 100%;
}

.twp-search-input::placeholder {
    color: var(--twp-text-soft);
    font-size: 13px;
    font-weight: 400;
}

.twp-search-input:focus {
    border-color: var(--twp-accent);
    box-shadow: 0 0 0 4px rgba(36, 78, 115, 0.14);
}

.twp-feedback {
    display: grid;
    gap: 10px;
    margin-bottom: 16px;
}

.twp-toast {
    background: #eef8f4;
    border: 1px solid rgba(45, 122, 99, 0.24);
    border-radius: 999px;
    bottom: 20px;
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.16);
    color: var(--twp-success);
    left: 50%;
    max-width: min(92vw, 420px);
    pointer-events: none;
    position: fixed;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    opacity: 0;
    padding: 12px 14px;
    transform: translate(-50%, 12px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    width: max-content;
    z-index: 999999;
}

.twp-toast.is-visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

.twp-toast.is-error {
    background: #fff5f5;
    border-color: rgba(197, 48, 48, 0.2);
    color: var(--twp-danger);
}

.twp-action .added_to_cart,
.twp-action .wc-forward {
    display: none !important;
}

.twp-summary {
    color: var(--twp-text-soft);
    font-size: 14px;
    margin: 0;
}

.twp-table-card {
    background: var(--twp-surface);
    border: 1px solid rgba(231, 216, 182, 0.8);
    border-radius: 20px;
    overflow: hidden;
}

.twp-table-scroll {
    overflow-x: auto;
}

.twp-table {
    border-collapse: collapse;
    min-width: 720px;
    width: 100%;
}

.twp-table th:nth-child(1),
.twp-table td:nth-child(1) {
    width: 88px;
}

.twp-table th:nth-child(2),
.twp-table td:nth-child(2) {
    width: 32%;
}

.twp-table th:nth-child(3),
.twp-table td:nth-child(3) {
    width: 14%;
}

.twp-table th:nth-child(4),
.twp-table td:nth-child(4) {
    width: 12%;
}

.twp-table th:nth-child(5),
.twp-table td:nth-child(5) {
    width: 14%;
}

.twp-table th:nth-child(6),
.twp-table td:nth-child(6) {
    width: 16%;
}

.twp-table th,
.twp-table td {
    border-bottom: 1px solid rgba(231, 216, 182, 0.8);
    padding: 12px 14px;
    text-align: left;
    vertical-align: middle;
}

.twp-table th {
    background: var(--twp-surface-soft);
    color: var(--twp-text-soft);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    position: sticky;
    top: 0;
    text-transform: uppercase;
    z-index: 1;
}

.twp-col-thumb {
    padding-left: 10px;
    padding-right: 10px;
    width: 88px;
}

.twp-thumb-cell {
    padding-left: 10px;
    padding-right: 10px;
    text-align: center;
    width: 88px;
}

.twp-thumb img {
    border-radius: 14px;
    display: block;
    height: auto;
    width: 64px;
}

.twp-product-copy {
    min-width: 0;
}

.twp-product-name {
    color: var(--twp-text);
    display: block;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.35;
    margin: 0;
    overflow-wrap: anywhere;
    text-decoration: none;
    word-break: break-word;
}

.twp-product-name:hover,
.twp-product-name:focus {
    color: var(--twp-accent-strong);
}

.twp-price {
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
}

.twp-stock-cell,
.twp-action,
.twp-qty-cell {
    white-space: nowrap;
}

.twp-stock {
    border-radius: 999px;
    display: inline-flex;
    font-size: 13px;
    font-weight: 400;
    padding: 7px 12px;
    white-space: nowrap;
}

.twp-stock-instock {
    background: rgba(45, 122, 99, 0.12);
    color: var(--twp-success);
}

.twp-stock-onbackorder {
    background: rgba(36, 78, 115, 0.1);
    color: var(--twp-accent);
}

.twp-stock-outofstock {
    background: rgba(197, 48, 48, 0.1);
    color: var(--twp-danger);
}

.twp-qty-control {
    align-items: center;
    background: #f5fbf8;
    border: 1px solid var(--twp-border);
    border-radius: 999px;
    display: inline-flex;
    gap: 8px;
    padding: 4px;
}

.twp-qty-btn,
.twp-add-btn,
.twp-page-btn {
    appearance: none;
    border: 0;
    cursor: pointer;
    font: inherit;
}

.twp-qty-btn {
    background: transparent;
    border-radius: 999px;
    color: var(--twp-text);
    display: inline-flex;
    font-size: 18px;
    flex: 0 0 32px;
    height: 32px;
    justify-content: center;
    line-height: 1;
    padding: 0;
    position: relative;
    text-indent: 0;
    vertical-align: middle;
    width: 32px;
    align-items: center;
}

.twp-qty-btn:hover,
.twp-qty-btn:focus {
    background: rgba(36, 78, 115, 0.12);
    outline: none;
}

.twp-qty-input {
    background: transparent;
    border: 0;
    color: var(--twp-text);
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    min-width: 36px;
    padding: 0;
    text-align: center;
    width: 36px;
}

.twp-qty-input:focus {
    outline: none;
}

.twp-add-btn {
    background: linear-gradient(135deg, #244e73 0%, #2f648f 100%);
    border-radius: 999px;
    box-shadow: 0 10px 18px rgba(36, 78, 115, 0.18);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    min-height: 40px;
    padding: 0 16px;
    transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
    white-space: nowrap;
}

.twp-add-btn:hover,
.twp-add-btn:focus {
    background: linear-gradient(135deg, #183a56 0%, #244e73 100%);
    outline: none;
    transform: translateY(-1px);
    box-shadow: 0 14px 22px rgba(24, 58, 86, 0.2);
}

.twp-add-btn[disabled],
.twp-page-btn[disabled] {
    cursor: not-allowed;
    opacity: 0.55;
}

.twp-empty {
    color: var(--twp-text-soft);
    padding: 28px 8px;
    text-align: center;
}

.twp-pagination-wrap {
    margin-top: 18px;
}

.twp-pagination {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.twp-page-gap {
    color: var(--twp-text-soft);
    font-size: 13px;
    font-weight: 600;
    padding: 0 2px;
}

.twp-page-btn {
    background: var(--twp-surface);
    border: 1px solid var(--twp-border);
    border-radius: 999px;
    color: var(--twp-text);
    font-size: 13px;
    font-weight: 600;
    min-height: 42px;
    min-width: 42px;
    padding: 0 16px;
}

.twp-page-btn-edge {
    padding: 0 18px;
}

.twp-page-btn:hover,
.twp-page-btn:focus {
    border-color: var(--twp-accent);
    color: var(--twp-accent-strong);
    outline: none;
}

.twp-page-btn.is-active {
    background: var(--twp-accent);
    border-color: var(--twp-accent);
    color: #fff;
}

.twp-wrap.is-loading {
    opacity: 0.72;
    transition: opacity 0.2s ease;
}

.twp-wrap.is-loading::after {
    animation: twp-pulse 1s ease-in-out infinite;
    background: rgba(247, 252, 250, 0.92);
    border: 1px solid rgba(139, 188, 175, 0.72);
    border-radius: 999px;
    color: var(--twp-accent-strong);
    content: "Actualizando...";
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    padding: 10px 14px;
    position: absolute;
    right: 24px;
    top: 24px;
    text-transform: uppercase;
}

@keyframes twp-pulse {
    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.56;
    }
}

@media (max-width: 782px) {
    .twp-wrap {
        border-radius: 18px;
        padding: 18px;
    }

    .twp-title {
        font-size: 24px;
    }

    .twp-table {
        min-width: 640px;
    }

    .twp-table-scroll {
        position: relative;
    }

    .twp-table th:first-child {
        background: var(--twp-surface-soft);
        left: 0;
        z-index: 3;
    }

    .twp-table td:first-child {
        background: var(--twp-surface);
        box-shadow: 10px 0 18px rgba(23, 50, 74, 0.08);
        left: 0;
        position: sticky;
        z-index: 2;
    }

    .twp-table th:first-child,
    .twp-table td:first-child {
        padding-left: 8px;
        padding-right: 8px;
        text-align: center;
        width: 72px;
    }

    .twp-table th:nth-child(2),
    .twp-table td:nth-child(2) {
        width: 120px;
    }

    .twp-wrap.is-loading::after {
        right: 18px;
        top: 18px;
    }

    .twp-thumb img {
        width: 56px;
    }

    .twp-product-copy {
        min-width: 0;
        width: 120px;
    }

    .twp-product-name {
        font-size: 14px;
        line-height: 1.3;
    }

    .twp-add-btn {
        min-width: 132px;
    }

    .twp-page-btn {
        min-height: 38px;
        min-width: 38px;
        padding: 0 14px;
    }
}
