/* =========================================================
   RAFYZO Storefront Workflow
   Universal sliders, configurable sections and category page
   ========================================================= */

/* ---------- Shared slider behavior ---------- */
.px-sf-slider {
    position: relative;
    isolation: isolate;
    overflow: hidden;
}

.px-sf-slider-track {
    direction: ltr;
    touch-action: pan-y;
}

.px-sf-slider.is-dragging {
    cursor: grabbing;
    user-select: none;
}

.px-sf-slider-arrow {
    position: absolute;
    top: 50%;
    z-index: 8;
    width: 46px;
    height: 46px;
    margin-top: -23px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255,255,255,.72);
    border-radius: 50%;
    background: rgba(31,22,49,.74);
    color: #fff;
    box-shadow: 0 10px 28px rgba(22,14,38,.22);
    backdrop-filter: blur(8px);
    cursor: pointer;
    transition: transform .2s ease, background .2s ease, opacity .2s ease;
}

.px-sf-slider-arrow:hover {
    background: var(--px-sf-primary);
    transform: scale(1.06);
}

.px-sf-slider-arrow.is-prev { left: 14px; }
.px-sf-slider-arrow.is-next { right: 14px; }

.px-sf-slider-arrow svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.px-sf-slider.is-static-slider .px-sf-slider-arrow { display: none; }

.px-sf-slider-pagination {
    position: absolute;
    left: 50%;
    bottom: 14px;
    z-index: 9;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 28px;
    padding: 6px 10px;
    border: 1px solid rgba(255,255,255,.5);
    border-radius: 999px;
    background: rgba(255,255,255,.86);
    box-shadow: 0 8px 22px rgba(20,12,39,.16);
    backdrop-filter: blur(10px);
    transform: translateX(-50%);
}

.px-sf-slider-pagination button {
    width: 8px;
    height: 8px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: #8e8994;
    opacity: .72;
    cursor: pointer;
    transition: width .2s ease, background .2s ease, opacity .2s ease;
}

.px-sf-slider-pagination button.is-active {
    width: 23px;
    background: var(--px-sf-primary);
    opacity: 1;
}

/* ---------- Section headings ---------- */
.px-sf-section-heading {
    margin-bottom: 25px;
    text-align: var(--px-section-align, center);
}

.px-sf-section-heading h2 {
    margin: 0 0 8px !important;
    text-align: inherit !important;
}

.px-sf-section-heading p {
    max-width: 760px;
    margin: 0 auto;
    color: #716b7f;
    line-height: 1.75;
    text-align: inherit;
}

.px-sf-section-heading.is-left p { margin-left: 0; }
.px-sf-section-heading.is-right p { margin-right: 0; }

/* ---------- Products ---------- */
.px-sf-products-custom {
    grid-template-columns: repeat(var(--product-columns, 4), minmax(0, 1fr)) !important;
}

.px-sf-product-slider {
    margin-top: 20px;
}

.px-sf-product-slider .px-sf-product {
    height: 100%;
}

/* ---------- Store categories ---------- */
.px-sf-categories-grid .px-sf-categories {
    grid-template-columns: repeat(var(--px-columns-desktop, 4), minmax(0, 1fr)) !important;
}

.px-sf-category-card {
    min-width: 0;
    height: 100%;
    display: block;
    padding: 0 !important;
    overflow: hidden;
    border: 1px solid #e8e3ef;
    border-radius: 18px;
    background: #fff;
    color: inherit;
    text-decoration: none;
    box-shadow: 0 10px 28px rgba(31,22,49,.05);
    transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.px-sf-category-card:hover {
    transform: translateY(-3px);
    border-color: color-mix(in srgb, var(--px-sf-primary) 32%, #e8e3ef);
    box-shadow: 0 16px 36px rgba(31,22,49,.1);
}

.px-sf-category-card .px-sf-category-image {
    width: 100%;
    min-height: 160px;
}

.px-sf-categories-slider .px-sf-slider-track {
    align-items: stretch;
}

.px-sf-categories-slider .px-sf-category-card {
    height: auto;
}

/* ---------- RAFYZO simple storefront ---------- */
.px-sf-profile-filters {
    margin: 0 0 18px;
    padding: 4px 2px 8px;
    display: flex;
    gap: 9px;
    overflow-x: auto;
    scrollbar-width: thin;
}

.px-sf-profile-filters a {
    flex: 0 0 auto;
    min-height: 38px;
    padding: 0 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e6e0ed;
    border-radius: 999px;
    background: #fff;
    color: #5f586b;
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
}

.px-sf-profile-filters a:hover,
.px-sf-profile-filters a.is-active {
    border-color: transparent;
    background: color-mix(in srgb, var(--px-sf-primary) 12%, #fff);
    color: var(--px-sf-primary);
}

.px-sf-profile-products {
    padding-top: 22px;
}

/* ---------- Category page ---------- */
.px-sf-category-page {
    min-height: 100vh;
    background: #f7f6f3;
    color: #211b31;
    font-family: var(--px-store-font, Inter, Arial, sans-serif);
}

.px-sf-category-shell {
    width: min(100% - 36px, 1240px);
    margin: 0 auto;
    padding: 34px 0 70px;
}

.px-sf-category-intro {
    margin-bottom: 28px;
    padding: 26px 28px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 28px;
    border: 1px solid #e6e0eb;
    border-inline-start: 4px solid var(--px-sf-primary);
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 14px 36px rgba(45,31,68,.06);
}

.px-sf-category-intro > div { min-width: 0; }

.px-sf-category-intro span {
    display: block;
    margin-bottom: 8px;
    color: var(--px-sf-primary);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .13em;
}

.px-sf-category-intro h1 {
    margin: 0;
    color: #211b31;
    font-size: clamp(30px, 4.5vw, 48px);
    line-height: 1.08;
}

.px-sf-category-intro p {
    max-width: 720px;
    margin: 10px 0 0;
    color: #716a7d;
    line-height: 1.75;
}

.px-sf-category-back {
    min-width: 176px;
    min-height: 48px;
    padding: 0 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex: 0 0 auto;
    border: 1px solid transparent;
    border-radius: 14px;
    background: var(--px-sf-primary);
    color: #fff !important;
    font-size: 13px;
    font-weight: 900;
    line-height: 1;
    white-space: nowrap;
    text-decoration: none !important;
    box-shadow: 0 10px 24px color-mix(in srgb, var(--px-sf-primary) 22%, transparent);
    transition: transform .18s ease, filter .18s ease, box-shadow .18s ease;
}

.px-sf-category-back:hover,
.px-sf-category-back:focus-visible {
    color: #fff !important;
    filter: brightness(.95);
    transform: translateY(-1px);
    box-shadow: 0 14px 30px color-mix(in srgb, var(--px-sf-primary) 28%, transparent);
}

.px-sf-category-back svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.px-sf-category-products .px-sf-products {
    grid-template-columns: repeat(var(--product-columns, 4), minmax(0, 1fr));
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
    .px-sf-products-custom {
        grid-template-columns: repeat(var(--product-tablet-columns, 3), minmax(0, 1fr)) !important;
    }

    .px-sf-categories-grid .px-sf-categories {
        grid-template-columns: repeat(var(--px-columns-tablet, 3), minmax(0, 1fr)) !important;
    }
}

@media (max-width: 700px) {
    .px-sf-slider-arrow,
    .px-sf-main-arrow {
        display: none !important;
    }

    .px-sf-slider-pagination {
        bottom: 10px;
        min-height: 25px;
        padding: 5px 9px;
    }

    .px-sf-products-custom {
        grid-template-columns: repeat(var(--product-mobile-columns, 2), minmax(0, 1fr)) !important;
    }

    .px-sf-categories-grid .px-sf-categories {
        grid-template-columns: repeat(var(--px-columns-mobile, 2), minmax(0, 1fr)) !important;
    }

    .px-sf-category-card .px-sf-category-image {
        min-height: 130px;
    }

    .px-sf-category-shell {
        width: min(100% - 20px, 1240px);
        padding-top: 18px;
    }

    .px-sf-category-intro {
        padding: 22px 18px;
        grid-template-columns: 1fr;
        align-items: stretch;
        gap: 18px;
        border-radius: 18px;
    }

    .px-sf-category-back {
        width: 100%;
        min-width: 0;
    }
}

/* RAFYZO — equal product cards */
.px-sf-category-products .px-sf-products {
    align-items: stretch;
}

.px-sf-category-products .px-sf-product,
.px-sf-product-slider .px-sf-product {
    height: 100%;
    min-width: 0;
}

.px-sf-product > strong {
    display: -webkit-box;
    min-height: 4.35em;
    overflow: hidden;
    font-size: 14px;
    line-height: 1.45;
    overflow-wrap: anywhere;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.px-sf-product .px-sf-price {
    flex: 0 0 auto;
}

.px-sf-product .px-sf-view {
    width: 100%;
    margin-top: auto;
}

@media (max-width: 700px) {
    .px-sf-category-intro {
        border-inline-start-width: 3px;
    }

    .px-sf-product > strong {
        min-height: 4.2em;
        font-size: 12px;
        line-height: 1.4;
    }
}
