/* ==========================================================================
   WP Trust WooCommerce Products – frontend styles
   ========================================================================== */

/* ---- Sort / filter bar --------------------------------------------------- */
.trust-sort-bar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-bottom: 12px;
}

.trust-sort-label {
    font-size: 0.875rem;
    color: #555;
    white-space: nowrap;
}

.trust-product-count {
    font-size: 0.875rem;
    color: #555;
    white-space: nowrap;
    margin-right: auto;
}

.trust-sort-select {
    font-size: 0.875rem;
    padding: 5px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
    color: #333;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s ease;
    width: auto;
}

.trust-sort-select:focus {
    border-color: #007cba;
}

.trust-filter-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.trust-filter-label {
    font-size: 0.875rem;
    color: #555;
    white-space: nowrap;
}

.trust-filter-select {
    font-size: 0.875rem;
    padding: 5px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
    color: #333;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s ease;
    width: auto;
}

.trust-filter-select:focus {
    border-color: #007cba;
}

/* ---- Table --------------------------------------------------------------- */
.trust-products-table {
    width: 100% !important;
    min-width: 100%;
    border-collapse: collapse;
    font-size: 0.9375rem;
    table-layout: fixed;
}

/* ---- Thumbnail ----------------------------------------------------------- */
.trust-col-thumb {
    width: 140px;
}

.trust-products-table td {
    padding: 14px 14px;
    vertical-align: middle;
}

.trust-col-title,
.trust-col-attrs,
.trust-col-price,
.trust-col-actions {
    vertical-align: top !important;
}

.trust-product-row {
    border-bottom: 10px solid #F6F3EB;
}

.trust-product-row:hover {
    background: #fafafa;
}

.trust-products-table .trust-col-thumb img.trust-product-thumbnail,
.trust-products-table .trust-col-thumb img.trust-product-thumbnail.wp-post-image {
    width: 120px;
    height: 120px;
    object-fit: cover;
    display: block;
    border-radius: 12px !important;
    border: 1px solid #e0e0e0 !important;
    box-shadow: none;
    max-width: unset;
}

/* ---- Title --------------------------------------------------------------- */
.trust-col-title {
    width: auto; /* fills remaining space */
    overflow: hidden;
}

a.trust-product-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #333;
    text-decoration: none;
    line-height: 1.4;
}

a.trust-product-title:hover {
    color: #007cba;
}

.trust-product-short-desc {
    margin-top: 4px;
    font-size: 0.8125rem;
    color: #666;
    line-height: 1.5;
}

/* ---- Price --------------------------------------------------------------- */
.trust-col-price {
    width: 140px;
    white-space: nowrap;
}

/* ---- Attributes ---------------------------------------------------------- */
.trust-col-attrs {
    width: 200px;
}

.trust-product-attrs {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.trust-product-attr {
    font-size: 0.8125rem;
    color: #555;
    line-height: 1.4;
}

.trust-attr-label {
    font-weight: 600;
    color: #333;
    margin-right: 3px;
}

.trust-attr-value {
    color: #555;
}

/* ---- Actions ------------------------------------------------------------- */
.trust-col-actions {
    width: 260px;
    white-space: nowrap;
    padding-left: 20px !important;
}

.trust-col-actions-inner {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.trust-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 4px;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    flex: 1;
    text-align: center;
    white-space: nowrap;
}

.trust-btn-details {
    background: transparent;
    color: #007cba;
    border: 1px solid #007cba;
}

.trust-btn-details:hover {
    background: #007cba;
    color: #ffffff;
}

.trust-btn-add-to-cart {
    background: #007cba;
    color: #ffffff;
    border: none;
}

.trust-btn-add-to-cart:hover {
    background: #005a8c;
    color: #ffffff;
}

.trust-btn-add-to-cart.added {
    background: #28a745;
}

.trust-btn-read-more {
    background: #f0f0f0;
    color: #333;
    border: 1px solid #ccc;
}

.trust-btn-read-more:hover {
    background: #e0e0e0;
}

/* ---- Messages ------------------------------------------------------------ */
.trust-error,
.trust-no-products {
    padding: 12px 16px;
    border-radius: 4px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    color: #856404;
}

/* ---- Infinite scroll status ---------------------------------------------- */
.trust-scroll-sentinel {
    height: 1px;
}

.trust-scroll-status {
    padding: 16px 0;
    text-align: center;
    font-size: 0.875rem;
    color: #666;
}

.trust-scroll-loader {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.trust-scroll-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid #ddd;
    border-top-color: #007cba;
    border-radius: 50%;
    animation: trust-spin 0.7s linear infinite;
    flex-shrink: 0;
}

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

.trust-scroll-end {
    color: #888;
    font-style: italic;
    padding: 8px 0;
}

.trust-scroll-error {
    color: #c0392b;
    background: #fdecea;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    padding: 8px 14px;
    display: inline-block;
}

/* ---- Product attribute tiles -------------------------------------------- */
.trust-product-attributes {
    --trust-product-attributes-columns: 4;
    display: grid;
    grid-template-columns: repeat(var(--trust-product-attributes-columns), minmax(0, 1fr));
    gap: 18px;
    width: 100%;
}

.trust-product-attribute-tile {
    background: #f6f3eb;
    border-radius: 0;
    /* padding: 20px 22px; */
    /* min-height: 130px; */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.trust-product-attribute-tile-label {
    display: block;
    margin-bottom: 5px;
    font-size: 12px;
    line-height: 1.2;
    font-weight: 400;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #5C6270;
    font-family: 'Inter';
    min-width: 120px;
}

.trust-product-attribute-tile-value {
    display: block;
    font-size: 15px;
    line-height: 1.1;
    font-weight: 500;
    color: #0B0F14;
    font-family: 'Inter';
}

/* ---- Responsive ---------------------------------------------------------- */
@media (max-width: 899px) {
    .trust-product-attributes {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 599px) {
    .trust-product-attributes {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .trust-product-attribute-tile {
        min-height: 0;
        padding: 18px 16px;
    }

    .trust-products-table thead {
        display: none;
    }

    .trust-products-table,
    .trust-products-table tbody,
    .trust-product-row,
    .trust-products-table td {
        display: block;
        width: 100%;
    }

    .trust-product-row {
        padding: 12px 0;
        border-bottom: 1px solid #e8e8e8;
    }

    .trust-products-table td {
        padding: 4px 0;
    }

    .trust-col-thumb {
        width: 100%;
    }

    .trust-product-thumbnail {
        width: 80px;
        height: 80px;
    }

    .trust-col-actions {
        width: 100%;
    }
}
