/* ===============================
   PRODUCT GRID (3 PER ROW)
================================ */

.topland-products {
    width: 100%;
}

.tp-card-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

/* Tablet */
@media (max-width: 991px) {
    .tp-card-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile */
@media (max-width: 575px) {
    .tp-card-grid {
        grid-template-columns: 1fr;
    }
}

/* ===============================
   CARD DESIGN
================================ */

.tp-card {
    border: 1px solid #ddd;
    padding: 15px;
    background: #fff;
    border-radius: 6px;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.tp-card:hover {
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
}

/* Rows inside card */
.tp-row {
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
    font-size: 14px;
    margin-bottom: 6px;
    gap: 5px;
}

.tp-row strong {
    font-weight: 600;
    color: #444;
    white-space: nowrap;
}

.tp-row span,
.tp-row {
    color: #000;
}

/* ===============================
   PAGINATION BAR
================================ */

.tp-pagination-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 25px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.tp-results-count {
    font-size: 14px;
    color: #333;
}

/* ===============================
   PAGINATION BUTTONS
================================ */

.tp-pagination {
    display: flex;
    align-items: center;
}

.tp-page {
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    margin: 0 2px;
    border: 1px solid #ddd;
    background: #fff;
    color: #000;
    cursor: pointer;
    border-radius: 4px;
    font-size: 14px;
}

.tp-page:hover:not(.active):not(:disabled) {
    background: #eb1c23;
    border-color: #eb1c23;
    color: #fff;
}

.tp-page.active {
    background: #eb1c23;
    border-color: #eb1c23;
    color: #fff;
}

.tp-page:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ===============================
   RESPONSIVE
================================ */

@media (max-width: 768px) {
    .tp-pagination-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

/* ==================================================
   SIDEBAR
================================================== */

.topland-sidebar {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 16px;
}

/* Search */
.tp-search {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 18px;
}

.tp-search:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.15);
}

/* Filter groups */
.tp-filter-group {
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid #f0f0f0;
}

.tp-filter-group:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.tp-filter-group>strong {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.tp-filter-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #374151;
    cursor: pointer;
    margin-bottom: 6px;
}

.tp-filter-group label:last-child {
    margin-bottom: 0;
}

.tp-filter-group input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #0073aa;
    cursor: pointer;
}

.tp-filter-group label:hover {
    color: #0073aa;
}

/* ==================================================
   PRODUCT GRID (3 PER ROW) – V2 SUPPORT
================================================== */

/* ==================================================
   PRODUCT GRID (3 PER ROW) – V2 SUPPORT
================================================== */

.topland-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    width: 100%;
}

/* 4 Column support */
.topland-cards-grid.tp-grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* Tablet */
@media (max-width: 991px) {

    .topland-cards-grid,
    .topland-cards-grid.tp-grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile */
@media (max-width: 575px) {

    .topland-cards-grid,
    .topland-cards-grid.tp-grid-4 {
        grid-template-columns: 1fr;
    }
}

/* ==================================================
   PRODUCT CARD – V2
================================================== */

.topland-pump-card {
    border: 1px solid #ddd;
    padding: 15px;
    background: #fff;
    border-radius: 6px;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.topland-pump-card:hover {
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
}

/* ==================================================
   CARD IMAGE – V2
================================================== */

.tp-card-image {
    width: 100%;
    text-align: center;
    margin-bottom: 12px;
}

.tp-card-image img {
    max-width: 100%;
    /*    max-height: 220px;*/
    object-fit: contain;
    display: inline-block;
}

/* ==================================================
   CARD ROWS – V2 (REUSE EXISTING STYLE)
================================================== */

.topland-pump-card .tp-row {
    font-size: 14px;
    margin-bottom: 8px;
    color: #000;
    text-align: left;
    /* Ensure left alignment */
}

.topland-pump-card .tp-row strong {
    font-weight: 600;
    color: #444;
}

/* Card title left alignment */
.topland-pump-card .tp-card-title {
    text-align: left !important;
}

/* ==================================================
   CARD FOOTER – V2
================================================== */

.tp-card-footer {
    margin-top: auto;
    padding-top: 10px;
}

.tp-card-footer a {
    text-decoration: none;
    font-weight: 600;
    color: #0073aa;
}

/* ===============================
   FILTER CHECKBOX – RED TICK ONLY
   (No red box)
================================ */

/* Override theme checkbox styling */
.tp-filter-group input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border: 2px solid #d1d5db;
    border-radius: 4px;
    background: #fff;
    position: relative;
    cursor: pointer;
}

/* Red tick when checked */
.tp-filter-group input[type="checkbox"]:before {
    display: none;
}

.tp-filter-group input[type="checkbox"]:checked::after {
    content: "";
    position: absolute;
    left: 6px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid #eb1c23;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Label text red when checked */
.tp-filter-group input[type="checkbox"]:checked+span,
.tp-filter-group input[type="checkbox"]:checked~span {
    color: #eb1c23;
}

.tp-filter-group label:has(input[type="checkbox"]:checked) {
    color: #eb1c23;
}

/* ===============================
   FIX: DOUBLE CHECKBOX + HOVER COLOR
================================ */

/* Hide native checkbox rendering completely */
.tp-filter-group input[type="checkbox"] {
    appearance: none !important;
    -webkit-appearance: none !important;
    outline: none;
}

/* Ensure only custom checkbox is visible */
.tp-filter-group input[type="checkbox"] {
    background: #fff;
    border: 2px solid #d1d5db;
}

/* Hover text should be Topland red (not blue) */
.tp-filter-group label:hover {
    color: #eb1c23 !important;
}

/* Prevent theme link/label hover blue override */
.tp-filter-group label * {
    color: inherit;
}

/* ===============================
   FIX: REMOVE THEME FAKE CHECKBOX
================================ */

/* Kill theme-generated checkbox */
.tp-filter-group label::before,
.tp-filter-group label::after {
    display: none !important;
    content: none !important;
}

/* Keep only our custom checkbox */
.tp-filter-group input[type="checkbox"] {
    appearance: none !important;
    -webkit-appearance: none !important;
    width: 16px;
    height: 16px;
    border: 2px solid #d1d5db;
    border-radius: 4px;
    background: #fff;
    position: relative;
    cursor: pointer;
}

/* Red tick only */
.tp-filter-group input[type="checkbox"]:checked::after {
    content: "";
    position: absolute;
    left: 6px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid #eb1c23;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Hover text color */
.tp-filter-group label:hover {
    color: #eb1c23 !important;
}

/* Checked text color (no <span> needed) */
.tp-filter-group label:has(input[type="checkbox"]:checked) {
    color: #eb1c23;
}

/* ===============================
   LOADER
================================ */
.tp-loader-container {
    width: 100%;
    min-height: 200px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.tp-loader {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #eb1c23;
    /* Topland Red */
    border-radius: 50%;
    animation: tp-spin 1s linear infinite;
}

@keyframes tp-spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* ===============================
   PRODUCT DETAIL PAGE
================================ */

/* Scoped Wrapper */
.topland-detail-scope {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #333;
    line-height: 1.5;
    box-sizing: border-box;
    background: #fff;
    padding: 20px;
    border-radius: 8px;
}

.topland-detail-scope *,
.topland-detail-scope *::before,
.topland-detail-scope *::after {
    box-sizing: inherit;
}

.topland-detail-scope h1 {
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    color: #111;
    line-height: 1.2;
}

.topland-detail-scope h4 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 1rem 0;
    color: #444;
}

/* Layout Grid */
.tp-product-wrapper {
    display: flex;
    gap: 40px;
    align-items: flex-start;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.tp-detail-left {
    flex: 0 0 40%;
    max-width: 40%;
    position: relative;
    width: 40%;
    /* Fallback */
}

/* ===============================
   STICKY PRODUCT IMAGE (Desktop)
   Amazon-style: Image sticks while scrolling
================================ */
@media (min-width: 769px) {
    .tp-detail-left {
        position: sticky;
        top: 100px;
        /* Offset for fixed navigation header */
        align-self: flex-start;
        /* Critical for sticky in flexbox */
        height: fit-content;
        max-height: calc(100vh - 120px);
        /* Prevent image exceeding viewport */
    }

    /* Constrain image within sticky container */
    .tp-detail-left img.tp-product-img {
        max-height: calc(100vh - 150px);
        object-fit: contain;
    }
}

.tp-detail-left img.tp-product-img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
    border: 1px solid #eee;
    background: #f9f9f9;
}

.tp-product-img-missing {
    opacity: 0.5;
}

.tp-detail-right {
    flex: 1;
    min-width: 300px;
}

/* Tables & Lists */
.tp-spec-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    font-size: 0.95rem;
    background: #fff;
    border: 1px solid #e0e0e0;
}

.tp-spec-table th,
.tp-spec-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #eee;
    text-align: left;
    vertical-align: middle;
}

.tp-spec-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #555;
}

.tp-spec-table tr:last-child td {
    border-bottom: none;
}

.tp-spec-table tr:nth-child(even) {
    background-color: #fafbfc;
}

/* Features List (Simple) */
.tp-features-list {
    list-style: disc;
    margin: 0 0 20px 20px;
    padding: 0;
}

.tp-features-list li {
    margin-bottom: 6px;
    color: #555;
}

/* Details / Accordion */
.tp-details-wrapper {
    overflow: hidden;
    margin-top: 20px;
}

.tp-details-item {
    border-bottom: 1px solid #e0e0e0;
}

.tp-details-item summary {
    padding: 14px 20px;
    background: #fdfdfd;
    cursor: pointer;
    font-weight: 600;
    color: #333;
    list-style: none;
    position: relative;
    transition: background 0.2s;
    outline: none;
}

.tp-details-item summary:hover {
    background: #f0f0f0;
}

.tp-details-item summary::-webkit-details-marker {
    display: none;
}

.tp-details-item summary::after {
    content: '+';
    position: absolute;
    right: 20px;
    font-size: 1.2rem;
    font-weight: 300;
    top: 10px;
    color: #888;
}

.tp-details-item[open] summary::after {
    content: '-';
    top: 8px;
}

.tp-details-body {
    padding: 20px;
    background: #fff;
    border-top: 1px solid #eaeaea;
}

/* Sortable Table Header */
.sortable-th {
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
}

.sortable-th:hover {
    background-color: #ececec;
}

.sort-icon {
    display: inline-block;
    margin-left: 5px;
    opacity: 0.3;
}

.sortable-th.active .sort-icon {
    opacity: 1;
    color: #d32f2f;
}

/* Application Section Styling */
.tp-application-section {
    background: #fdfdfd;
    border-left: 4px solid #d32f2f;
    padding: 25px 30px;
    margin: 50px 0;
    border-radius: 0 8px 8px 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
}

.tp-application-section h4 {
    color: #d32f2f;
    margin-top: 0;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 1.1rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.tp-application-section ul {
    margin-bottom: 0;
}

.tp-application-section li {
    margin-bottom: 8px;
    font-size: 1.05rem;
}

/* Product Features - Enhanced Styling (Gradient List) */
.topland-spec-section {
    margin-top: 30px;
}

.topland-spec-section h4 {
    color: #333;
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #d32f2f;
    display: inline-block;
}

.topland-spec-section ul.tp-features-list {
    padding-left: 0;
    list-style: none;
    margin: 0;
}

.topland-spec-section ul.tp-features-list li {
    position: relative;
    padding: 10px 15px 10px 30px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #fafafa 0%, #f5f5f5 100%);
    border-radius: 0;
    font-size: 0.95rem;
    color: #444;
    transition: all 0.2s ease;
    border-left: 3px solid #d32f2f;
}

.topland-spec-section ul.tp-features-list li::before {
    content: "✓";
    position: absolute;
    left: 10px;
    color: #d32f2f;
    font-weight: bold;
}

.topland-spec-section ul.tp-features-list li:hover {
    background: linear-gradient(135deg, #fff5f5 0%, #ffeaea 100%);
    transform: translateX(5px);
}

/* Responsive */
@media (max-width: 768px) {
    .tp-product-wrapper {
        flex-direction: column;
        gap: 20px;
    }

    .tp-detail-left {
        flex: 0 0 100%;
        max-width: 100%;
        width: 100%;
    }
}