/* ===================== */
/* Main Section */
.pd-section {
    padding: 60px 20px;
    background-color: #fff;
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    font-size: 28px;
    margin-bottom: 30px;
    color: #222;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-align: center;
}

/* ===================== */
/* Topbar (Filter + Sort) */
.filter-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-toggle-btn {
    background-color: #000;
    color: #fff;
    padding: 10px 16px;
    font-size: 14px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
}

.filter-toggle-btn:hover {
    background-color: #333;
}

/* ===================== */
/* Filter Sidebar */
.filter-sidebar {
    position: fixed;
    top: 80px;
    left: 0;
    width: 80%;
    max-width: 320px;
    height: calc(100vh - 80px);
    background: #fff;
    z-index: 1001;
    padding: 20px;
    overflow-y: auto;
    transform: translateX(-100%);
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease;
    border-radius: 0 8px 8px 0;
}

.filter-sidebar.open {
    transform: translateX(0);
}

.filter-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: none;
}

.filter-overlay.show {
    display: block;
}

.filter-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.filter-close-btn {
    display: block;
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
}

.filter-group {
    margin-bottom: 20px;
}

.filter-group h4 {
    font-size: 16px;
    margin-bottom: 10px;
    font-weight: 600;
}

.filter-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: #555;
}

.filter-input {
    font-size: 14px;
    padding: 6px 8px;
    border-radius: 6px;
    border: 1px solid #ccc;
}

.price-inputs {
    display: flex;
    gap: 10px;
}

.price-inputs input {
    width: 50%;
}

.apply-filter-btn {
    width: 100%;
    padding: 10px;
    font-size: 14px;
    background-color: #000;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.apply-filter-btn:hover {
    background-color: #333;
}

/* ===================== */
/* Product Grid + Card */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
}

/* Card */
.pd-card {
    position: relative;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    width: 100%;
    max-width: 420px;
    /* max width of card */
    margin: 0 auto;
    /* center if needed */
    text-decoration: none;
    color: inherit;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.pd-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.12);
}

/* ===================== */
/* Image Wrapper */
.pd-img-wrapper {
    width: 100%;
    max-width: 420px;
    /* match card max-width */
    margin: 0 auto;
    border-radius: 12px;
    perspective: 1200px;
    position: relative;
    overflow: hidden;
}

/* Set relative height using aspect-ratio for consistent card size */
.pd-img-wrapper::before {
    content: '';
    display: block;
    padding-top: 100%;
    /* square ratio; adjust 75% for 4:3 etc */
}

/* Images inside wrapper */
.pd-img-wrapper .pd-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    /* show full image */
    object-position: center;
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    backface-visibility: hidden;
    transition: transform 0.8s cubic-bezier(0.4, 0.2, 0.2, 1);
}

/* Front image */
.pd-front {
    transform: rotateY(0deg);
    z-index: 2;
}

/* Back image */
.pd-back {
    transform: rotateY(180deg);
    z-index: 1;
}

/* Flip on hover */
.pd-card:hover .pd-front {
    transform: rotateY(-180deg);
}

.pd-card:hover .pd-back {
    transform: rotateY(0deg);
    z-index: 3;
}


/* ===================== */
/* Product Info */
.pd-info {
    padding: 16px 12px;
    text-align: center;
}

/* ===================== */
/* Product Price Styles */
.pd-price {
    display: flex;
    justify-content: center;
    align-items: baseline;
    gap: 8px;
    font-size: 18px;
    font-weight: 600;
}

.pd-price-original {
    color: #999;
    text-decoration: line-through;
    font-size: 16px;
    font-weight: 400;
}

.pd-price-discount {
    color: #d32f2f;
    font-weight: 700;
    font-size: 18px;
}

/* Responsive: 2 cards per row on small screens */
@media (max-width: 768px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}
