/**
 * CarbonGuru Product Footprints - Styles
 * Minimal styling that inherits from theme
 */

.carbonguru-product-footprints {
    max-width: 100%;
    margin: 0 auto;
}

.carbonguru-product-footprints h2 {
    margin-bottom: 1.5em;
}

/* Search form */
.carbonguru-search-form {
    margin-bottom: 2em;
    display: flex;
    gap: 0.5em;
    flex-wrap: wrap;
}

.carbonguru-search-form input[type="text"] {
    flex: 1;
    min-width: 200px;
    padding: 0.5em;
    border: 1px solid #ddd;
    border-radius: 3px;
}

.carbonguru-search-form button {
    padding: 0.5em 1.5em;
}

.carbonguru-search-form .clear-search {
    padding: 0.5em 1em;
    text-decoration: none;
    border: 1px solid #ddd;
    border-radius: 3px;
    display: inline-block;
}

/* Result count */
.result-count {
    margin-bottom: 1em;
    color: #666;
    font-size: 0.9em;
}

/* Products table - inherits WooCommerce styling */
.carbonguru-footprints-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 2em;
    background: #fff;
}

.carbonguru-footprints-table thead th {
    text-align: left;
    padding: 1em;
    background: #f7f7f7;
    border-bottom: 2px solid #ddd;
    font-weight: 600;
}

.carbonguru-footprints-table thead th a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.carbonguru-footprints-table thead th a:hover {
    color: #0073aa;
}

.carbonguru-footprints-table tbody td {
    padding: 1em;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}

.carbonguru-footprints-table tbody tr:hover {
    background: #f9f9f9;
}

/* Responsive table */
@media screen and (max-width: 768px) {
    .carbonguru-footprints-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    .carbonguru-footprints-table thead,
    .carbonguru-footprints-table tbody,
    .carbonguru-footprints-table tr,
    .carbonguru-footprints-table td,
    .carbonguru-footprints-table th {
        display: block;
    }

    .carbonguru-footprints-table thead {
        display: none;
    }

    .carbonguru-footprints-table tbody tr {
        margin-bottom: 1.5em;
        border: 1px solid #ddd;
        border-radius: 3px;
    }

    .carbonguru-footprints-table tbody td {
        text-align: right;
        padding-left: 50%;
        position: relative;
        white-space: normal;
    }

    .carbonguru-footprints-table tbody td::before {
        content: attr(data-label);
        position: absolute;
        left: 1em;
        width: 45%;
        padding-right: 10px;
        white-space: nowrap;
        text-align: left;
        font-weight: 600;
    }
}

/* Offset button */
.offset-btn {
    padding: 0.5em 1em;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.9em;
}

.offset-btn:hover {
    background: #005177;
}

.offset-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Pagination */
.carbonguru-pagination {
    text-align: center;
    margin-top: 2em;
}

.carbonguru-pagination .page-numbers {
    display: inline-block;
    padding: 0.5em 1em;
    margin: 0 0.25em;
    background: #f7f7f7;
    border: 1px solid #ddd;
    border-radius: 3px;
    text-decoration: none;
    color: #333;
}

.carbonguru-pagination .page-numbers:hover {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
}

.carbonguru-pagination .page-numbers.current {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
}

.carbonguru-pagination .page-numbers.dots {
    border: none;
    background: transparent;
}

/* Offset status styling */
.offset-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
}

.offset-status.offset-purchased {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.offset-status.offset-not-purchased {
    background: #f8f9fa;
    color: #6c757d;
    border: 1px solid #dee2e6;
}

.offset-icon {
    font-size: 14px;
    font-weight: bold;
}

.offset-cert-link {
    text-decoration: none;
    font-size: 16px;
    margin-left: 4px;
    transition: transform 0.2s;
}

.offset-cert-link:hover {
    transform: scale(1.2);
}

/* Mobile responsive for offset status */
@media (max-width: 768px) {
    .offset-status {
        font-size: 11px;
        padding: 3px 6px;
    }

    .offset-text {
        display: none;
    }

    .offset-icon {
        font-size: 16px;
    }
}
