/* =============================================
   SWAWLAMBAN — Shop UI (Image-matched design)
   ============================================= */

/* ---- Page header ---- */
.shop-page-header {
    background: linear-gradient(135deg, #54311d 0%, #7a4a2e 60%, #a48b70 100%);
    padding: 28px 0 22px;
    color: #fff;
}
.shop-header-breadcrumbs {
    display: flex; align-items: center; gap: 6px;
    font-size: .78rem; margin-bottom: 10px; opacity: .9; flex-wrap: wrap;
}
.shop-header-breadcrumbs a { color: rgba(255,255,255,.8); text-decoration: none; font-weight: 500; }
.shop-header-breadcrumbs a:hover { color: #f9bb00; }
.shop-header-breadcrumbs span { color: #fff; font-weight: 600; }
.shop-page-header h1 {
    font-size: 1.7rem; font-weight: 800; margin: 0 0 10px;
    letter-spacing: -.3px; color: #fff;
}
.header-count-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.18);
    padding: 5px 14px; border-radius: 50px; font-size: .78rem; font-weight: 600;
}
.header-count-badge i { color: #f9bb00; }

/* ---- Top bar (product count + sort) ---- */
.shop-topbar {
    background: #fff;
    border-bottom: 1px solid #e8e8e8;
    padding: 10px 0;
    position: sticky; top: 0; z-index: 200;
}
.shop-topbar-inner {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.shop-found-text {
    font-size: .88rem; font-weight: 700; color: #212121;
}
.shop-sort-wrap {
    display: flex; align-items: center; gap: 8px;
}
.shop-sort-label {
    font-size: .82rem; color: #666; font-weight: 500; white-space: nowrap;
}
.shop-sort-select {
    font-size: .82rem; font-weight: 600; color: #212121;
    border: 1px solid #d0d0d0; border-radius: 4px;
    padding: 5px 28px 5px 10px; background: #fff;
    cursor: pointer; outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 8px center;
}

/* Mobile filter/sort bar */
.mob-topbar {
    display: none;
    background: #fff; border-bottom: 1px solid #e8e8e8;
    padding: 9px 0;
    position: sticky; top: 0; z-index: 200;
}
.mob-topbar-inner {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.mob-topbar-btn {
    display: flex; align-items: center; gap: 6px;
    background: none; border: none; font-size: .82rem;
    font-weight: 700; color: #444; cursor: pointer; padding: 4px 8px;
}
.mob-topbar-btn i { font-size: 1rem; }
.mob-topbar-divider { width: 1px; height: 20px; background: #e0e0e0; }
.mob-found-text { font-size: .78rem; color: #666; font-weight: 500; }

/* ---- Layout ---- */
.shop-layout {
    display: flex; gap: 0; align-items: flex-start;
    max-width: 1400px; margin: 0 auto; padding: 0 16px;
}

/* ---- Sidebar ---- */
.shop-sidebar-wrap {
    width: 220px; flex-shrink: 0;
    padding: 16px 0;
    border-right: 1px solid #e8e8e8;
    min-height: calc(100vh - 120px);
}
.shop-sidebar-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 16px 14px; border-bottom: 1px solid #e8e8e8; margin-bottom: 4px;
}
.shop-sidebar-head h5 {
    font-size: .95rem; font-weight: 800; color: #212121; margin: 0;
}
.sf-clear-all {
    background: none; border: none; font-size: .78rem;
    font-weight: 700; color: #2874f0; cursor: pointer;
}
.sf-clear-all:hover { text-decoration: underline; }

/* Filter section */
.sf-section {
    border-bottom: 1px solid #e8e8e8;
}
.sf-title {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 16px; font-size: .84rem; font-weight: 700;
    color: #212121; cursor: pointer; user-select: none;
}
.sf-title i { font-size: .72rem; transition: transform .2s; color: #666; }
.sf-section.collapsed .sf-title i { transform: rotate(-90deg); }
.sf-section.collapsed .sf-body { display: none; }
.sf-body {
    padding: 4px 16px 14px;
    display: flex; flex-direction: column; gap: 9px;
}
.sf-option {
    display: flex; align-items: center; gap: 9px;
    font-size: .82rem; color: #333; cursor: pointer;
}
.sf-option input[type="checkbox"],
.sf-option input[type="radio"] {
    width: 15px; height: 15px; accent-color: #2874f0; cursor: pointer; flex-shrink: 0;
}
.sf-option:hover { color: #2874f0; }

/* Price inputs */
.sf-price-row {
    display: flex; gap: 8px; margin-bottom: 10px;
}
.sf-price-row input {
    width: 100%; padding: 6px 8px; border: 1px solid #c8c8c8;
    border-radius: 3px; font-size: .78rem; color: #212121;
    outline: none;
}
.sf-price-row input:focus { border-color: #2874f0; }

/* Toggle */
.sf-toggle { display: flex; align-items: center; justify-content: space-between; }
.sf-toggle-label { font-size: .82rem; color: #333; }
.toggle-sw { position: relative; width: 34px; height: 18px; }
.toggle-sw input { opacity: 0; width: 0; height: 0; }
.toggle-sw .slider {
    position: absolute; cursor: pointer; inset: 0;
    background: #ddd; border-radius: 18px; transition: .3s;
}
.toggle-sw .slider:before {
    position: absolute; content: ''; height: 13px; width: 13px;
    left: 2px; bottom: 2.5px; background: #fff; border-radius: 50%; transition: .3s;
}
.toggle-sw input:checked + .slider { background: #2874f0; }
.toggle-sw input:checked + .slider:before { transform: translateX(15px); }

/* ---- Product area ---- */
.shop-products-wrap {
    flex: 1; min-width: 0; padding: 16px 0 16px 20px;
}

/* Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 1px;
    background: #e8e8e8;
    border: 1px solid #e8e8e8;
    border-radius: 4px;
    overflow: hidden;
}

/* ---- Product Card ---- */
.pc {
    background: #fff;
    display: flex; flex-direction: column;
    cursor: pointer;
    transition: box-shadow .18s;
    position: relative;
}
.pc:hover { box-shadow: 0 4px 20px rgba(0,0,0,.14); z-index: 2; }

/* Image */
.pc-img-wrap {
    position: relative;
    width: 100%; aspect-ratio: 1/1;
    background: #fff; overflow: hidden;
}
.pc-img-link { display: block; width: 100%; height: 100%; }
.pc-img-wrap img {
    width: 100%; height: 100%; object-fit: contain;
    padding: 10px; transition: transform .35s ease;
}
.pc:hover .pc-img-wrap img { transform: scale(1.04); }
.pc-no-img {
    width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
    background: #f5f5f5; color: #bbb; font-size: 2.5rem;
}

/* Badges top-left */
.pc-badges-row {
    position: absolute; top: 8px; left: 8px;
    display: flex; flex-wrap: wrap; gap: 3px; z-index: 3;
}
.pc-badge {
    font-size: .58rem; font-weight: 700; padding: 2px 7px; border-radius: 3px;
}
.pc-badge-rx    { background: #ffeaea; color: #c0392b; border: 1px solid #f5c6cb; }
.pc-badge-nat   { background: #e8f5e9; color: #2e7d32; border: 1px solid #c8e6c9; }
.pc-badge-oos   { background: #f5f5f5; color: #9e9e9e; border: 1px solid #e0e0e0; }

/* Wishlist */
.pc-wish-btn {
    position: absolute; top: 8px; right: 8px;
    width: 28px; height: 28px; border-radius: 50%;
    background: rgba(255,255,255,.92); border: 1px solid #e0e0e0;
    display: flex; align-items: center; justify-content: center;
    font-size: .82rem; color: #bbb; cursor: pointer;
    transition: all .18s; z-index: 3; opacity: 0;
}
.pc:hover .pc-wish-btn { opacity: 1; }
.pc-wish-btn:hover, .pc-wish-btn.active { color: #e53935; border-color: #ffcdd2; }
.pc-wish-btn.active { opacity: 1; }

/* Body */
.pc-body {
    padding: 8px 10px 10px;
    display: flex; flex-direction: column; flex: 1;
    gap: 4px;
}
.pc-cat {
    font-size: .62rem; font-weight: 600; color: #878787;
    text-transform: capitalize; letter-spacing: .2px;
}
.pc-name {
    font-size: .82rem; font-weight: 700; color: #212121;
    line-height: 1.35; text-decoration: none;
    display: -webkit-box; -webkit-line-clamp: 2;
    -webkit-box-orient: vertical; overflow: hidden;
    min-height: 2.25em;
}
.pc-name:hover { color: #2874f0; }

/* Stars */
.pc-stars-row {
    display: flex; align-items: center; gap: 5px;
}
.pc-star { display: flex; gap: 1px; }
.pc-star i { font-size: .6rem; color: #d0d0d0; }
.pc-star.has-rating i { color: #ff9f00; }
.pc-star i.bi-star { color: #d0d0d0 !important; }
.pc-rev-count { font-size: .66rem; color: #878787; }

/* Price */
.pc-price-row {
    display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap;
}
.pc-price {
    font-size: 1rem; font-weight: 800; color: #212121;
}
.pc-mrp {
    font-size: .76rem; color: #878787; text-decoration: line-through;
}

/* Buttons */
.pc-btns {
    display: flex; gap: 6px; margin-top: 6px;
}
.pc-btn-cart {
    flex: 1; padding: 7px 4px;
    background: #f0f0f0; color: #212121;
    border: 1px solid #d0d0d0; border-radius: 3px;
    font-size: .72rem; font-weight: 700;
    cursor: pointer; display: flex; align-items: center;
    justify-content: center; gap: 4px;
    transition: background .15s;
    white-space: nowrap;
}
.pc-btn-cart:hover { background: #e0e0e0; }

.pc-btn-buy {
    width: 100%; padding: 7px 4px;
    background: #4a2c1a; color: #fff;
    border: none; border-radius: 3px;
    font-size: .72rem; font-weight: 800;
    cursor: pointer; display: flex; align-items: center;
    justify-content: center; letter-spacing: .4px;
    transition: background .15s;
    white-space: nowrap;
}
.pc-btn-buy:hover { background: #2d1a0e; }

.pc-btn-buy-wrap { flex: 1; }
.pc-btn-buy-wrap form { margin: 0; height: 100%; }
.pc-btn-buy-wrap .pc-btn-buy { height: 100%; }

.pc-oos-btn {
    width: 100%; padding: 8px;
    background: #f5f5f5; color: #9e9e9e;
    border: 1px solid #e0e0e0; border-radius: 3px;
    font-size: .72rem; font-weight: 600; cursor: not-allowed;
    display: flex; align-items: center; justify-content: center; gap: 5px;
}

/* Qty ctrl */
.pc-qty-ctrl {
    display: flex; align-items: center; width: 100%;
    border: 1.5px solid #4a2c1a; border-radius: 3px; overflow: hidden;
}
.pc-qty-btn {
    width: 32px; height: 32px; flex-shrink: 0;
    background: #4a2c1a; color: #fff; border: none;
    font-size: .9rem; font-weight: 700; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background .15s;
}
.pc-qty-btn:hover { background: #2d1a0e; }
.pc-qty-val {
    flex: 1; text-align: center; font-weight: 800;
    font-size: .85rem; color: #212121;
}

/* ---- Skeleton ---- */
.skeleton { background: linear-gradient(90deg,#f0f0f0 25%,#f8f8f8 50%,#f0f0f0 75%); background-size: 200% 100%; animation: sk-shimmer 1.5s infinite; border-radius: 4px; }
@keyframes sk-shimmer { 0%{background-position:200% 0} 100%{background-position:-200% 0} }
.skeleton-grid { display: none; grid-template-columns: repeat(6,1fr); gap: 1px; background: #e8e8e8; border: 1px solid #e8e8e8; }
.htmx-request.product-results-wrap .product-grid { display: none !important; }
.htmx-request.product-results-wrap .skeleton-grid { display: grid !important; }
.skeleton-card { background: #fff; padding: 12px; }
.sk-img { width: 100%; aspect-ratio: 1/1; margin-bottom: 10px; }
.sk-line { height: 12px; margin-bottom: 7px; }

/* ---- Pagination ---- */
.shop-pagination {
    display: flex; justify-content: center; align-items: center;
    gap: 6px; margin-top: 30px; padding: 16px 0;
}
.sp-btn {
    display: flex; align-items: center; justify-content: center;
    min-width: 36px; height: 36px; padding: 0 8px;
    border-radius: 3px; background: #fff;
    border: 1px solid #d0d0d0; color: #444;
    font-size: .84rem; font-weight: 700; text-decoration: none;
    transition: all .18s; cursor: pointer;
}
.sp-btn:hover:not(.disabled):not(.active) { background: #f0f0f0; border-color: #bbb; }
.sp-btn.active { background: #4a2c1a; border-color: #4a2c1a; color: #fff; }
.sp-btn.disabled { opacity: .4; cursor: not-allowed; }

/* ---- Active chips ---- */
.sf-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 16px; }
.sf-chip {
    background: #e8f0fe; color: #2874f0; padding: 4px 10px;
    border-radius: 20px; font-size: .73rem; font-weight: 600;
    cursor: pointer; display: inline-flex; align-items: center; gap: 5px;
    border: 1px solid #c5d8fd;
}
.sf-chip:hover { background: #d0e3fc; }

/* ---- Bottom Sheet (mobile) ---- */
.bs-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,.45);
    z-index: 99998; opacity: 0; visibility: hidden; transition: all .28s;
}
.bs-overlay.open { opacity: 1; visibility: visible; }
.bottom-sheet {
    position: fixed; bottom: 0; left: 0; right: 0;
    background: #fff; border-radius: 16px 16px 0 0;
    z-index: 99999; transform: translateY(100%);
    transition: transform .35s cubic-bezier(.16,1,.3,1);
    max-height: 88vh; display: flex; flex-direction: column;
}
.bottom-sheet.open { transform: translateY(0); }
.bs-handle { width: 36px; height: 4px; background: #e0e0e0; border-radius: 10px; margin: 10px auto 4px; }
.bs-header {
    padding: 0 20px 14px; border-bottom: 1px solid #f0f0f0;
    display: flex; justify-content: space-between; align-items: center;
}
.bs-header h6 { margin: 0; font-weight: 800; font-size: .92rem; }
.bs-close { background: none; border: none; font-size: 1.1rem; color: #bbb; cursor: pointer; }
.bs-body { padding: 16px 20px; overflow-y: auto; flex: 1; }
.bs-footer {
    padding: 12px 20px; border-top: 1px solid #f0f0f0;
    background: #fff; display: flex; gap: 10px;
}
.btn-clear {
    flex: 1; padding: 12px; background: #f5f5f5; border: none;
    border-radius: 6px; font-weight: 700; color: #555; cursor: pointer; font-size: .84rem;
}
.btn-apply {
    flex: 2; padding: 12px; background: #4a2c1a; border: none;
    border-radius: 6px; font-weight: 700; color: #fff; cursor: pointer; font-size: .84rem;
}

/* ---- Responsive ---- */
@media (max-width: 1199px) {
    .product-grid { grid-template-columns: repeat(5,1fr); }
    .skeleton-grid { grid-template-columns: repeat(5,1fr); }
}
@media (max-width: 991px) {
    .product-grid { grid-template-columns: repeat(4,1fr); }
    .skeleton-grid { grid-template-columns: repeat(4,1fr); }
    .shop-sidebar-wrap { display: none; }
    .shop-products-wrap { padding: 12px 0; }
    .shop-layout { padding: 0 10px; }
    .shop-topbar { display: none; }
    .mob-topbar { display: block; }
}
@media (max-width: 640px) {
    .product-grid { grid-template-columns: repeat(2,1fr); }
    .skeleton-grid { grid-template-columns: repeat(2,1fr); }
    .shop-layout { padding: 0; }
    .shop-products-wrap { padding: 8px 0; }
    .pc-body { padding: 6px 8px 8px; }
    .pc-name { font-size: .76rem; }
    .pc-price { font-size: .9rem; }
    .pc-btn-cart, .pc-btn-buy { font-size: .68rem; padding: 6px 3px; }
}
@media (max-width: 400px) {
    .product-grid { grid-template-columns: repeat(2,1fr); gap: 0; }
}

/* ---- Spinner ---- */
.btn-spinner {
    width: 13px; height: 13px; border-radius: 50%;
    border: 2px solid rgba(255,255,255,.3); border-top-color: #fff;
    animation: btn-spin .6s linear infinite; display: inline-block;
}
@keyframes btn-spin { to { transform: rotate(360deg); } }
.btn-loading { pointer-events: none; opacity: .7; }

/* Card entrance */
.product-grid .pc { animation: pcIn .28s ease both; }
@keyframes pcIn { from{opacity:0;transform:translateY(8px)} to{opacity:1;transform:translateY(0)} }
.product-grid .pc:nth-child(1){animation-delay:.02s}
.product-grid .pc:nth-child(2){animation-delay:.05s}
.product-grid .pc:nth-child(3){animation-delay:.08s}
.product-grid .pc:nth-child(4){animation-delay:.10s}
.product-grid .pc:nth-child(5){animation-delay:.12s}
.product-grid .pc:nth-child(6){animation-delay:.14s}
.product-grid .pc:nth-child(7){animation-delay:.16s}
.product-grid .pc:nth-child(8){animation-delay:.18s}
.product-grid .pc:nth-child(9){animation-delay:.20s}
.product-grid .pc:nth-child(10){animation-delay:.22s}
.product-grid .pc:nth-child(11){animation-delay:.24s}
.product-grid .pc:nth-child(12){animation-delay:.26s}

/* =============================================
   PREMIUM STYLING FOR SORT & FILTERS
   ============================================= */
.shop-sticky-bar {
    background: #fff;
    border-bottom: 1px solid #efe6dd;
    padding: 12px 0;
    position: sticky;
    top: 0;
    z-index: 199;
    box-shadow: 0 2px 10px rgba(74, 44, 26, 0.04);
}
.shop-sticky-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.sort-pills {
    display: flex;
    align-items: center;
    gap: 8px;
}
.sort-pill {
    background: #fdfbf7;
    border: 1px solid #e2d6c9;
    color: #5c4333;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.sort-pill:hover {
    background: #f7f0e7;
    border-color: #7a4a2e;
    color: #7a4a2e;
}
.sort-pill.active {
    background: #4a2c1a;
    border-color: #4a2c1a;
    color: #fff;
    box-shadow: 0 2px 6px rgba(74, 44, 26, 0.15);
}

/* Sidebar structure */
.shop-sidebar {
    background: #fff;
    border: 1px solid #efe6dd;
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 2px 12px rgba(74, 44, 26, 0.02);
}
.sf-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 12px;
    border-bottom: 1px solid #efe6dd;
    margin-bottom: 12px;
}
.sf-header h5 {
    font-size: 0.95rem;
    font-weight: 800;
    color: #4a2c1a;
    margin: 0;
}
.sf-clear-all {
    background: none;
    border: none;
    font-size: 0.78rem;
    font-weight: 700;
    color: #a47c5c;
    cursor: pointer;
    transition: color 0.15s;
}
.sf-clear-all:hover {
    color: #4a2c1a;
    text-decoration: underline;
}

/* Price Inputs */
.sf-price-inputs {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}
.sf-price-inputs input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #d9cebf;
    border-radius: 6px;
    font-size: 0.8rem;
    color: #4a2c1a;
    background-color: #fcfbfa;
    outline: none;
    transition: all 0.2s ease;
}
.sf-price-inputs input:focus {
    border-color: #7a4a2e;
    background-color: #fff;
    box-shadow: 0 0 0 2px rgba(122, 74, 46, 0.12);
}

/* Checkbox & Radio styling */
.sf-option input[type="checkbox"],
.sf-option input[type="radio"] {
    width: 16px;
    height: 16px;
    accent-color: #7a4a2e;
    cursor: pointer;
}

/* Toggle Switch styling */
.sf-toggle .slider {
    background: #e0d8cf;
}
.toggle-sw input:checked + .slider {
    background: #7a4a2e;
}

/* Qty control loaders */
.pc-qty-btn.htmx-request {
    pointer-events: none;
    position: relative;
    color: transparent !important;
}
.pc-qty-btn.htmx-request::after {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: btn-spin 0.6s linear infinite;
    top: calc(50% - 7px);
    left: calc(50% - 7px);
}

.pc-btn-cart.htmx-request {
    pointer-events: none;
    position: relative;
    color: transparent !important;
}
.pc-btn-cart.htmx-request::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(74, 44, 26, 0.2);
    border-top-color: #4a2c1a;
    border-radius: 50%;
    animation: btn-spin 0.6s linear infinite;
    top: calc(50% - 8px);
    left: calc(50% - 8px);
}

/* Home Page Product Grid Layout */
.home-product-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}

@media (max-width: 1200px) {
    .home-product-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 991px) {
    .home-product-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 575px) {
    .home-product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}


