/* ==========================================================================
   DekoShop — /shop/products/{name} listing (all_products.blade.php)
   Everything is scoped under .ap-page so Bootstrap 4 and the shop's other
   stylesheets cannot leak in, and nothing here leaks out.
   ========================================================================== */

.ap-page {
    --ap-blue: #1d5cf2;
    --ap-blue-dark: #1449c9;
    --ap-blue-soft: #eaf1ff;
    --ap-navy: #0f1a3d;
    --ap-text: #1f2937;
    --ap-muted: #6b7280;
    --ap-border: #e7ebf3;
    --ap-bg: #f6f8fc;
    --ap-red: #ef4444;
    --ap-red-soft: #fdecec;
    --ap-star: #f5a524;
    --ap-radius: 14px;
    --ap-shadow: 0 1px 2px rgba(15, 26, 61, .04), 0 4px 14px rgba(15, 26, 61, .05);

    background: var(--ap-bg);
    color: var(--ap-text);
    font-family: 'Inter', 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
    font-size: 14px;
    line-height: 1.45;
    padding: 24px 0 48px;
}
.ap-page *, .ap-page *::before, .ap-page *::after { box-sizing: border-box; }
.ap-page h1, .ap-page h2, .ap-page h3, .ap-page p { margin: 0; }
.ap-page a { text-decoration: none; }
.ap-page button { font-family: inherit; }
.ap-page label { margin: 0; }

/* Width and side padding come from the site's `container px-xl-5` — the same
   box as the header — so the page edges line up with the logo and Cart button. */
.ap-layout { display: grid; grid-template-columns: clamp(250px, 18%, 290px) minmax(0, 1fr); gap: 24px; align-items: start; }
.ap-main { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.ap-muted { color: var(--ap-muted); font-size: 13px; padding: 8px 4px; }

/* ---------- Buttons / links ---------- */
.ap-btn-primary {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--ap-blue); color: #fff !important;
    font-weight: 600; font-size: 14px; border-radius: 8px;
    padding: 11px 20px; border: 0; white-space: nowrap;
    box-shadow: 0 6px 14px rgba(29, 92, 242, .25);
    transition: background .15s ease, transform .15s ease;
}
.ap-btn-primary:hover { background: var(--ap-blue-dark); transform: translateY(-1px); }
.ap-btn-primary i { font-size: 12px; }
.ap-link {
    background: none; border: 0; padding: 0; cursor: pointer;
    color: var(--ap-blue); font-size: 12.5px; font-weight: 600;
}
.ap-link:hover { text-decoration: underline; }

/* ---------- Sidebar panels ---------- */
.ap-sidebar { display: flex; flex-direction: column; gap: 16px; }
.ap-sidebar-mobile-head { display: none; }
.ap-panel {
    background: #fff; border: 1px solid var(--ap-border); border-radius: var(--ap-radius);
    box-shadow: var(--ap-shadow); padding: 16px 14px;
}
.ap-panel-title {
    display: flex; align-items: center; gap: 9px;
    font-size: 15px; font-weight: 700; color: var(--ap-navy);
    padding: 0 4px 10px;
}
.ap-panel-title i { color: var(--ap-blue); font-size: 14px; }

.ap-cat-list { list-style: none; margin: 0; padding: 0; }
.ap-cat-item {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 6px; border-radius: 8px;
    color: var(--ap-text) !important; font-size: 13.5px; font-weight: 500;
    transition: background .15s ease, color .15s ease;
}
.ap-cat-item:hover { background: var(--ap-blue-soft); color: var(--ap-blue) !important; }
.ap-cat-icon { width: 18px; text-align: center; color: #475569; font-size: 13px; }
.ap-cat-item:hover .ap-cat-icon { color: var(--ap-blue); }
.ap-cat-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ap-cat-chevron { font-size: 10px; color: #9aa3b5; }
.ap-pill {
    font-size: 9.5px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase;
    border-radius: 999px; padding: 2px 7px; line-height: 1.4;
}
.ap-pill.is-hot { background: var(--ap-red); color: #fff; }
.ap-pill.is-new { background: var(--ap-blue); color: #fff; text-transform: none; }

/* ---------- Filter panel ---------- */
.ap-filter-head { display: flex; align-items: center; justify-content: space-between; padding-right: 4px; }
.ap-filter-head .ap-panel-title { padding-bottom: 6px; }
.ap-fgroup { border-top: 1px solid var(--ap-border); padding: 12px 4px; }
.ap-fgroup:last-child { padding-bottom: 2px; }
.ap-fgroup-head {
    width: 100%; display: flex; align-items: center; justify-content: space-between;
    background: none; border: 0; padding: 0; cursor: pointer;
    font-size: 14px; font-weight: 700; color: var(--ap-navy);
}
.ap-fgroup-head i { font-size: 11px; color: var(--ap-muted); transition: transform .2s ease; }
.ap-fgroup-body { padding-top: 10px; }
.ap-fgroup.is-collapsed .ap-fgroup-body { display: none; }
.ap-fgroup.is-collapsed .ap-fgroup-head i { transform: rotate(180deg); }

.ap-range-label { font-size: 12.5px; color: var(--ap-muted); margin-bottom: 10px !important; }
.ap-range { position: relative; height: 20px; margin: 0 4px 12px; }
.ap-range-track {
    position: absolute; left: 0; right: 0; top: 50%; height: 4px; margin-top: -2px;
    background: #dfe5ef; border-radius: 4px;
}
.ap-range-fill { position: absolute; top: 0; bottom: 0; background: var(--ap-blue); border-radius: 4px; }
.ap-range input[type=range] {
    position: absolute; left: 0; top: 0; width: 100%; height: 20px; margin: 0;
    -webkit-appearance: none; appearance: none; background: none; pointer-events: none;
}
.ap-range input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none; pointer-events: auto; cursor: pointer;
    width: 16px; height: 16px; border-radius: 50%;
    background: var(--ap-blue); border: 3px solid #fff; box-shadow: 0 0 0 1px var(--ap-blue), 0 2px 5px rgba(15, 26, 61, .25);
}
.ap-range input[type=range]::-moz-range-thumb {
    pointer-events: auto; cursor: pointer;
    width: 12px; height: 12px; border-radius: 50%;
    background: var(--ap-blue); border: 3px solid #fff; box-shadow: 0 0 0 1px var(--ap-blue);
}
.ap-range input[type=range]::-moz-range-track { background: none; }
.ap-range input[type=range]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px rgba(29, 92, 242, .35); }
.ap-range-inputs { display: flex; align-items: center; gap: 8px; }
.ap-range-dash { color: var(--ap-muted); }
.ap-money {
    flex: 1; display: flex; align-items: center; gap: 2px;
    border: 1px solid var(--ap-border); border-radius: 8px; padding: 0 10px; height: 36px; background: #fff;
}
.ap-money span { color: var(--ap-muted); font-size: 13px; }
.ap-money input {
    width: 100%; min-width: 0; border: 0; outline: 0; background: none;
    font-size: 13px; color: var(--ap-text); -moz-appearance: textfield;
}
.ap-money input::-webkit-outer-spin-button, .ap-money input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.ap-money:focus-within { border-color: var(--ap-blue); box-shadow: 0 0 0 3px rgba(29, 92, 242, .12); }

.ap-check {
    display: flex !important; align-items: center; gap: 10px; cursor: pointer;
    padding: 5px 0; font-size: 13.5px; color: var(--ap-text);
}
.ap-check input {
    width: 16px; height: 16px; margin: 0; flex-shrink: 0;
    accent-color: var(--ap-blue); cursor: pointer;
}
.ap-check em { font-style: normal; color: var(--ap-muted); }
.ap-more { display: inline-block; margin-top: 8px; }
[data-more-group]:not(.is-expanded) .is-extra { display: none !important; }

.ap-swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.ap-swatch {
    width: 24px; height: 24px; border-radius: 50%; padding: 0; cursor: pointer;
    border: 1px solid rgba(15, 26, 61, .15);
    box-shadow: inset 0 0 0 2px #fff;
    transition: transform .12s ease, box-shadow .12s ease;
}
.ap-swatch:hover { transform: scale(1.08); }
.ap-swatch.is-on { box-shadow: inset 0 0 0 2px #fff, 0 0 0 2px var(--ap-blue); }

/* ---------- Hero ---------- */
.ap-hero {
    position: relative; overflow: hidden;
    display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); align-items: center;
    min-height: 260px; border-radius: 18px;
    background: linear-gradient(110deg, #eef4ff 0%, #f5f8ff 45%, #e4edff 100%);
    border: 1px solid #dfe8fb;
}
.ap-hero-copy { position: relative; z-index: 2; padding: 34px 20px 34px 36px; }
.ap-hero-kicker {
    display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
    color: var(--ap-blue); background: #fff; border: 1px solid #c9d8fb; border-radius: 999px; padding: 4px 12px;
}
.ap-hero h1 {
    font-size: 36px; line-height: 1.12; font-weight: 800; color: var(--ap-navy);
    letter-spacing: -.02em; margin: 14px 0 12px;
}
.ap-hero p { color: #4b5563; font-size: 15px; max-width: 420px; margin-bottom: 22px; }
.ap-hero-visual { position: relative; height: 100%; min-height: 260px; }
.ap-hero-wave {
    position: absolute; right: -60px; top: -40px; bottom: -40px; width: 88%;
    border-radius: 48% 0 0 52% / 60% 0 0 40%;
    background: linear-gradient(160deg, #3b7bff 0%, #1d5cf2 55%, #1747c0 100%);
    opacity: .95;
}
.ap-hero-wave::before {
    content: ""; position: absolute; left: -26px; top: 12%; bottom: 12%; width: 60px;
    border-radius: 50%; background: rgba(59, 123, 255, .25);
}
.ap-hero-photos {
    position: absolute; inset: 22px 26px 22px 18%; z-index: 1;
    display: grid; gap: 12px; grid-template-columns: repeat(2, 1fr);
}
.ap-hero-photos img {
    width: 100%; height: 100%; object-fit: cover; border-radius: 14px;
    background: #fff; box-shadow: 0 10px 24px rgba(15, 26, 61, .25);
}
.ap-hero-photos.is-1 { grid-template-columns: 1fr; }
.ap-hero-photos.is-3 img:first-child { grid-row: span 2; }
.ap-hero-icons { position: absolute; inset: 0; z-index: 1; }
.ap-hero-ic {
    position: absolute; display: flex; align-items: center; justify-content: center;
    background: #fff; border-radius: 22px; color: var(--ap-navy);
    box-shadow: 0 14px 30px rgba(15, 26, 61, .22);
}
.ap-hero-ic.is-1 { width: 92px; height: 92px; left: 18%; top: 22%; font-size: 38px; transform: rotate(-8deg); }
.ap-hero-ic.is-2 { width: 78px; height: 78px; left: 34%; bottom: 14%; font-size: 30px; transform: rotate(6deg); color: #334155; }
.ap-hero-ic.is-3 { width: 108px; height: 108px; right: 24%; top: 16%; font-size: 46px; }
.ap-hero-ic.is-4 { width: 84px; height: 84px; right: 7%; bottom: 16%; font-size: 34px; transform: rotate(-6deg); color: var(--ap-blue); }

/* ---------- Category tiles ---------- */
.ap-tiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.ap-tile {
    display: flex; align-items: center; gap: 9px; min-width: 0;
    background: #fff; border: 1px solid var(--ap-border); border-radius: 12px;
    padding: 10px; box-shadow: var(--ap-shadow);
    transition: border-color .15s ease, transform .15s ease;
}
.ap-tile:hover { border-color: #bcd0fb; transform: translateY(-2px); }
.ap-tile-ic {
    flex-shrink: 0; width: 34px; height: 34px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    background: var(--ap-blue-soft); color: var(--ap-blue); font-size: 15px;
}
.ap-tile-text { display: flex; flex-direction: column; min-width: 0; }
.ap-tile-text strong { font-size: 12.5px; font-weight: 700; color: var(--ap-navy); line-height: 1.25; }
.ap-tile-text small { font-size: 11px; color: var(--ap-muted); line-height: 1.3; margin-top: 1px; }

/* ---------- Products ---------- */
.ap-products { scroll-margin-top: 90px; }
.ap-products-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.ap-products-head h2 { font-size: 22px; font-weight: 800; color: var(--ap-navy); letter-spacing: -.01em; }
.ap-products-head p { color: var(--ap-muted); font-size: 13px; margin-top: 2px !important; }
.ap-sort { display: flex !important; align-items: center; gap: 8px; font-size: 13px; color: var(--ap-muted); white-space: nowrap; }
.ap-sort select {
    height: 38px; border: 1px solid var(--ap-border); border-radius: 8px; background: #fff;
    padding: 0 34px 0 12px; font-size: 13px; font-weight: 600; color: var(--ap-navy); cursor: pointer;
    -webkit-appearance: none; appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%236b7280' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 12px center;
}
.ap-sort select:focus { outline: 0; border-color: var(--ap-blue); box-shadow: 0 0 0 3px rgba(29, 92, 242, .12); }

.ap-grid {
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px;
    transition: opacity .15s ease;
}
.ap-grid.is-loading { opacity: .45; pointer-events: none; }

.ap-card {
    display: flex; flex-direction: column; min-width: 0;
    background: #fff; border: 1px solid var(--ap-border); border-radius: var(--ap-radius);
    box-shadow: var(--ap-shadow); padding: 10px;
    transition: box-shadow .2s ease, transform .2s ease;
}
.ap-card:hover { box-shadow: 0 12px 28px rgba(15, 26, 61, .10); transform: translateY(-2px); }
.ap-card-media { position: relative; border-radius: 10px; background: #f3f5f9; overflow: hidden; }
.ap-card-img { display: block; aspect-ratio: 1 / 1; }
.ap-card-img img { width: 100%; height: 100%; object-fit: contain; padding: 12px; mix-blend-mode: multiply; }
.ap-card-badge {
    position: absolute; top: 10px; left: 10px;
    font-size: 10px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
    color: #fff; border-radius: 6px; padding: 3px 8px;
}
.ap-card-badge.is-best { background: #1b2559; }
.ap-card-badge.is-hot { background: var(--ap-red); }
.ap-card-badge.is-new { background: var(--ap-blue); }
.ap-card-fav {
    position: absolute; top: 8px; right: 8px;
    width: 30px; height: 30px; border-radius: 50%; border: 0; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    background: #fff; color: #374151; font-size: 13px; box-shadow: 0 2px 8px rgba(15, 26, 61, .12);
}
.ap-card-fav:hover { color: var(--ap-red); }

.ap-card-body { display: flex; flex-direction: column; flex: 1; padding: 12px 4px 2px; }
.ap-card-title {
    color: var(--ap-navy) !important; font-size: 14px; font-weight: 700; line-height: 1.3;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    min-height: 2.6em;
}
.ap-card-title:hover { color: var(--ap-blue) !important; }
.ap-card-sub {
    color: var(--ap-muted); font-size: 12px; margin-top: 3px !important;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ap-card-rating { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.ap-stars { display: inline-flex; gap: 1px; color: var(--ap-star); font-size: 11px; }
.ap-stars .is-empty { color: #d6dbe5; }
.ap-card-rating-num { font-size: 12px; color: #4b5563; font-weight: 600; }
.ap-card-rating-num small { color: var(--ap-muted); font-weight: 500; font-size: 12px; }

.ap-card-price { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 6px; margin-top: 8px; }
.ap-card-price strong { font-size: 17px; font-weight: 800; color: var(--ap-navy); letter-spacing: -.01em; }
.ap-card-price del { font-size: 12px; color: #9aa3b5; }
.ap-card-off {
    font-size: 10px; font-weight: 800; color: var(--ap-red); white-space: nowrap;
    background: var(--ap-red-soft); border-radius: 6px; padding: 2px 5px;
}

.ap-card-swatches { display: flex; align-items: center; gap: 6px; min-height: 14px; margin-top: 10px; }
.ap-dot { width: 13px; height: 13px; border-radius: 50%; border: 1px solid rgba(15, 26, 61, .18); box-shadow: inset 0 0 0 1.5px #fff; }
.ap-dot:first-child { box-shadow: inset 0 0 0 1.5px #fff, 0 0 0 1.5px var(--ap-navy); }
.ap-dot-more { font-size: 11px; color: var(--ap-muted); font-weight: 600; }

.ap-card-actions { display: flex; gap: 8px; margin-top: auto; padding-top: 12px; }
.ap-btn-cart {
    flex: 1; min-width: 0; height: 38px;
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    background: var(--ap-blue); color: #fff; border: 0; border-radius: 8px; cursor: pointer;
    font-size: 13px; font-weight: 600; white-space: nowrap;
    transition: background .15s ease;
}
.ap-btn-cart:hover { background: var(--ap-blue-dark); }
.ap-btn-cart span { overflow: hidden; text-overflow: ellipsis; }
.ap-btn-fav {
    width: 38px; height: 38px; flex-shrink: 0; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    background: #fff; color: var(--ap-blue); border: 1px solid #c9d8fb; border-radius: 8px; font-size: 14px;
}
.ap-btn-fav:hover { background: var(--ap-blue-soft); }

.ap-empty {
    grid-column: 1 / -1; text-align: center; padding: 56px 16px;
    background: #fff; border: 1px dashed #cbd5e1; border-radius: var(--ap-radius);
}
.ap-empty i { font-size: 44px; color: #94a3b8; margin-bottom: 12px; }
.ap-empty h3 { font-size: 17px; font-weight: 700; color: var(--ap-navy); margin-bottom: 6px; }
.ap-empty p { color: var(--ap-muted); font-size: 13.5px; }

/* ---------- Rewards banner ---------- */
.ap-rewards {
    display: flex; align-items: center; gap: 18px;
    border-radius: 16px; padding: 20px 28px;
    background: linear-gradient(100deg, #eef4ff 0%, #f7f9ff 55%, #e6eeff 100%);
    border: 1px solid #dfe8fb;
}
.ap-rewards-ic {
    flex-shrink: 0; width: 54px; height: 54px; border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    background: #fff; color: var(--ap-blue); font-size: 26px;
    box-shadow: 0 6px 16px rgba(29, 92, 242, .15);
}
.ap-rewards-text { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ap-rewards-text strong { font-size: 17px; font-weight: 800; color: var(--ap-navy); }
.ap-rewards-text span { font-size: 13.5px; color: var(--ap-muted); }

/* ---------- Mobile toggle / drawer ---------- */
.ap-mobile-toggle { display: none; }
/* Above the site's sticky header and mobile bottom bar. */
.ap-backdrop { position: fixed; inset: 0; background: rgba(15, 26, 61, .45); z-index: 100000; }
body.ap-no-scroll { overflow: hidden; }

/* ---------- Responsive ---------- */
@media (max-width: 1280px) {
    .ap-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1199px) {
    .ap-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .ap-hero h1 { font-size: 30px; }
}
@media (max-width: 991px) {
    .ap-layout { grid-template-columns: minmax(0, 1fr); }
    .ap-mobile-toggle {
        display: inline-flex; align-items: center; gap: 8px; margin-bottom: 16px;
        background: #fff; border: 1px solid var(--ap-border); border-radius: 10px;
        padding: 10px 16px; font-size: 14px; font-weight: 600; color: var(--ap-navy); cursor: pointer;
        box-shadow: var(--ap-shadow);
    }
    .ap-mobile-toggle i { color: var(--ap-blue); }
    .ap-sidebar {
        position: fixed; top: 0; left: 0; bottom: 0; z-index: 100001;
        width: min(340px, 88vw); overflow-y: auto;
        background: var(--ap-bg); padding: 16px;
        transform: translateX(-105%); transition: transform .25s ease;
    }
    .ap-sidebar.is-open { transform: translateX(0); box-shadow: 0 0 40px rgba(15, 26, 61, .3); }
    .ap-sidebar-mobile-head {
        display: flex; align-items: center; justify-content: space-between;
        font-size: 16px; color: var(--ap-navy);
    }
    .ap-sidebar-mobile-head strong { font-weight: 800; }
    .ap-sidebar-close {
        width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--ap-border);
        background: #fff; color: var(--ap-navy); cursor: pointer; font-size: 16px;
    }
    .ap-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
    .ap-page { padding-top: 16px; }
    .ap-hero { grid-template-columns: minmax(0, 1fr); min-height: 0; }
    .ap-hero-copy { padding: 26px 22px; }
    .ap-hero h1 { font-size: 26px; }
    .ap-hero-visual { display: none; }
    .ap-tiles { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 4px; }
    .ap-tile { flex: 0 0 auto; scroll-snap-align: start; }
    .ap-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .ap-products-head { flex-direction: column; align-items: stretch; }
    .ap-sort select { flex: 1; }
    .ap-rewards { flex-wrap: wrap; padding: 18px; }
    .ap-rewards .ap-btn-primary { width: 100%; justify-content: center; }
}
@media (max-width: 420px) {
    .ap-card { padding: 8px; }
    .ap-card-price strong { font-size: 16px; }
    .ap-btn-cart { font-size: 12px; gap: 5px; }
    .ap-btn-cart i { display: none; }
    .ap-btn-fav { width: 34px; }
}
