/*
Theme Name: Khalifa Textile
Theme URI: https://khalifatextile.com
Description: Frette-inspired luxury textile theme for S&S Quality Linen / Khalifa Textile
Author: Yara Team
Version: 2.0.0
Text Domain: khalifa
*/

/* ===== CSS Custom Properties ===== */
:root {
    --white: #FFFFFF;
    --cream: #FAF8F5;
    --ivory: #F7F4F0;
    --gold: #B8956A;
    --gold-light: #D4BA8A;
    --gold-dark: #9A7B52;
    --charcoal: #1E1E1E;
    --dark: #111111;
    --text: #333333;
    --text-light: #6B6B6B;
    --text-muted: #999999;
    --border: #E5E1DC;
    --border-light: #F0ECE7;

    --font-serif: 'Cormorant Garamond', 'Georgia', serif;
    --font-sans: 'Montserrat', 'Helvetica Neue', sans-serif;

    --container: 1440px;
    --container-narrow: 960px;
    --gutter: 40px;
    --header-h: 50px;
    --topbar-h: 36px;
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body {
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 400;
    line-height: 1.6;
    color: var(--text);
    background: var(--white);
    overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }

/* ===== Container ===== */
.container { max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }
.container--narrow { max-width: var(--container-narrow); }

/* ===== Typography (Frette-style) ===== */
h1, h2, h3, h4, h5 {
    font-family: var(--font-serif);
    font-weight: 300;
    line-height: 1.15;
    color: var(--charcoal);
}
h1 { font-size: clamp(32px, 5vw, 56px); letter-spacing: -0.02em; }
h2 { font-size: clamp(28px, 3.5vw, 44px); letter-spacing: -0.01em; }
h3 { font-size: clamp(22px, 2.5vw, 32px); }
h4 { font-size: 20px; }

.label {
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.label--gold { color: var(--gold); }

.separator {
    display: block;
    width: 50px;
    height: 1px;
    background: var(--gold);
    border: none;
    margin: 20px 0;
}
.separator--center { margin: 20px auto; }

/* ===== Buttons (Frette-style) ===== */
.btn {
    display: inline-block;
    padding: 14px 40px;
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}
.btn--outline {
    border: 1px solid var(--charcoal);
    color: var(--charcoal);
    background: transparent;
}
.btn--outline:hover { background: var(--charcoal); color: var(--white); }
.btn--outline-white {
    border: 1px solid var(--white);
    color: var(--white);
    background: transparent;
}
.btn--outline-white:hover { background: var(--white); color: var(--charcoal); }
.btn--solid {
    background: var(--charcoal);
    color: var(--white);
    border: 1px solid var(--charcoal);
}
.btn--solid:hover { background: var(--dark); }
.btn--gold {
    border: 1px solid var(--gold);
    color: var(--gold);
    background: transparent;
}
.btn--gold:hover { background: var(--gold); color: var(--white); }

/* ===== TOP BAR (Frette has a rotating announcement bar) ===== */
.topbar {
    height: var(--topbar-h);
    background: var(--charcoal);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    z-index: 1001;
}
.topbar__text {
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--white);
    opacity: 0;
    position: absolute;
    transition: opacity 0.6s ease;
    white-space: nowrap;
}
.topbar__text.active { opacity: 1; }

/* ===== HEADER (Frette-style: clean, minimal, centered logo) ===== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    transition: box-shadow 0.3s ease;
}
.site-header.scrolled { box-shadow: 0 1px 12px rgba(0,0,0,0.04); }

.header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-h);
    padding: 0 var(--gutter);
    max-width: 100%;
}

/* Left: nav links */
.header__left { display: flex; align-items: center; flex: 1; }

/* Center: logo */
.header__center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}
.header__logo img { height: 36px; width: auto; }
.header__logo-text {
    font-family: var(--font-serif);
    font-size: 22px;
    font-weight: 400;
    color: var(--charcoal);
    letter-spacing: 0.03em;
    white-space: nowrap;
}

/* Right: actions */
.header__right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex: 1;
    gap: 20px;
}

/* Main Nav */
.main-nav__list {
    display: flex;
    gap: 28px;
    list-style: none;
    margin: 0;
    padding: 0;
}
.main-nav__list > li { position: relative; }
.main-nav__list > li > a {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text);
    padding: 16px 0;
    display: block;
    position: relative;
    transition: color 0.2s;
}
.main-nav__list > li > a::after {
    content: '';
    position: absolute;
    bottom: 12px; left: 0;
    width: 100%;
    height: 1px;
    background: var(--charcoal);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}
.main-nav__list > li:hover > a { color: var(--charcoal); }
.main-nav__list > li:hover > a::after { transform: scaleX(1); }

/* Mega Menu (Frette-style dropdown) */
.mega-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: -40px;
    background: var(--white);
    border-top: 1px solid var(--border);
    box-shadow: 0 20px 60px rgba(0,0,0,0.06);
    padding: 36px 40px;
    min-width: 600px;
    z-index: 999;
}
.main-nav__list > li:hover > .mega-menu {
    display: flex;
    animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.mega-col { min-width: 160px; margin-right: 40px; }
.mega-col:last-child { margin-right: 0; }
.mega-col__title {
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--charcoal);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}
.mega-col ul { list-style: none; padding: 0; }
.mega-col li { margin-bottom: 8px; }
.mega-col a {
    font-size: 13px;
    color: var(--text-light);
    transition: color 0.2s;
    display: block;
}
.mega-col a:hover { color: var(--charcoal); }

/* Featured image in mega menu */
.mega-feature {
    position: relative;
    overflow: hidden;
    min-width: 220px;
}
.mega-feature img {
    width: 220px;
    height: 280px;
    object-fit: cover;
}
.mega-feature__caption {
    margin-top: 12px;
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
}

/* Header CTA */
.header__cta {
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--gold);
    border: 1px solid var(--gold);
    padding: 6px 14px;
    transition: all 0.2s;
    white-space: nowrap;
}
.header__cta:hover { background: var(--gold); color: var(--white); }

/* Mobile */
.mobile-toggle { display: none; flex-direction: column; gap: 5px; padding: 4px; }
.mobile-toggle span { display: block; width: 22px; height: 1px; background: var(--charcoal); transition: all 0.3s; }

/* ===== HERO (Frette: full-width, tall, editorial imagery) ===== */
.hero {
    position: relative;
    width: 100%;
    height: 80vh;
    min-height: 500px;
    max-height: 800px;
    overflow: hidden;
}
.hero__slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 1.2s ease;
}
.hero__slide.active { opacity: 1; }
.hero__slide img, .hero__slide-bg {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0) 40%, rgba(0,0,0,0.35) 100%);
}
.hero__content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0 var(--gutter) 60px;
    text-align: center;
}
.hero__subtitle {
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.8);
    margin-bottom: 12px;
}
.hero__title {
    font-family: var(--font-serif);
    font-size: clamp(28px, 4vw, 48px);
    font-weight: 300;
    color: var(--white);
    margin-bottom: 24px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}
.hero__nav {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 24px;
}
.hero__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.5);
    background: transparent;
    cursor: pointer;
    transition: all 0.3s;
}
.hero__dot.active { background: var(--white); border-color: var(--white); }

/* ===== SECTION SPACING ===== */
.section { padding: 80px 0; }
.section--lg { padding: 100px 0; }
.section--cream { background: var(--cream); }
.section--ivory { background: var(--ivory); }
.section--dark { background: var(--charcoal); color: var(--cream); }
.section--dark h2, .section--dark h3, .section--dark h4 { color: var(--cream); }
.section--dark .label { color: var(--gold-light); }

.text-center { text-align: center; }

/* ===== CATEGORY CARDS (Frette: tall 3:4, full-bleed images, text overlay at bottom) ===== */
.cat-grid {
    display: grid;
    gap: 20px;
}
.cat-grid--3 { grid-template-columns: repeat(3, 1fr); }
.cat-grid--2 { grid-template-columns: repeat(2, 1fr); }
.cat-grid--featured {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
}
.cat-grid--featured .cat-card:first-child {
    grid-row: 1 / 3;
}

.cat-card {
    position: relative;
    overflow: hidden;
    cursor: pointer;
}
.cat-card__img {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    transition: transform 0.8s cubic-bezier(0.25, 0, 0.25, 1);
}
.cat-card:hover .cat-card__img { transform: scale(1.04); }
.cat-card__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 50%, rgba(0,0,0,0.45) 100%);
}
.cat-card__content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 30px;
}
.cat-card__title {
    font-family: var(--font-serif);
    font-size: clamp(20px, 2vw, 28px);
    font-weight: 300;
    color: var(--white);
    margin-bottom: 8px;
}
.cat-card__link {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.8);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: color 0.2s;
}
.cat-card__link:hover { color: var(--white); }
.cat-card__link::after { content: '→'; }

/* ===== SPLIT SECTION (image + text, like Frette heritage) ===== */
.split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 500px;
}
.split--reverse .split__image { order: 2; }
.split--reverse .split__content { order: 1; }
.split__image {
    overflow: hidden;
}
.split__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s ease;
}
.split__image:hover img { transform: scale(1.03); }
.split__content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 60px 80px;
}
.split__content h2 { margin-bottom: 20px; }
.split__content p {
    color: var(--text-light);
    font-size: 14px;
    line-height: 1.8;
    margin-bottom: 16px;
}
.split__content .btn { margin-top: 20px; align-self: flex-start; }

/* ===== VALUES STRIP ===== */
.values-strip {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    background: var(--border);
}
.value-item {
    background: var(--white);
    padding: 60px 40px;
    text-align: center;
}
.value-item__icon {
    font-size: 28px;
    margin-bottom: 20px;
}
.value-item__title {
    font-family: var(--font-serif);
    font-size: 22px;
    font-weight: 300;
    margin-bottom: 12px;
}
.value-item__text {
    color: var(--text-light);
    font-size: 13px;
    line-height: 1.8;
}

/* ===== SERVICES GRID (Frette bespoke section) ===== */
.services {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
}
.service {
    position: relative;
    overflow: hidden;
    cursor: pointer;
}
.service__img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    transition: transform 0.6s ease;
}
.service:hover .service__img { transform: scale(1.05); }
.service__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.35);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 30px;
    transition: background 0.3s;
}
.service:hover .service__overlay { background: rgba(0,0,0,0.45); }
.service__title {
    font-family: var(--font-serif);
    font-size: 26px;
    font-weight: 300;
    color: var(--white);
    margin-bottom: 12px;
}
.service__text {
    font-size: 13px;
    color: rgba(255,255,255,0.75);
    max-width: 260px;
    margin-bottom: 20px;
    line-height: 1.6;
}
.service__link {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--white);
    border-bottom: 1px solid rgba(255,255,255,0.4);
    padding-bottom: 2px;
    transition: border-color 0.2s;
}
.service__link:hover { border-color: var(--white); }

/* ===== FULL-WIDTH CTA BANNER ===== */
.cta-banner {
    position: relative;
    height: 400px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}
.cta-banner__bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.cta-banner__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.3);
}
.cta-banner__content { position: relative; z-index: 2; }
.cta-banner__content h2 { color: var(--white); margin-bottom: 24px; }

/* ===== PRODUCT CARD (Catalog mode) ===== */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}
.product-card { position: relative; }
.product-card__img {
    position: relative;
    overflow: hidden;
    background: var(--ivory);
}
.product-card__img img {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    transition: transform 0.6s ease;
}
.product-card:hover .product-card__img img { transform: scale(1.04); }
.product-card__body { padding: 16px 0; }
.product-card__cat {
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 4px;
    display: block;
}
.product-card__name {
    font-family: var(--font-serif);
    font-size: 18px;
    font-weight: 400;
    color: var(--charcoal);
    margin-bottom: 8px;
}
.product-card__name a { transition: color 0.2s; }
.product-card__name a:hover { color: var(--gold); }

/* Request Quote button */
.btn-quote {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border: 1px solid var(--gold);
    color: var(--gold);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    transition: all 0.3s;
}
.btn-quote:hover { background: var(--gold); color: var(--white); }
.btn-quote svg { width: 14px; height: 14px; fill: currentColor; }

/* ===== NEWSLETTER (Frette-style) ===== */
.newsletter {
    padding: 80px 0;
    text-align: center;
    background: var(--ivory);
}
.newsletter h2 { margin-bottom: 12px; }
.newsletter p { color: var(--text-light); margin-bottom: 32px; font-size: 14px; }
.newsletter__form {
    display: flex;
    max-width: 480px;
    margin: 0 auto;
}
.newsletter__input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-right: none;
    font-family: var(--font-sans);
    font-size: 13px;
    background: var(--white);
    color: var(--text);
}
.newsletter__input:focus { outline: none; border-color: var(--gold); }
.newsletter__input::placeholder { color: var(--text-muted); }
.newsletter__btn {
    padding: 12px 24px;
    background: var(--charcoal);
    color: var(--white);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    border: 1px solid var(--charcoal);
    transition: all 0.3s;
    white-space: nowrap;
}
.newsletter__btn:hover { background: var(--gold); border-color: var(--gold); }

/* ===== FOOTER (Frette-style: dark, structured) ===== */
.site-footer {
    background: var(--charcoal);
    color: #AAA;
    padding: 60px 0 24px;
}
.footer__grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
    gap: 40px;
    padding-bottom: 40px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.footer__brand-text {
    font-family: var(--font-serif);
    font-size: 22px;
    color: var(--white);
    margin-bottom: 16px;
}
.footer__brand-desc {
    font-size: 13px;
    line-height: 1.8;
    color: #888;
}
.footer__col-title {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--white);
    margin-bottom: 20px;
}
.footer__links li { margin-bottom: 8px; }
.footer__links a {
    font-size: 13px;
    color: #888;
    transition: color 0.2s;
}
.footer__links a:hover { color: var(--gold-light); }
.footer__bottom {
    padding-top: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: #666;
}

/* WhatsApp FAB */
.wa-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 52px;
    height: 52px;
    background: #25D366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(37, 211, 102, 0.35);
    z-index: 999;
    transition: transform 0.3s;
}
.wa-fab:hover { transform: scale(1.08); }
.wa-fab svg { width: 26px; height: 26px; fill: white; }

/* ===== BREADCRUMBS ===== */
.breadcrumbs {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 12px;
}
.breadcrumbs a { color: var(--text-muted); transition: color 0.2s; }
.breadcrumbs a:hover { color: var(--charcoal); }
.breadcrumbs span { margin: 0 6px; }

/* ===== SHOP PAGE HERO ===== */
.page-hero {
    padding: 60px 0 40px;
    background: var(--cream);
    text-align: center;
}
.page-hero h1 { margin-top: 12px; }

/* ===== SCROLL REVEAL ===== */
.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    :root { --gutter: 24px; }
    .cat-grid--3 { grid-template-columns: repeat(2, 1fr); }
    .split { grid-template-columns: 1fr; }
    .split__content { padding: 40px 24px; }
    .split--reverse .split__image { order: 1; }
    .split--reverse .split__content { order: 2; }
    .values-strip { grid-template-columns: repeat(2, 1fr); }
    .services { grid-template-columns: repeat(2, 1fr); }
    .footer__grid { grid-template-columns: repeat(2, 1fr); }
    .mega-menu { display: none !important; }
}

@media (max-width: 768px) {
    .main-nav { display: none; }
    .mobile-toggle { display: flex; }
    .main-nav.open { display: block; position: absolute; top: 100%; left: 0; right: 0; background: var(--white); border-top: 1px solid var(--border); padding: 20px var(--gutter); box-shadow: 0 20px 40px rgba(0,0,0,0.08); }
    .main-nav.open .main-nav__list { flex-direction: column; gap: 0; }
    .main-nav.open .main-nav__list > li > a { padding: 12px 0; border-bottom: 1px solid var(--border-light); }
    .header__center { position: static; transform: none; }
    .header__left { display: none; }
    .header__inner { justify-content: center; position: relative; }
    .mobile-toggle { position: absolute; left: var(--gutter); }
    .header__right { position: absolute; right: var(--gutter); }

    .hero { height: 60vh; }
    .cat-grid--3 { grid-template-columns: 1fr; }
    .cat-grid--2 { grid-template-columns: 1fr; }
    .values-strip { grid-template-columns: 1fr; }
    .services { grid-template-columns: 1fr; }
    .footer__grid { grid-template-columns: 1fr; gap: 24px; }
    .section { padding: 50px 0; }
    .newsletter__form { flex-direction: column; gap: 0; }
    .newsletter__input { border-right: 1px solid var(--border); }
}
