/*
* Archive-products.css
*/
.page-hero {
    padding: clamp(var(--s6), 7vw, var(--s7)) 0 var(--s5);
    background: linear-gradient(180deg, var(--bg), #e6f2ed);
    border-bottom: 1px solid var(--line);
}

.page-hero h1 {
    max-width: 25ch;
}

.page-hero .lead {
    max-width: 65ch;
    margin-top: 4px;
}

.controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    background: var(--bg-elev);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 8px 10px;
}

.controls input[type="search"] {
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--bg-elev);
}

.controls select {
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--bg-elev);
}

.seg {
    display: inline-flex;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--bg-elev);
    padding: 4px;
}

.seg button {
    border: 0;
    background: transparent;
    padding: 8px 12px;
    border-radius: 999px;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
}

.seg button[aria-pressed="true"] {
    background: var(--green);
    color: #fff;
}

/* ===============================
   CARD & CTA (updated & rounded)
================================*/
.card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    background: var(--bg-elev);
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 16px;
    height: 100%;
    box-sizing: border-box;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
    transform: translateY(-2px);
}

/* Top section */
.card .top {
    display: grid;
    grid-template-columns: 84px 1fr auto;
    gap: 14px;
    align-items: center;
}

.thumb {
    width: 84px;
    height: 84px;
    border-radius: 16px;
    object-fit: cover;
    border: 1px solid var(--line);
}

.card h3 {
    margin: 0;
    font-size: 18px;
}

.kv {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.kv .pill {
    background: rgba(255, 255, 255, 0.7);
    border-radius: 999px;
    padding: 4px 10px;
}

/* CTA section stays at bottom but in flow */
.card .cta {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding-top: 12px;
}

.card .cta-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.card .cta .btn {
    padding: 10px 16px;
    font-size: 14px;
    border-radius: 999px;
    text-align: center;
}

.card .cta .badge {
    margin-left: auto;
    font-weight: 600;
    white-space: nowrap;
}

/* === Responsive === */
@media (max-width: 680px) {
    .card {
        padding: 16px;
    }

    .card .cta {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .card .cta-buttons {
        display: flex;
        flex-direction: row;
        gap: 10px;
    }

    .card .cta-buttons .btn {
        flex: 1;
    }

    .card .cta .badge {
        text-align: center;
        width: 100%;
        margin-left: 0;
    }
}

/* ===============================
   TABLE + LAYOUT
================================*/
.table-wrap {
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--bg-elev);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
}

thead th {
    position: sticky;
    top: 0;
    background: var(--bg-elev);
    z-index: 2;
}

th.sort {
    cursor: pointer;
    user-select: none;
}

th.num,
td.num {
    text-align: right;
}

tbody tr:hover td {
    background: rgba(0, 0, 0, 0.02);
}

/* column highlight on hover */
td:hover,
th:hover {
    position: relative;
}

td:hover::after,
th:hover::after {
    content: "";
    position: absolute;
    inset: -1px;
    outline: 2px solid rgba(0, 180, 131, 0.35);
    pointer-events: none;
    border-radius: 6px;
}

.empty {
    padding: 18px;
    color: var(--muted);
    text-align: center;
}

.grid-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--grid-gap);
}

@media (max-width:980px) {
    .grid-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width:680px) {
    .grid-cards {
        grid-template-columns: 1fr;
    }
}

/* ===============================
   About Hero
================================*/
.about-hero .product-details { grid-column: 1; grid-row: 1; }
.about-hero #heroImgWrap { grid-column: 2; grid-row: 1; }
.about-hero .actions-under-tabs { grid-column: 1 / -1; grid-row: 2; margin-top: var(--s5); }

@media (max-width:980px){
  .about-hero .product-details { grid-column: 1; grid-row: 1; }
  .about-hero #heroImgWrap { grid-column: 1; grid-row: 2; }
  .about-hero .actions-under-tabs { grid-column: 1; grid-row: 3; margin-top: 24px; }
}

/* ===============================
   Mobile Controls
================================*/
@media (max-width: 768px) {
    .controls {
        flex-direction: column;
        align-items: stretch;
        border-radius: 12px;
        padding: 10px;
    }

    .controls > *:not(.collapsible-filters) {
        width: 100%;
    }

    .controls .seg {
        justify-content: center;
        margin-bottom: 10px;
        width: 100%;
        justify-content: stretch;
    }

    .seg button {
        flex: 1;
        transition: background 0.3s ease-in-out, color 0.3s ease-in-out;
    }

    .controls input[type="search"] {
        margin-bottom: 10px;
    }

    #toggleFilters {
        display: block;
        width: 100%;
        margin-bottom: 10px;
    }

    .collapsible-filters {
        display: none;
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }

    .collapsible-filters.active {
        display: flex !important;
    }

    .collapsible-filters select {
        width: 100%;
    }

    .badge {
        width: 100%;
        text-align: center;
        margin-top: 10px;
    }
}

@media (min-width: 769px) {
    #toggleFilters {
        display: none;
    }

    .collapsible-filters {
        display: flex;
        flex-direction: row;
        gap: 10px;
    }
}