/* ============================================================
   MATESHWARI SHOP PAGE STYLE
   Pink & Blue Premium Design System
   ============================================================ */

:root {
    --pink: #FF4D8F;
    --pink-light: #FFE0EE;
    --pink-soft: #FFF0F6;
    --blue: #2563EB;
    --blue-light: #DBEAFE;
    --blue-soft: #EFF6FF;
    --red: #EF233C;
    --white: #FFFFFF;
    --black: #0F0F0F;
    --gray-50: #FAFAFA;
    --gray-100: #F4F4F5;
    --gray-200: #E4E4E7;
    --gray-400: #A1A1AA;
    --gray-600: #52525B;
    --gray-800: #27272A;

    --r-sm: 8px;
    --r-md: 16px;
    --r-lg: 24px;
    --r-xl: 32px;
    --r-full: 999px;

    --sh-sm: 0 1px 4px rgba(0, 0, 0, .04);
    --sh-md: 0 4px 16px rgba(0, 0, 0, .06);
    --sh-lg: 0 8px 32px rgba(0, 0, 0, .08);
    --sh-pink: 0 4px 16px rgba(255, 77, 143, .18);
    --sh-blue: 0 4px 16px rgba(37, 99, 235, .15);

    --font: 'Plus Jakarta Sans', -apple-system, sans-serif;
}

.shop-layout {
    display: flex;
    gap: 28px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px 20px 120px;
    align-items: flex-start;
    font-family: var(--font);
}

/* ── Category Sidebar (Desktop) ── */
.shop-sidebar {
    width: 240px;
    flex-shrink: 0;
    position: sticky;
    top: 88px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: var(--white);
    border-radius: var(--r-md);
    padding: 16px;
    box-shadow: var(--sh-sm);
    border: 1px solid var(--gray-100);
}

.shop-sidebar::-webkit-scrollbar {
    width: 4px;
}

.shop-sidebar::-webkit-scrollbar-thumb {
    background: var(--gray-200);
    border-radius: var(--r-full);
}

.sidebar-title {
    font-size: 11px;
    font-weight: 800;
    color: var(--gray-400);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-bottom: 14px;
    padding-left: 8px;
}

.category-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cat {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--r-md);
    font-size: 13.5px;
    font-weight: 700;
    color: var(--gray-600);
    cursor: pointer;
    background: transparent;
    border-left: 3px solid transparent;
    transition: background-color 0.25s cubic-bezier(0.16, 1, 0.3, 1), color 0.25s cubic-bezier(0.16, 1, 0.3, 1), padding-left 0.25s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cat-img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--gray-100);
    flex-shrink: 0;
    border: 1.5px solid var(--gray-200);
    transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.cat-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cat:hover {
    background: var(--pink-soft);
    color: var(--pink);
    padding-left: 18px;
    border-left-color: var(--pink-light);
}

.cat:hover .cat-img {
    border-color: var(--pink);
    transform: scale(1.1);
}

.cat.active {
    background: var(--pink-soft);
    color: var(--pink);
    border-left-color: var(--pink);
    font-weight: 800;
    padding-left: 18px;
}

.cat.active .cat-img {
    border-color: var(--pink);
    box-shadow: var(--sh-pink);
}

/* ── Main Shop Area ── */
.shop-main {
    flex: 1;
    min-width: 0;
    overscroll-behavior-y: contain;
}

/* ── Controls Section ── */
.shop-controls {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 24px;
    background: var(--white);
    padding: 8px 0 16px;
    border-bottom: 1px solid var(--gray-100);
}

/* Filter/Sorting Dropdown & Buttons */
.shop-filters-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.sort-dropdown-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
}

#shopSortSelect {
    appearance: none;
    -webkit-appearance: none;
    background: var(--white);
    border: 1.5px solid var(--gray-200);
    border-radius: var(--r-sm);
    padding: 7px 32px 7px 12px;
    font-size: 13px;
    font-weight: 700;
    color: var(--gray-600);
    outline: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font);
}

#shopSortSelect:focus,
#shopSortSelect:hover {
    border-color: var(--pink);
    color: var(--pink);
}

.sort-dropdown-wrapper::after {
    content: '▼';
    font-size: 8px;
    position: absolute;
    right: 12px;
    pointer-events: none;
    color: var(--gray-400);
    transition: color 0.2s;
}

.sort-dropdown-wrapper:hover::after {
    color: var(--pink);
}


/* ── Bento Products Grid ── */
#products {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 18px;
}



/* ── Pagination UI ── */
.woocommerce-pagination {
    display: flex;
    justify-content: center;
    margin-top: 36px;
    width: 100%;
}

.woocommerce-pagination--top {
    margin-top: 0;
    margin-bottom: 24px;
}

.woocommerce-pagination ul {
    display: inline-flex;
    gap: 8px;
    padding: 0;
    margin: 0;
    list-style: none;
    align-items: center;
}

.woocommerce-pagination ul li {
    margin: 0;
}

.woocommerce-pagination ul li a,
.woocommerce-pagination ul li span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: var(--r-sm);
    border: 1.5px solid var(--gray-200);
    font-size: 13px;
    font-weight: 700;
    color: var(--gray-600);
    background: var(--white);
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
}

.woocommerce-pagination ul li a:hover {
    border-color: var(--pink);
    color: var(--pink);
    background: var(--pink-soft);
    transform: translateY(-1px);
}

.woocommerce-pagination ul li span.current {
    background: var(--pink);
    border-color: var(--pink);
    color: var(--white);
    box-shadow: var(--sh-pink);
    cursor: default;
}

/* ============================================================
   MOBILE RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    .shop-layout {
        flex-direction: row;
        padding: 0;
        gap: 0;
        height: calc(100vh - 68px); /* Height below header */
        align-items: stretch;
    }

    .shop-sidebar {
        width: 85px;
        position: sticky;
        top: 68px;
        height: 100%;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        background: var(--gray-50);
        padding: 12px 6px;
        border-radius: 0;
        box-shadow: none;
        border: none;
        border-right: 1px solid var(--gray-200);
        z-index: 10;
        margin: 0;
    }

    .shop-sidebar::-webkit-scrollbar {
        display: none;
    }
    
    .sidebar-title {
        display: none;
    }

    .category-list {
        flex-direction: column;
        overflow-x: hidden;
        gap: 12px;
        padding: 0;
    }

    .cat {
        padding: 8px 4px;
        flex-direction: column;
        font-size: 10px;
        border-radius: var(--r-md);
        border: none;
        background: transparent;
        text-align: center;
        gap: 6px;
        white-space: normal;
        border-left: 3px solid transparent;
        transition: all 0.2s;
    }

    .cat .cat-name {
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
        line-height: 1.2;
    }

    .cat-img {
        width: 44px;
        height: 44px;
        border-radius: 50%;
        margin: 0 auto;
    }

    .cat:hover {
        background: transparent;
        padding-left: 4px;
    }

    .cat.active {
        background: var(--white);
        color: var(--pink);
        border-left-color: var(--pink);
        box-shadow: 0 4px 12px rgba(0,0,0,0.05);
        padding-left: 4px;
    }

    .cat.active .cat-img {
        box-shadow: none;
        border-color: var(--pink);
    }

    .shop-main {
        width: calc(100% - 85px);
        padding: 12px;
        height: 100%;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .shop-main {
        width: 100%;
    }

    .shop-controls {
        position: static;
        padding: 4px 0 12px;
        margin-bottom: 16px;
    }

    #products {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .prod-card {
        padding: 8px;
        border-radius: var(--r-sm);
    }

    .shimg-wrap {
        margin-bottom: 8px;
    }

    .p-title {
        font-size: 12px;
        height: 32px;
        margin-bottom: 4px;
    }

    .p-price-val {
        font-size: 13.5px;
    }

    .qty-box {
        width: 60px;
        height: 26px;
    }

    .add-btn {
        font-size: 11px;
    }

    .card-qty-val {
        font-size: 12px;
    }

    .card-qty-btn {
        width: 18px;
        height: 18px;
        font-size: 14px;
    }

    .shimg-dots {
        opacity: 1 !important;
    }

    .sticky-cat-bar {
        display: none !important;
    }
}

/* ============================================================
   STICKY CATEGORY BAR, NOTIFY ME & FLY TO CART STYLES
   ============================================================ */

/* ── Sticky Category Bar ── */
.sticky-cat-bar {
    position: fixed;
    top: -80px;
    left: 0;
    width: 100%;
    height: 60px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: var(--sh-md);
    z-index: 99;
    transition: top 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--gray-100);
}

.sticky-cat-bar.visible {
    top: 59px;
}

.sticky-cat-inner {
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 0 20px;
}

.sticky-cat-bar .category-list {
    flex-direction: row;
    overflow-x: auto;
    gap: 12px;
    scrollbar-width: none;
}

.sticky-cat-bar .category-list::-webkit-scrollbar {
    display: none;
}

.sticky-cat-bar .cat {
    padding: 6px 16px 6px 6px;
    font-size: 13px;
    border-radius: var(--r-full);
    border: 1.5px solid var(--gray-200);
    background: var(--white);
    border-left: none;
    transform: none !important;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.sticky-cat-bar .cat-img {
    width: 26px;
    height: 26px;
}

.sticky-cat-bar .cat:hover {
    background: var(--pink-soft);
    border-color: var(--pink-light);
    color: var(--pink);
    padding-left: 6px;
}

.sticky-cat-bar .cat.active {
    background: var(--pink);
    color: var(--white);
    border-color: var(--pink);
    box-shadow: var(--sh-pink);
    padding-left: 6px;
}

/* ── Skeleton Loading Grid elements ── */
.skeleton-card {
    background: var(--white);
    border: 1px solid var(--gray-100);
    border-radius: var(--r-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    box-shadow: var(--sh-sm);
    height: 330px;
    overflow: hidden;
}

.skeleton-shimmer {
    background: linear-gradient(90deg, #f4f4f5 25%, #e4e4e7 50%, #f4f4f5 75%);
    background-size: 200% 100%;
    animation: skeletonLoading 1.5s infinite linear;
}

.skeleton-img {
    width: 100%;
    aspect-ratio: 1/1;
    border-radius: var(--r-sm);
    margin-bottom: 12px;
}

.skeleton-line {
    height: 12px;
    border-radius: var(--r-full);
    margin-bottom: 8px;
}

.skeleton-line.title-1 { width: 85%; }
.skeleton-line.title-2 { width: 50%; margin-bottom: 16px; }
.skeleton-line.price { width: 40%; height: 16px; margin-top: auto; margin-bottom: 12px; }
.skeleton-line.button { width: 100%; height: 36px; border-radius: var(--r-sm); margin-bottom: 0; }

.skeleton-cat {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--r-md);
}

.skeleton-cat-img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
}

.skeleton-cat-text {
    height: 12px;
    border-radius: var(--r-full);
    flex: 1;
}

@keyframes skeletonLoading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@media (max-width: 768px) {
    .skeleton-card {
        padding: 8px;
        border-radius: var(--r-sm);
        height: 250px;
    }
    .skeleton-img {
        margin-bottom: 8px;
    }
    .skeleton-line {
        height: 10px;
        margin-bottom: 6px;
    }
    .skeleton-line.title-2 { margin-bottom: 10px; }
    .skeleton-line.price { height: 12px; margin-bottom: 8px; }
    .skeleton-line.button { height: 26px; border-radius: var(--r-sm); }
    
    .skeleton-cat {
        padding: 8px 4px;
        flex-direction: column;
        gap: 6px;
        align-items: center;
    }
    .skeleton-cat-img {
        width: 44px;
        height: 44px;
    }
    .skeleton-cat-text {
        width: 80%;
        max-width: 60px;
        height: 10px;
    }
}