/* Kombinacijų lentelė modernus flex stilius */
.tprp-combo-table {
    background: #f9fafb;
    border-radius: 16px;
    padding: 18px;
    box-shadow: 0 2px 8px rgba(0,0,0,.04);
    margin-bottom: 24px;
    overflow-x: auto;
}

/* Pašalinta sena kombinacijų lentelės CSS, nes keičiame į naują sistemą */

/* ==========================
   Admin + Front shared
========================== */
.tprp-admin .tprp-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 16px;
    margin: 16px 0;
    box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.tprp-admin input[type=text] {
    width: 100%;
    max-width: 520px;
}
.tprp-admin .tprp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px,1fr));
    gap: 12px;
}
.tprp-admin .tprp-actions .button {
    margin-right: 6px;
}
.tprp-admin .tprp-question {
    border: 1px dashed #d1d5db;
    border-radius: 12px;
    padding: 12px;
    margin: 10px 0;
    background: #fafafa;
}
.tprp-admin .flex-row {
    display: flex;
    gap: 8px;
    align-items: center;
}
.tprp-admin .tprp-answer {
    display: flex;
    gap: 8px;
    align-items: center;
    margin: 6px 0;
}
.tprp-admin .tprp-category {
    display: flex;
    gap: 8px;
    align-items: center;
    margin: 8px 0;
}

/* ==========================
   Kombinacijų lentelės NAUJAS dinamiškas sprendimas
========================== */
.tprp-admin .tprp-combo-table {
    overflow-x: auto;
    position: relative;
}

/* Pagrindinė kombinacijų lentelės struktūra - dinamiškas grid */
.tprp-admin .tprp-combo-header,
.tprp-admin .tprp-combo-row {
    display: grid;
    gap: 12px;
    align-items: start;
    min-width: fit-content;
}

/* Dinamiskas stulpelių išdėstymas pagal kategorijų skaičių */
.tprp-combo-table.categories-1 .tprp-combo-header,
.tprp-combo-table.categories-1 .tprp-combo-row {
    grid-template-columns: 280px 1fr;
}

.tprp-combo-table.categories-2 .tprp-combo-header,
.tprp-combo-table.categories-2 .tprp-combo-row {
    grid-template-columns: 280px repeat(2, 1fr);
}

.tprp-combo-table.categories-3 .tprp-combo-header,
.tprp-combo-table.categories-3 .tprp-combo-row {
    grid-template-columns: 280px repeat(3, 1fr);
}

.tprp-combo-table.categories-4 .tprp-combo-header,
.tprp-combo-table.categories-4 .tprp-combo-row {
    grid-template-columns: 280px repeat(4, minmax(200px, 1fr));
}

.tprp-combo-table.categories-5-plus .tprp-combo-header,
.tprp-combo-table.categories-5-plus .tprp-combo-row {
    grid-template-columns: 280px repeat(auto-fill, minmax(200px, 220px));
    min-width: max-content;
}

/* Antraštės stilius */
.tprp-admin .tprp-combo-header {
    background: #e5e7eb;
    border-radius: 12px;
    font-weight: 600;
    padding: 12px;
    margin-bottom: 12px;
    position: sticky;
    top: 0;
    z-index: 3;
    text-align: center;
}

.tprp-admin .tprp-combo-header > div {
    padding: 4px 8px;
    text-align: center;
}

/* Kombinacijos raktų stilius */
.tprp-admin .tprp-combo-key {
    background: #f3f4f6;
    border-radius: 8px;
    padding: 12px;
    font-size: 13px;
    color: #374151;
    line-height: 1.4;
    position: sticky;
    left: 0;
    z-index: 2;
    max-height: 200px;
    overflow-y: auto;
}

.tprp-admin .tprp-combo-key > div {
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid #e5e7eb;
}

.tprp-admin .tprp-combo-key > div:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

/* Produktų pasirinkimo laukai */
.tprp-combo-products {
    background: #f9fafb;
    border-radius: 8px;
    padding: 12px;
    min-width: 200px;
}

.tprp-combo-products select {
    width: 100%;
    min-height: 38px;
    border-radius: 6px;
    border: 1px solid #d1d5db;
    font-size: 14px;
}

/* Eilučių stilius */
.tprp-admin .tprp-combo-row {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    margin-bottom: 12px;
    padding: 12px;
}

/* Scroll efektai */
.tprp-combo-table.is-scrolled .tprp-combo-key {
    box-shadow: 3px 0 10px rgba(0,0,0,0.15);
}

.scroll-hint {
    text-align: center;
    color: #666;
    font-size: 12px;
    margin-top: 10px;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 6px;
    animation: fadeInOut 4s infinite;
}

@keyframes fadeInOut {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* Custom scroll bar */
.tprp-combo-table::-webkit-scrollbar {
    height: 10px;
}

.tprp-combo-table::-webkit-scrollbar-track {
    background: #f1f3f4;
    border-radius: 5px;
}

.tprp-combo-table::-webkit-scrollbar-thumb {
    background: #c1c7cd;
    border-radius: 5px;
    transition: background 0.2s;
}

.tprp-combo-table::-webkit-scrollbar-thumb:hover {
    background: #a0a6ac;
}

/* ==========================
   Actions Row for buttons
========================== */
.tprp-admin .tprp-actions-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 12px;
    align-items: center;
}
.tprp-admin .tprp-actions-row .button {
    min-width: 140px;
}

/* ==========================
   Testų puslapio „Šalinti" mygtukai
========================== */
.tprp-admin .tprp-actions form {
    margin-top: 6px;
    display: inline-block;
}
.tprp-admin .tprp-actions .button-link-delete {
    color: #dc2626;
    border-color: #dc2626;
}

/* ==========================
   Front
========================== */
.tprp-test {
    border:1px solid #e5e7eb;
    border-radius:16px;
    padding:18px;
    background:#ffffff;
}
.tprp-q { margin-bottom:16px; }
.tprp-q-title { font-weight:600; margin-bottom:10px; }
.tprp-answers {
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(180px,1fr));
    gap:10px;
}
.tprp-answer {
    border:1px solid #e5e7eb;
    border-radius:10px;
    padding:10px;
    display:flex;
    gap:8px;
    align-items:center;
    cursor:pointer;
    background:#fafafa;
    transition:all .15s;
}
.tprp-answer:hover { background:#f0fdf4; border-color:#D4A88C; }
.tprp-answer input { accent-color:#D4A88C; }
.tprp-submit {
    display:block;
    width:100%;
    padding:12px;
    border-radius:12px;
    background:#D4A88C;
    color:#fff;
    border:none;
    font-weight:600;
    cursor:pointer;
}
.tprp-submit:hover { background:#B98B6B; }
.tprp-result { margin-top:18px; }

/* ==========================
   Category & Product Cards
========================== */
.tprp-category-box {
    background: #fff;
    border: 2px solid #e5e7eb;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 32px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.08);
}
.tprp-result-cat {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 24px;
    color: #B98B6B;
    text-align: center;
}
.tprp-products {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
}
.tprp-product-item {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 220px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    transition: transform .25s, box-shadow .25s;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}
.tprp-product-item:hover {
    transform: translateY(-6px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}
.tprp-product-img {
    width: 150px;
    height: 150px;
    object-fit: contain;
    margin-bottom: 12px;
}
.tprp-product-title {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 8px;
    text-align: center;
}
.tprp-product-price {
    font-weight: 700;
    font-size: 16px;
    color: #D4A88C;
    margin-bottom: 12px;
}
.tprp-product-cart {
    width: 100%;
    opacity: 1;
    transition: all .3s ease;
}

/* ==========================
   WooCommerce add_to_cart_inline pataisymai
========================== */
.tprp-product-cart p.add_to_cart_inline {
    margin: 0;
    padding: 0;
    display: block;
    width: 100%;
    font-size: 0;
    line-height: 0;
}
.tprp-product-cart p.add_to_cart_inline a.add_to_cart_button,
.tprp-product-cart p.add_to_cart_inline a.add_to_cart_button,
.tprp-product-cart p.add_to_cart_inline a.single_add_to_cart_button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    font-size: 15px;
    line-height: 1.3;
    text-align: center;
    white-space: normal;
    padding: 12px 0;
    border-radius: 10px;
    background: #D4A88C;
    color: #fff;
    font-weight: 600;
    transition: background .2s, transform .15s;
}
/* Jei produktas neturimas */
.tprp-product-cart .tprp-product-not-available {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    font-size: 15px;
    line-height: 1.3;
    text-align: center;
    white-space: normal;
    padding: 12px 0;
    border-radius: 10px;
    background: #e5e7eb;
    color: #374151;
    font-weight: 600;
    transition: background .2s, transform .15s;
    cursor: pointer;
}
.tprp-product-cart .tprp-product-not-available:hover {
    background: #d1d5db;
}
.tprp-product-cart p.add_to_cart_inline a.add_to_cart_button:hover,
.tprp-product-cart p.add_to_cart_inline a.single_add_to_cart_button:hover {
    background: #B98B6B;
    transform: scale(1.03);
}

/* ==========================
   Hover overlay effect
========================== */
.tprp-product-item:hover .tprp-product-cart {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================
   Responsive pataisymai kombinacijų lentelei
========================== */
@media (max-width: 1400px) {
    .tprp-combo-table.categories-4 .tprp-combo-header,
    .tprp-combo-table.categories-4 .tprp-combo-row {
        grid-template-columns: 250px repeat(4, minmax(180px, 1fr));
    }
    
    .tprp-combo-table.categories-5-plus .tprp-combo-header,
    .tprp-combo-table.categories-5-plus .tprp-combo-row {
        grid-template-columns: 250px repeat(auto-fill, 180px);
    }
}

@media (max-width: 1200px) {
    .tprp-combo-table.categories-3 .tprp-combo-header,
    .tprp-combo-table.categories-3 .tprp-combo-row {
        grid-template-columns: 220px repeat(3, minmax(160px, 1fr));
    }
    
    .tprp-combo-table.categories-4 .tprp-combo-header,
    .tprp-combo-table.categories-4 .tprp-combo-row,
    .tprp-combo-table.categories-5-plus .tprp-combo-header,
    .tprp-combo-table.categories-5-plus .tprp-combo-row {
        grid-template-columns: 220px repeat(auto-fill, 160px);
    }
    
    .tprp-combo-products {
        min-width: 160px;
        padding: 10px;
    }
}

@media (max-width: 768px) {
    .tprp-combo-table {
        padding: 12px;
    }
    
    .tprp-combo-table .tprp-combo-header,
    .tprp-combo-table .tprp-combo-row {
        grid-template-columns: 180px repeat(auto-fill, 140px);
        gap: 8px;
    }
    
    .tprp-admin .tprp-combo-key {
        padding: 8px;
        font-size: 12px;
    }
    
    .tprp-combo-products {
        padding: 8px;
        min-width: 140px;
    }
    
    .tprp-products { gap: 15px; justify-content: center; }
    .tprp-product-item { width: 160px; padding: 12px; }
    .tprp-product-title { font-size: 14px; }
    .tprp-product-price { font-size: 14px; }
}

@media (max-width: 480px) {
    .tprp-combo-table .tprp-combo-header,
    .tprp-combo-table .tprp-combo-row {
        grid-template-columns: 150px repeat(auto-fill, 120px);
    }
    
    .tprp-product-item { width: 140px; padding: 10px; margin-bottom: 12px; }
    .tprp-product-img { width: 100px; height: 100px; }
    .tprp-product-title { font-size: 13px; }
    .tprp-product-price { font-size: 13px; }
}

/* ==========================
   Question Validation
========================== */
.tprp-q-error {
    border: 2px solid #dc2626 !important;
    background: #fee2e2 !important;
    border-radius: 12px;
}