/* ==================================================
   DEEPAK FURNITURE  ·  SOFAS PAGE  ·  v2
   Hero · filter bar · swoosh cards · viewer
   (only used by sofas.html; touches nothing else)
================================================== */

body.sofas-page {

    --sf-bg: #f9f4ec;
    --sf-bg-2: #f3ebdf;
    --sf-card: #fbf7f0;
    --sf-ink: #2a211a;
    --sf-muted: #6f6254;
    --sf-brass: #9a6a2f;
    --sf-brass-dark: #7d5322;
    --sf-line: rgba(176, 138, 84, .38);

    background: var(--sf-bg);
    color: var(--sf-ink);

}

/* slimmer side margins on this page (wider cards) */
body.sofas-page main,
body.sofas-page main .container,
body.sofas-page main .sf-section,
body.sofas-page main .sf-toolbar-wrap,
body.sofas-page #sf-collections {
    width: 100% !important;
    max-width: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box;
}

body.sofas-page main .container {
    padding-left: 1cm !important;
    padding-right: 1cm !important;
}

/* cards (Royal / Modern sections): 0.25 cm each side, headings stay lined up with the top bar */
body.sofas-page main .sf-section .container {
    padding-left: 0.25cm !important;
    padding-right: 0.25cm !important;
}

body.sofas-page main .sf-section .sf-section-head {
    padding-left: 1cm;
    padding-right: 1cm;
}

/* phones and small tablets: keep the margin slim so cards stay readable */
@media (max-width: 860px) {
    body.sofas-page main .container,
    body.sofas-page main .sf-section .container {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }

    body.sofas-page main .sf-section .sf-section-head {
        padding-left: 0;
        padding-right: 0;
    }
}

.sf-eyebrow {

    display: inline-flex;
    align-items: center;
    gap: 14px;
    font-size: 11px;
    letter-spacing: .28em;
    text-transform: uppercase;
    color: var(--sf-muted);

}

.sf-eyebrow span {
    width: 34px;
    height: 1px;
    background: var(--sf-brass);
}

[hidden] { display: none !important; }


/* ==================================================
   HERO
================================================== */

.sf-hero {

    position: relative;
    overflow: hidden;
    padding: clamp(44px, 6vw, 76px) 0 clamp(44px, 6vw, 70px);
    background: var(--sf-bg-2);
    border-bottom: 1px solid var(--sf-line);
    isolation: isolate;

}

.sf-hero-slides {

    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 62%;
    z-index: -1;

    -webkit-mask-image: linear-gradient(to right, transparent 0, #000 55%);
            mask-image: linear-gradient(to right, transparent 0, #000 55%);

}

.sf-hero-slide {

    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transform: scale(1.05);
    transition: opacity 1.6s ease;

}

.sf-hero-slide.active {
    opacity: 1;
    animation: brDrift 9s ease-out forwards;
}

@keyframes brDrift {
    from { transform: scale(1.05); }
    to   { transform: scale(1); }
}

.sf-hero-text { position: relative; }

.sf-hero h1 {

    margin: 18px 0 14px;
    max-width: 14em;
    font-size: clamp(2rem, 1.2rem + 2.6vw, 3.1rem);
    font-weight: 400;
    line-height: 1.12;
    color: var(--sf-ink);

}

.sf-hero p {

    margin: 0;
    max-width: 30em;
    font-size: clamp(1rem, .95rem + .25vw, 1.15rem);
    line-height: 1.6;
    color: var(--sf-muted);

}

@media (max-width: 760px) {

    .sf-hero-slides {
        width: 100%;
        opacity: .28;
        -webkit-mask-image: none;
                mask-image: none;
    }

}


/* ==================================================
   FILTER BAR
================================================== */

.sf-toolbar-wrap { padding: 18px 0 0; }

.sf-toolbar {

    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;

}

.sf-select {

    height: 46px;
    min-width: 150px;
    padding: 0 44px 0 20px;

    font: inherit;
    font-size: .95rem;
    color: var(--sf-ink);

    background-color: var(--sf-card);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%232a211a' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 18px center;

    border: 1px solid var(--sf-line);
    border-radius: 999px;
    cursor: pointer;

    -webkit-appearance: none;
            appearance: none;

    transition: border-color .25s ease, box-shadow .25s ease;

}

.sf-select:hover,
.sf-select:focus-visible {
    border-color: var(--sf-brass);
    box-shadow: 0 0 0 3px rgba(154, 106, 47, .12);
    outline: none;
}

.sf-count {
    margin-left: auto;
    font-size: .9rem;
    color: var(--sf-muted);
}

/* collection switcher: one compact pill */

.sf-tabs {

    display: inline-flex;
    gap: 4px;
    padding: 4px;
    background: var(--sf-bg-2);
    border: 1px solid var(--sf-line);
    border-radius: 999px;

}

.sf-tab {

    height: 38px;
    padding: 0 20px;
    font: inherit;
    font-size: .92rem;
    color: var(--sf-muted);
    background: transparent;
    border: 0;
    border-radius: 999px;
    cursor: pointer;
    transition: background .3s ease, color .3s ease;

}

.sf-tab:hover { color: var(--sf-ink); }

.sf-tab.active {
    color: #fff;
    background: var(--sf-brass);
}

.sf-tab:focus-visible {
    outline: 2px solid var(--sf-brass);
    outline-offset: 2px;
}

.sf-viewall {

    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 14px;
    padding: 8px 0;

    font: inherit;
    font-size: 12px;
    letter-spacing: .24em;
    text-transform: uppercase;
    color: var(--sf-ink);

    background: none;
    border: 0;
    cursor: pointer;

}

.sf-viewall::before {
    content: "";
    width: 34px;
    height: 1px;
    background: var(--sf-brass);
    transition: width .3s ease;
}

.sf-viewall:hover::before { width: 52px; }

@media (max-width: 640px) {

    .sf-select { flex: 1 1 140px; min-width: 0; }
    .sf-viewall { margin-left: 0; }

}


/* ==================================================
   COLLECTION SECTIONS
================================================== */

.sf-section { padding: clamp(20px, 2.4vw, 32px) 0 clamp(8px, 2vw, 24px); }

.sf-section-head {

    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 14px 40px;
    margin-bottom: 24px;

}

.sf-section-head h2 {

    margin: 12px 0 0;
    font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.3rem);
    font-weight: 400;
    line-height: 1.15;
    color: var(--sf-ink);

}

.sf-section-head p {

    margin: 0;
    max-width: 34em;
    line-height: 1.6;
    color: var(--sf-muted);

}

.sf-grid {

    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;

}

@media (max-width: 1180px) { .sf-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 860px)  { .sf-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px)  { .sf-grid { grid-template-columns: minmax(0, 1fr); } }


/* ==================================================
   CARD
   Big rounded top-right corner · photo with a curved
   bottom edge · brass arrow button bottom-right
================================================== */

.sf-card {

    position: relative;
    display: block;
    overflow: hidden;
    isolation: isolate;
    cursor: pointer;

    background: var(--sf-card);
    border: 1px solid var(--sf-line);
    border-radius: 14px 64px 14px 14px;
    box-shadow: 0 14px 34px -16px rgba(60, 40, 15, .28);

    transition:
        transform .5s cubic-bezier(.2, .8, .2, 1),
        box-shadow .5s ease,
        border-color .5s ease;

}

.sf-card.is-pending { opacity: 0; }

.sf-card.is-visible {
    opacity: 1;
    animation: brRise .9s cubic-bezier(.2, .8, .2, 1) var(--sf-delay, 0ms) backwards;
}

@keyframes brRise {
    from { opacity: 0; transform: perspective(900px) translateY(34px) rotateX(7deg); }
    to   { opacity: 1; transform: perspective(900px) translateY(0) rotateX(0); }
}

@media (hover: hover) {

    .sf-card:hover {
        transform: translateY(-6px);
        border-color: rgba(176, 138, 84, .7);
        box-shadow: 0 22px 40px -18px rgba(60, 40, 15, .38);
    }

    .sf-card:hover .sf-img { scale: 1.06; }
    .sf-card:hover .sf-go { background: var(--sf-brass-dark); }
    .sf-card:hover .sf-go svg,
    .sf-view:hover svg { transform: translateX(3px); }

}

/* photo */

.sf-media {

    position: relative;
    z-index: 1;
    display: block;
    aspect-ratio: 16 / 13.5;
    overflow: hidden;
    background: #e9dfd0;
    cursor: zoom-in;

    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpath d='M0 0H100V100C80 98 55 90 30 88C15 87 6 84 0 84Z'/%3E%3C/svg%3E");
            mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpath d='M0 0H100V100C80 98 55 90 30 88C15 87 6 84 0 84Z'/%3E%3C/svg%3E");
    -webkit-mask-size: 100% 100%;
            mask-size: 100% 100%;
    -webkit-mask-repeat: no-repeat;
            mask-repeat: no-repeat;

}

.sf-media:focus-visible {
    outline: 2px solid var(--sf-brass);
    outline-offset: -4px;
}

.sf-media::after {

    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 38%;
    background: linear-gradient(to bottom, rgba(30, 20, 10, .42), rgba(30, 20, 10, 0));
    pointer-events: none;

}

.sf-img {

    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    scale: 1.03;
    transition: scale .9s cubic-bezier(.2, .8, .2, 1);

}

/* second photo that fades in on hover (product.hoverImage) */

.sf-img-hover {

    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity .6s ease, scale .9s cubic-bezier(.2, .8, .2, 1);

}

@media (hover: hover) {
    .sf-card:hover .sf-img-hover { opacity: 1; }
}

.sf-label {

    position: absolute;
    top: 20px;
    left: 24px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 12px;

    font-size: 10.5px;
    letter-spacing: .24em;
    text-transform: uppercase;
    color: #fff;
    text-shadow: 0 1px 6px rgba(0, 0, 0, .35);
    pointer-events: none;

}

.sf-label::after {
    content: "";
    width: 34px;
    height: 1px;
    background: currentColor;
    opacity: .85;
}

/* text */

.sf-body {

    position: relative;
    z-index: 2;
    margin-top: -10%;
    padding: 16px 64px 14px 24px;

    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;

}

.sf-title {

    margin: 0;
    font-family: "Cormorant Garamond", "Playfair Display", Georgia, "Times New Roman", serif;
    font-size: 1.65rem;
    font-weight: 600;
    letter-spacing: .005em;
    line-height: 1.15;
    color: var(--sf-ink);

}

.sf-desc {

    margin: 0;
    font-size: .88rem;
    line-height: 1.4;
    color: var(--sf-muted);

}

/* "Inquire about this" one-liner */

.sf-view {

    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 2px;
    padding: 0;
    font: inherit;
    font-size: .95rem;
    color: var(--sf-brass);
    background: none;
    border: 0;
    cursor: pointer;

}

.sf-view:hover { color: var(--sf-brass-dark); }

.sf-view svg,
.sf-go svg { transition: transform .3s ease; }

.sf-go {

    position: absolute;
    right: 16px;
    bottom: 14px;
    z-index: 3;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    padding: 0;
    color: #fff;
    background: var(--sf-brass);
    border: 0;
    border-radius: 50%;
    box-shadow: 0 6px 14px -4px rgba(125, 83, 34, .55);
    cursor: pointer;
    transition: background .3s ease;

}

.sf-go:focus-visible,
.sf-view:focus-visible {
    outline: 2px solid var(--sf-brass);
    outline-offset: 3px;
}

@media (max-width: 640px) {

    .sf-card { border-radius: 12px 48px 12px 12px; }
    .sf-body { padding-right: 58px; }
    .sf-grid { gap: 20px; }

}


/* ==================================================
   CUSTOMIZATION
================================================== */

.sf-custom { padding: clamp(40px, 6vw, 80px) 0 clamp(56px, 7vw, 96px); }

.sf-custom-panel {

    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 28px 48px;
    padding: clamp(28px, 4vw, 52px);
    background:
        linear-gradient(90deg, rgba(18, 13, 8, .82) 0%, rgba(18, 13, 8, .6) 38%, rgba(18, 13, 8, 0) 68%),
        var(--sf-bg-2) url("../assets/materialslide3.jpeg") center / cover no-repeat;
    border: 1px solid var(--sf-line);
    border-radius: 14px 64px 14px 14px;

}

.sf-custom-panel h2 {
    margin: 14px 0 10px;
    font-size: clamp(1.5rem, 1.1rem + 1.3vw, 2.1rem);
    font-weight: 400;
    color: #fbf7f0;
    text-shadow: 0 2px 14px rgba(0, 0, 0, .55);
}

.sf-custom-panel p {
    margin: 0;
    max-width: 36em;
    line-height: 1.6;
    color: #eadfcb;
    text-shadow: 0 1px 10px rgba(0, 0, 0, .6);
}

.sf-custom-panel .sf-eyebrow { color: #e4d3b6; }
.sf-custom-panel .sf-eyebrow span { background: #d9aa68; }

.sf-custom-btn {

    position: relative;
    top: 2cm;           /* nudge button down */
    display: inline-block;
    padding: 14px 30px;
    font-size: .95rem;
    letter-spacing: .04em;
    color: #fbf7f0;
    text-decoration: none;
    background: rgba(18, 13, 8, .55);
    -webkit-backdrop-filter: blur(6px);
            backdrop-filter: blur(6px);
    border: 1px solid #d9aa68;
    transition: background .3s ease, color .3s ease;

}

@media (max-width: 800px) { .sf-custom-btn { top: 0; } }

.sf-custom-btn:hover { background: #d9aa68; color: #2a211a; }


/* ==================================================
   VIEWER (lightbox)
================================================== */

body.sf-lock { overflow: hidden; }

.sf-viewer {

    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(24, 17, 10, .94);

}

.sf-viewer.open { display: flex; }

.sf-stage {

    flex: 1;
    width: 100%;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 56px 72px 8px;
    overflow: hidden;
    touch-action: none;

}

/* one or two photos, zoomed / panned together */

.sf-pair {

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    max-width: 100%;

}

.sf-viewer-img {

    display: block;
    width: auto;
    height: auto;
    max-width: calc(100vw - 144px);
    max-height: calc(100vh - 220px);
    max-height: calc(100dvh - 220px);
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
    transition: opacity .3s ease;
    border-radius: 6px;

}

.sf-viewer-img.is-loading { opacity: 0; }
.sf-stage.zoomed { cursor: grab; }
.sf-stage.dragging { cursor: grabbing; }

.sf-viewer-cap {
    padding: 8px 20px 4px;
    text-align: center;
    color: #f3ebdf;
}

.sf-viewer-title { font-size: 1.15rem; }
.sf-viewer-count { margin-top: 2px; font-size: .8rem; letter-spacing: .14em; color: #bfae96; }

.sf-viewer-zoom {

    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px 18px;

}

.sf-v-sep {
    width: 1px;
    height: 24px;
    margin: 0 6px;
    background: rgba(255, 255, 255, .22);
}

/* Individual / Full: quiet frosted-glass switch, neutral white (no brown or orange) */

.sf-v-mode {

    display: flex;
    gap: 4px;
    padding: 4px;
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 999px;
    -webkit-backdrop-filter: blur(12px);
            backdrop-filter: blur(12px);

}

.sf-viewer .sf-v-mode button {
    color: rgba(255, 255, 255, .72);
    border-color: transparent;
    background: transparent;
    box-shadow: none;
}

.sf-viewer button.active {
    color: #fff;
    background: linear-gradient(135deg, rgba(255, 255, 255, .26), rgba(255, 255, 255, .09));
    border-color: rgba(255, 255, 255, .38);
    box-shadow: 0 6px 18px -10px rgba(0, 0, 0, .6);
}

.sf-viewer button {

    display: grid;
    place-items: center;
    min-width: 42px;
    height: 42px;
    padding: 0 12px;
    font: inherit;
    color: rgba(255, 255, 255, .88);
    background: rgba(255, 255, 255, .07);
    border: 1px solid rgba(255, 255, 255, .15);
    border-radius: 999px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07);
    -webkit-backdrop-filter: blur(12px);
            backdrop-filter: blur(12px);
    cursor: pointer;
    transition: background .3s ease, border-color .3s ease, box-shadow .3s ease;

}

.sf-viewer button:hover {
    background: rgba(255, 255, 255, .14);
    border-color: rgba(255, 255, 255, .32);
}

.sf-viewer button.active:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, .32), rgba(255, 255, 255, .12));
}

.sf-viewer .sf-v-close { position: absolute; top: 16px; right: 16px; }

.sf-viewer .sf-v-prev,
.sf-viewer .sf-v-next {
    position: absolute;
    top: 50%;
    margin-top: -21px;
}

.sf-viewer .sf-v-prev { left: 16px; }
.sf-viewer .sf-v-next { right: 16px; }

@media (max-width: 640px) {
    .sf-stage { padding: 60px 12px 8px; }
    .sf-viewer-img {
        max-width: calc(100vw - 24px);
        max-height: calc(100vh - 270px);
        max-height: calc(100dvh - 270px);
    }
    .sf-viewer .sf-v-prev { left: 8px; }
    .sf-viewer .sf-v-next { right: 8px; }
}


/* ==================================================
   REDUCED MOTION
================================================== */

@media (prefers-reduced-motion: reduce) {

    .sf-card.is-visible,
    .sf-hero-slide.active { animation: none; }

    .sf-card,
    .sf-img,
    .sf-hero-slide { transition: none; }

    .sf-card:hover { transform: none; }

}


/* ==================================================
   CARD BASE
================================================== */

/* ---------- base card ---------- */

body.sofas-page .sf-card {
    border: 0;
    border-radius: 18px;
    background: #1b130d;
    box-shadow: 0 14px 34px -16px rgba(60, 40, 15, .4);
}

body.sofas-page .sf-media {
    aspect-ratio: 4 / 5;
    -webkit-mask-image: none;
            mask-image: none;
}

body.sofas-page .sf-media::after { display: none; }

body.sofas-page .sf-body {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    margin: 0;
    padding: 72px 64px 18px 20px;
    background: linear-gradient(to top, rgba(24, 16, 8, .9), rgba(24, 16, 8, .55) 55%, rgba(24, 16, 8, 0));
}

body.sofas-page .sf-title { color: #fff; }

body.sofas-page .sf-view { color: #f1d9b0; }

body.sofas-page .sf-desc {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    color: rgba(255, 255, 255, .85);
    transition: max-height .5s ease, opacity .4s ease;
}

@media (hover: hover) {
    body.sofas-page .sf-card:hover .sf-desc { max-height: 4.2em; opacity: 1; }
}

@media (hover: none) {
    body.sofas-page .sf-desc { max-height: none; opacity: 1; }
}


/* ==================================================
   LAYOUT: 3 cards per row
   Same card size and layout as the loungers and chairs pages:
   equal-width cards, every photo 4:3, 2 across on tablets,
   1 across on phones.
================================================== */

.sf-card[hidden] { display: none !important; }

body.sofas-page { --sf-photo-ratio: 4 / 3; }

body.sofas-page .sf-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

body.sofas-page .sf-card {
    margin: 0;
    min-width: 0;
}

body.sofas-page .sf-media {
    aspect-ratio: var(--sf-photo-ratio);
    height: auto;
}

body.sofas-page .sf-media .sf-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* tablets: 2 across, phones: 1 across */
@media (max-width: 860px) {
    body.sofas-page .sf-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 520px) {
    body.sofas-page .sf-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
}


/* ==================================================
   NAMES: below photo
   caption strip under the photo, "Inquire about this" button stays
================================================== */

body.sofas-page .sf-label,
body.sofas-page .sf-desc { display: none; }

body.sofas-page .sf-card {
    background: var(--sf-card);
    border: 1px solid var(--sf-line);
    border-radius: 18px;
}

body.sofas-page .sf-body {
    position: static;
    padding: 12px 62px 14px 16px;
    background: none;
    gap: 2px;
}

body.sofas-page .sf-title {
    max-width: 100%;
    color: var(--sf-ink);
    font-size: 1.2rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

body.sofas-page .sf-view { color: var(--sf-brass); font-size: .85rem; }
body.sofas-page .sf-go { bottom: 12px; }
