/* ==========================================================================
   SHOP STYLES
   ========================================================================== */

/* --- MAIN GRID --- */
.trelawny-shop-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 40px;
    width: 100%;
    padding: 40px;
    box-sizing: border-box;
}

/* --- SIDEBAR HEADER --- */
.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 30px;
}

.filter-title {
    font-family: "roboto", sans-serif;
    font-weight: 800;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #313231;
    letter-spacing: 0.05em;
}

.filter-reset {
    font-size: 0.85rem;
    color: #ed1d23;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    text-transform: capitalize;
}

/* --- SEARCH --- */
.sidebar-search-wrapper {
    position: relative;
    padding-bottom: 30px;
    margin-bottom: 20px;
    border-bottom: 3px solid #ed1d23;
}

.sidebar-search-wrapper input {
    width: 100%;
    padding: 12px 10px 12px 40px;
    border: 0;
    border-radius: 0;
    font-size: 1rem;
    background: #fff;
    box-sizing: border-box;
    font-family: inherit;
    font-weight: 600;
}

.sidebar-search-wrapper .search-icon {
    position: absolute;
    left: 12px;
    top: 26px;
    transform: translateY(-50%);
    pointer-events: none;
    opacity: 1;
    color: #333;
    stroke: #333;
}

/* --- ACCORDION (Taxonomy Titles) --- */
.filters-container {
    display: flex;
    flex-direction: column;
}

.filter-accordion {
    position: relative;
    padding-bottom: 20px;
    margin-bottom: 20px;
    border-bottom: 3px solid #ed1d23;
}

.filters-container .filter-accordion:last-child {
    border-bottom: 0;
}

.filter-accordion summary {
    list-style: none;
    cursor: pointer;
    font-weight: 800;
    text-transform: uppercase;
    font-size: 0.95rem;
    color: #313231;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    padding: 5px 0;
    transition: color 0.2s;
    gap: 5px;
}

.filter-accordion summary:hover {
    color: #ed1d23;
}

.filter-accordion summary::-webkit-details-marker {
    display: none;
}

/* ACCORDION CHEVRON (Right -> Down) */
.filter-accordion summary .trel-chev {
    transition: transform 0.3s ease;
    transform: rotate(0deg);
    color: #333;
    width: 20px;
    height: 20px;
}

.filter-accordion[open] summary .trel-chev {
    transform: rotate(90deg);
}

.filter-accordian .trel-chev{
    width: 15px;
    height: 15px;
    fill: #333;
}

.filter-accordian .trel-chev #chev{
    fill: #333;
}

/* --- CHECKBOX ITEMS (The Filter Options) --- */
.filter-options {
    padding: 15px 0 5px 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.filter-item {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}

.filter-item input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

/* THE CHECKBOX BOX */
.checkmark {
    height: 20px;
    width: 20px;
    /* border: 1px solid #ddd;  <-- Optional: Border around box? */
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* STATE 1: UNCHECKED (Chevron Right) */
.checkmark::before {
    content: '';
    display: block;
    width: 6px;
    height: 6px;
    border-top: 2px solid #313231;
    border-right: 2px solid #313231;
    transform: rotate(45deg); /* Makes a Chevron Pointing Right */
    margin-right: 2px;
    transition: all 0.2s;
}

/* STATE 2: CHECKED (Red X) */
.filter-item input:checked ~ .checkmark::before {
    display: none; /* Hide chevron */
}

.filter-item input:checked ~ .checkmark::after {
    content: '✕';
    color: #ed1d23;
    font-weight: 900;
    font-size: 16px;
    line-height: 1;
}

/* TEXT STYLES */
.label-text {
    font-size: 0.95rem;
    color: #333;
    transition: color 0.2s;
    text-transform: capitalize;
}

.filter-item:hover .label-text {
    color: #313231;
}

.filter-item input:checked ~ .label-text {
    color: #ed1d23;
    font-weight: 700;
}

.count {
    font-size: 0.8rem;
    color: #ccc;
    margin-left: 4px;
}

.product-view-header {
    max-width: 100%;
    margin: 0;
}

/* --- PRODUCT GRID --- */
.product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    width: 100%;
    max-width: 100%;
}

.prod-card {
    background: #fff;
    border: 1px solid #fff;
    border-radius: 0 0 1rem 0;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    transition: border 0.3s, box-shadow 0.3s;
}

.prod-card:hover {
    border-color: #ed1d23;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.prod-card figure {
    margin: 0;
    padding: 20px;
    background: #fff;
    text-align: center;
    height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.prod-card figure img {
    max-height: 100%;
    width: auto;
    object-fit: contain;
}

.prod-card .details {
    padding: 0 20px 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.prod-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 5px 0;
    color: #313231;
    line-height: 1.2;
}

.prod-card .models {
    font-size: 0.65rem;
    color: #ed1d23;
    font-weight: 600;
}

.prod-card .divider {
    height: 2px;
    background: #ed1d23;
    margin: 20px 0;
    width: 100%;
    opacity: 1;
}

.prod-card .bottom-row {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 10px;
    margin-top: auto;
}

.prod-card .short-desc {
    font-size: 0.65rem;
    color: #333;
    line-height: 1.3;
}

.prod-card .arrow-btn {
    background: #ed1d23;
    color: #fff;
    border-radius: 0 0 0.7rem 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
    padding: 10px 13px 10px 10px;
    position: relative;
    overflow: hidden;
}

.prod-card .arrow-btn .trel-chev{
    fill: #ffffff;
}

.prod-card .arrow-btn .trel-chev #chev{
    fill: #ffffff;
}

.prod-card .arrow-btn .divide_marker div{
    background: #ffffff;
}

.arrow-btn .divide_marker {
    display: flex;
    position: absolute;
    top: 50%;
    right: -6px;
    height: 10px;
    transform: translateY(-50%) rotate(90deg);
    overflow: hidden;
}
@media (min-width: 1000px) {
    .arrow-btn .divide_marker {
        top: 50%;
        transform: translateY(-50%) rotate(90deg);
    }
}
.arrow-btn .divide_marker div {
    background-color: hsl(358, 85%, 52%);
    border-radius: 2px 0 0 2px;
    width: 2px;
    height: 1em;
}
@media (min-width: 1000px) {
    .arrow-btn .divide_marker div {
        background-color: hsl(0, 100%, 100%);
    }
}

/* Category Grid */
.category-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    max-width: 100%;
    margin: 0;
}

.cat-card {
    background: #fff;
    border-radius: 0 0 1em 0;
    border: 1px solid #fff;
    text-decoration: none;
    color: #313231;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
    transition: all 0.3s ease;
    box-shadow: 2px 2px 7px 0px rgba(0, 0, 0, 0.1);
    -webkit-box-shadow: 2px 2px 7px 0px rgba(0, 0, 0, 0.1);
    -moz-box-shadow: 2px 2px 7px 0px rgba(0, 0, 0, 0.1);
    height: 100%;
    aspect-ratio: 1 / 1;
    gap: 10px;
}

.cat-card:hover {
    transform: translateY(-5px);
    border-color: #ed1d23;
}

.cat-card .icon {
    height: 80%;
    width: 80%;
}

.cat-card .icon.all svg polygon{
    fill: #d51a1f;
    stroke: #fff;
    stroke-width: 5px;
}

.cat-card .icon.all svg .cls-1{
    fill: #ed1d23 !important;
}

.cat-card .icon img, .cat-card .icon svg {
    width: 100%;
    height: 100%;
    object-fit: contain;
    fill: #d51a1f;
    stroke: #fff;
    stroke-width: 5px;
}

.cat-card .title {
    font-weight: 700;
    font-size: 1.1rem;
    text-align: center;
    color: #333;
    text-transform: uppercase;
}
/* back btn */
.back-row{
    position: relative;
    display: flex;
    flex-direction: row;
    margin-bottom: 15px;
    gap: 20px;
    justify-content: center;
    align-items: center;
}

.back-row .back-btn{
    display: flex;
    flex-direction: row;
    text-decoration: none;
    justify-content: center;
    align-items: center;
    color: #ED1D23FF;
    text-transform: uppercase;
    font-weight: 600;
    font-size: 0.8rem;
    line-height: 1;
    gap: 5px;
}

.trel-chev{
    width: 15px;
    height: 15px;
    fill: #ED1D23FF;
}

.trel-chev #chev{
    fill: #ED1D23FF;
}

.back-row .back-btn .trel-chev{
    transform: rotate(180deg);
    width: 10px;
    height: 10px;
    fill: #ED1D23FF;
}

.back-row .back-btn .trel-chev #chev{
    fill: #ED1D23FF;
}

.back-row .red-line-spacer{
    width: auto;
    height: 2px;
    background: #ED1D23FF;
    flex-grow: 1;
}

/* Responsive */
@media (max-width: 1300px) {
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* --- MOBILE-SPECIFIC REFACTOR (Under 900px) --- */
@media (max-width: 900px) {
    .trelawny-shop-layout {
        display: flex;
        flex-direction: column; /* Stack sidebar above content */
        padding: 15px;
        gap: 20px;
    }

    .shop-sidebar {
        display: block; /* Ensure it's visible */
        width: 100%;
        background: #f9f9f9;
        padding: 15px;
        border-radius: 0 0 1rem 0;
        box-sizing: border-box;
    }

    /* Transform Sidebar Header into a Toggle Button if needed,
       or keep it as a compact header */
    .sidebar-header {
        padding-bottom: 15px;
    }

    /* Stack Search and Accordions */
    .sidebar-search-wrapper {
        margin-bottom: 15px;
        padding-bottom: 15px;
    }
}

@media (max-width: 600px) {
    .product-grid {
        grid-template-columns: 1fr;
    }
}

.home-btn svg path {
    fill: #333333 !important;
}

/* --- RESPONSIVE GRIDS --- */
@media (max-width: 900px) {
    /* Product Grid: 2 Columns */
    .product-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 15px;
    }

    /* Category Grid: 2 Columns */
    .category-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 15px;
    }

    .cat-card {
        padding: 15px;
        aspect-ratio: 1 / 1;
    }

    .cat-card .title {
        font-size: 0.85rem;
    }

    .filters-container .filter-accordion:last-child{
        margin: 0;
        padding: 0;
    }
}

/* --- SMALL MOBILE (Under 480px) --- */
@media (max-width: 480px) {
    /* Optional: drop to 1 column for very small screens if cards feel cramped */
    .product-grid, .category-grid {
        grid-template-columns: 1fr 1fr !important;
    }
}

.enquire-btn {
    position: relative;
    color: #ffffff;
    background-color: #ED1D23FF;
    display: inline-block;
    padding: 0.6em 0.8em;
    padding-right: var(--space-l);
    margin-left: var(--space-xs);
    border-radius: 0 0 1em 0 !important;
    text-decoration: none;
    text-transform: uppercase;
    font-weight: 800;
    font-family: "roboto", sans-serif !important;
    text-wrap-mode: nowrap;
}

.enquire-btn .divide_marker {
    top: 1em;
    transform: rotate(90deg);
    display: flex;
    position: absolute;
    right: -2px;
}

.enquire-btn .divide_marker div {
    background-color: #FFFFFF;
}

/* --- SHOP BASICS --- */
.shop-content {
    margin: 0;
}