﻿/* ============================================
   SHOP PAGE - PRODUCT CARDS (Redesigned)
   Matches the clean, modern design in reference
   ============================================ */

/* ---------- Page background ---------- */
.section {
    background: #f4f6f3;
}

/* ---------- Sort Bar ---------- */
.sort-bar {
    background: #fff;
    padding: 14px 20px;
    border-radius: 14px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.06);
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.search-bar-shop {
    flex: 1;
    min-width: 220px;
}

    .search-bar-shop input {
        width: 100%;
        padding: 10px 18px;
        border: 1.5px solid #e0e6e0;
        border-radius: 10px;
        font-size: 14px;
        background: #fafafa;
        transition: border-color 0.2s;
        outline: none;
        font-family: inherit;
    }

        .search-bar-shop input:focus {
            border-color: #2d5f3f;
            background: #fff;
        }

#sort-select {
    padding: 10px 16px;
    border: 1.5px solid #e0e6e0;
    border-radius: 10px;
    background: #fafafa;
    cursor: pointer;
    font-size: 14px;
    min-width: 180px;
    outline: none;
    transition: border-color 0.2s;
    font-family: inherit;
    color: #444;
}

    #sort-select:focus {
        border-color: #2d5f3f;
        background: #fff;
    }

/* ---------- Filters Panel ---------- */
.filters-panel {
    background: #fff;
    padding: 24px 20px;
    border-radius: 14px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.06);
    position: sticky;
    top: 90px;
}

    .filters-panel h5 {
        font-size: 17px;
        font-weight: 700;
        color: #1a3528;
        margin-bottom: 20px;
        display: flex;
        align-items: center;
        gap: 8px;
    }

.filter-group {
    margin-bottom: 22px;
    padding-bottom: 22px;
    border-bottom: 1px solid #f0f0f0;
}

    .filter-group:last-of-type {
        border-bottom: none;
    }

    .filter-group h6 {
        font-size: 13px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.8px;
        color: #2d3748;
        margin-bottom: 12px;
    }

.filter-option {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    gap: 8px;
}

    .filter-option input[type="radio"],
    .filter-option input[type="checkbox"] {
        accent-color: #2d5f3f;
        width: 16px;
        height: 16px;
        cursor: pointer;
    }

    .filter-option label {
        font-size: 14px;
        color: #4a5568;
        cursor: pointer;
        transition: color 0.2s;
    }

    .filter-option input:checked + label {
        color: #2d5f3f;
        font-weight: 600;
    }

.price-range {
    display: flex;
    align-items: center;
    gap: 10px;
}

    .price-range input {
        flex: 1;
        padding: 9px 12px;
        border: 1.5px solid #e0e6e0;
        border-radius: 8px;
        font-size: 14px;
        outline: none;
        transition: border-color 0.2s;
        background: #fafafa;
    }

        .price-range input:focus {
            border-color: #2d5f3f;
            background: #fff;
        }

    .price-range span {
        color: #999;
        font-weight: 500;
    }

.btn-outline {
    width: 100%;
    padding: 11px 20px;
    background: transparent;
    border: 1.5px solid #2d5f3f;
    color: #2d5f3f;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.25s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 4px;
}

    .btn-outline:hover {
        background: #2d5f3f;
        color: #fff;
    }

/* ---------- Product Cards ---------- */
.product-col {
    display: flex;
}

.p-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.07);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
    display: flex;
    flex-direction: column;
    width: 100%;
    opacity: 0;
    transform: translateY(16px);
}

.p-card--visible {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.4s ease, transform 0.4s ease, box-shadow 0.3s ease;
}

.p-card:hover {
    box-shadow: 0 10px 30px rgba(0,0,0,0.12);
    transform: translateY(-4px);
}

/* Image wrapper */
.p-card__image-wrap {
    position: relative;
    width: 100%;
    padding-top: 80%; /* aspect ratio */
    overflow: hidden;
    background: #f0f4f0;
}

.p-card__img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.p-card:hover .p-card__img {
    transform: scale(1.06);
}

/* Badges */
.p-card__badges {
    position: absolute;
    top: 12px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 0 12px;
    pointer-events: none;
}

.badge-featured {
    background: #2d5f3f;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.6px;
    padding: 5px 10px;
    border-radius: 6px;
    text-transform: uppercase;
}

.badge-sale {
    background: #f07b35;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.6px;
    padding: 5px 10px;
    border-radius: 6px;
    text-transform: uppercase;
    margin-left: auto;
}

/* When only sale badge exists it should go to right */
.p-card__badges:not(:has(.badge-featured)) .badge-sale {
    margin-left: auto;
}

.p-card__out-of-stock {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.55);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 5px 14px;
    border-radius: 20px;
    white-space: nowrap;
}

/* Body */
.p-card__body {
    padding: 18px 18px 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.p-card__category {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #8a9a8a;
    margin: 0 0 7px;
}

.p-card__title {
    font-size: 17px;
    font-weight: 700;
    color: #1e2d24;
    margin: 0 0 12px;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.p-card__pricing {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 16px;
}

.price-current {
    font-size: 22px;
    font-weight: 800;
    color: #2d5f3f;
    letter-spacing: -0.5px;
}

.price-original {
    font-size: 14px;
    color: #b0b8b0;
    text-decoration: line-through;
    font-weight: 500;
}

/* Action buttons */
.p-card__actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: auto;
}

.btn-cart {
    flex: 1;
    padding: 13px 16px;
    background: #2d5f3f;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.25s, transform 0.2s, box-shadow 0.25s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
}

    .btn-cart:hover:not(:disabled) {
        background: #1e4129;
        transform: translateY(-2px);
        box-shadow: 0 5px 16px rgba(45, 95, 63, 0.28);
    }

    .btn-cart--disabled,
    .btn-cart:disabled {
        background: #c5cec5;
        cursor: not-allowed;
        opacity: 0.7;
    }

.btn-view {
    width: 46px;
    height: 46px;
    flex-shrink: 0;
    background: #f0f4f0;
    border: none;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.25s, color 0.25s, transform 0.2s;
    color: #4a6856;
    font-size: 16px;
}

    .btn-view:hover {
        background: #2d5f3f;
        color: #fff;
        transform: scale(1.08);
    }

/* ---------- Empty State ---------- */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: #6c757d;
}

    .empty-state i {
        font-size: 60px;
        color: #d0d8d0;
        margin-bottom: 20px;
        display: block;
    }

    .empty-state h4 {
        color: #2d3748;
        margin-bottom: 8px;
        font-weight: 700;
    }

    .empty-state p {
        color: #6c757d;
        font-size: 15px;
    }

/* ---------- Pagination ---------- */
#pagination-controls {
    margin-top: 40px;
    margin-bottom: 20px;
}

.pagination-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.pagination-info {
    font-size: 13px;
    color: #777;
    font-weight: 500;
}

.pagination-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.btn-pagination {
    padding: 10px 18px;
    background: #fff;
    border: 1.5px solid #2d5f3f;
    color: #2d5f3f;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-family: inherit;
}

    .btn-pagination:hover:not(:disabled) {
        background: #2d5f3f;
        color: #fff;
    }

    .btn-pagination:disabled {
        opacity: 0.35;
        cursor: not-allowed;
        border-color: #ccc;
        color: #ccc;
    }

.page-numbers {
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-page {
    min-width: 38px;
    height: 38px;
    padding: 6px 10px;
    background: #fff;
    border: 1.5px solid #e0e6e0;
    color: #4a5568;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 13px;
    font-family: inherit;
}

    .btn-page:hover {
        border-color: #2d5f3f;
        color: #2d5f3f;
    }

    .btn-page.active {
        background: #2d5f3f;
        border-color: #2d5f3f;
        color: #fff;
    }

.pagination-dots {
    color: #ccc;
    font-weight: bold;
    padding: 0 3px;
}

/* ---------- Cart Toast ---------- */
.cart-toast {
    position: fixed;
    bottom: 28px;
    right: 28px;
    background: #1e4129;
    color: #fff;
    padding: 14px 22px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 8px 24px rgba(0,0,0,0.18);
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 10px;
}

    .cart-toast i {
        color: #7ecf9a;
        font-size: 16px;
    }

.cart-toast--show {
    opacity: 1;
    transform: translateY(0);
}

/* ---------- Responsive ---------- */
@media (max-width: 991px) {
    .filters-panel {
        position: static;
        margin-bottom: 20px;
    }
}

@media (max-width: 576px) {
    .p-card__title {
        font-size: 15px;
    }

    .price-current {
        font-size: 19px;
    }

    .btn-cart {
        font-size: 13px;
        padding: 11px 12px;
    }

    .sort-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .search-bar-shop,
    #sort-select {
        width: 100%;
        min-width: 100%;
    }

    .btn-pagination {
        padding: 8px 12px;
        font-size: 12px;
    }

    .btn-page {
        min-width: 34px;
        height: 34px;
        font-size: 12px;
    }

    .cart-toast {
        left: 16px;
        right: 16px;
        bottom: 16px;
    }
}
