/* =========================
   Wrapper & header
   ========================= */

.pg-wrapper {
    margin: 2rem auto 3rem;
    max-width: 1200px;
}

.pg-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1.5rem;
}

.pg-title {
    font-size: 1.6rem;
    margin: 0 0 0.15rem;
}

.pg-subtitle {
    margin: 0;
    color: #777;
    font-size: 0.9rem;
}

/* toolbar container (right side) */

.pg-toolbar-form {
    margin-left: auto;
}

.pg-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    align-items: center;
    justify-content: flex-end;
}

/* =========================
   Search + filters
   ========================= */

:root {
    --pg-control-height: 38px;
}

/* Search box */

.pg-search {
    position: relative;
    min-width: 260px;
    max-width: 320px;
}

.pg-search input {
    width: 100%;
    height: var(--pg-control-height);
    padding: 0 2.2rem 0 0.9rem;
    border-radius: 999px;
    border: 1px solid #ddd;
    font-size: 0.85rem;
    line-height: var(--pg-control-height);
    outline: none;
    box-shadow: none;
    background: #fff;
    box-sizing: border-box;
}

.pg-search input:focus {
    border-color: #ff4b81;
    box-shadow: 0 0 0 2px rgba(255, 75, 129, 0.12);
}

.pg-search-btn {
    position: absolute;
    right: 0.7rem;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border: none;
    padding: 0;
    margin: 0;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    color: #666;
}

/* Filters (sort + category) */

.pg-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.pg-select {
    height: var(--pg-control-height);
    line-height: var(--pg-control-height);
    padding: 0 1.6rem 0 0.9rem;
    border-radius: 999px;
    border: 1px solid #ddd !important;
    font-size: 0.8rem;
    background-color: #fff !important;
    background-image: none;
    box-shadow: none;
    outline: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    box-sizing: border-box;
    cursor: pointer;
    align-self: center;
}

/* =========================
   Product grid + cards
   ========================= */

.pg-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.25rem;
}

.pg-card {
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

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

/* IMAGE AREA – like your reference:
   rounded rectangle inset from card edges
   SALE + heart inside that area
*/

.pg-card-media {
    position: relative;
    margin: 0.75rem 0.9rem 0;  /* spacing from card edges */
    border-radius: 18px;
    overflow: hidden;
    background: #fbe3ec;       /* soft pink behind image */
}

/* aspect-ratio box so we have a real height */
.pg-card-media::before {
    content: "";
    display: block;
    padding-top: 75%;          /* 4:3 ratio (75% = 3/4) */
}

/* image fills the whole pink area */
.pg-card-media img {
    position: absolute;
    inset: 0;                  /* top/right/bottom/left: 0 */
    width: 100%;
    height: 100%;
    object-fit: cover;         /* crop to fill */
    display: block;
}

/* badges / wishlist overlayed on image */

.pg-badge-sale {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    background: #ff4b81;
    color: #fff;
    font-size: 0.7rem;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
}

.pg-wishlist-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    border: none;
    background: #fff;
    border-radius: 999px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* =========================
   Card body – compact
   ========================= */

.pg-card-body {
    padding: 0.7rem 1rem 0.55rem;
    display: flex;
    flex-direction: column;
}

/* reset default margins */
.pg-card-body > * {
    margin: 0;
}

/* controlled vertical spacing */
.pg-card-body > * + * {
    margin-top: 0.25rem;
}

.pg-product-title {
    font-size: 0.98rem;
}

.pg-product-title a {
    text-decoration: none;
    color: #222;
}

.pg-product-title a:hover {
    color: #ff4b81;
}

.pg-rating {
    font-size: 0.8rem;
}

/* tighten excerpt */
.pg-excerpt {
    font-size: 0.85rem;
    color: #555;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Footer spacing */

.pg-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 0.25rem;
}

/* price block – no extra space from del/ins */

.pg-price {
    font-weight: 700;
    font-size: 0.95rem;
}

.pg-price del,
.pg-price ins {
    display: block;
    margin: 0;
    line-height: 1.2;
}

/* ADD TO CART BUTTON – icon/text aligned */

.pg-add-to-cart-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    font-size: 0.85rem;
    line-height: 1;
    border: none;
    background: #ff4b81;
    color: #fff;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
}

.pg-add-to-cart-button i {
    line-height: 0;
    font-size: 0.9rem;
}

.pg-add-to-cart-button:hover {
    background: #e63c72;
}

/* =========================
   Empty state
   ========================= */

.pg-no-results {
    text-align: center;
    margin: 2rem 0;
}

/* =========================
   Pagination
   ========================= */

.pg-pagination {
    margin-top: 2rem;
    text-align: center;
}

.pg-pagination ul {
    list-style: none;
    padding: 0;
    display: inline-flex;
    gap: 0.25rem;
}

.pg-pagination li a,
.pg-pagination li span {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    border-radius: 999px;
    border: 1px solid #ddd;
    font-size: 0.85rem;
    text-decoration: none;
    color: #333;
}

.pg-pagination li span.current {
    background: #ff4b81;
    color: #fff;
    border-color: #ff4b81;
}

/* =========================
   Responsive tweaks
   ========================= */

@media (max-width: 768px) {
    .pg-header {
        align-items: flex-start;
    }

    .pg-toolbar {
        justify-content: flex-start;
    }
}
