/* Judge Carpets & Flooring — Custom Styles
   Brand colours are controlled via CSS custom properties injected by includes/header.php */

/* ── Navigation ──────────────────────────────────────────────────────────── */
.nav-link {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 0.875rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #5c5c54;
    border-radius: 0.375rem;
    transition: color 0.15s;
    position: relative;
}
.nav-link:hover { color: #1a1a17; }
.nav-active { color: var(--brand-700); font-weight: 600; }

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 0.875rem;
    right: 0.875rem;
    height: 2px;
    background: var(--brand-600);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.25s ease;
    border-radius: 2px;
}
.nav-link:hover::after, .nav-active::after { transform: scaleX(1); }

.nav-dropdown-wrap:hover .nav-dropdown { display: block; }
.nav-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 230px;
    background: white;
    border: 1px solid #e7e7e5;
    border-radius: 0.75rem;
    box-shadow: 0 16px 40px rgba(0,0,0,0.12);
    padding: 0.5rem;
    z-index: 60;
}
.nav-dropdown-item {
    display: block;
    padding: 0.55rem 0.875rem;
    font-size: 0.875rem;
    color: #4c4c46;
    border-radius: 0.5rem;
    transition: all 0.15s;
}
.nav-dropdown-item:hover { background: var(--brand-50); color: var(--brand-700); padding-left: 1.125rem; }

/* Mobile nav */
.mobile-nav-link {
    display: block;
    padding: 0.75rem 1rem;
    font-size: 0.9375rem;
    font-weight: 500;
    color: #4c4c46;
    border-radius: 0.5rem;
    transition: all 0.15s;
}
.mobile-nav-link:hover { background: #f6f6f5; color: var(--brand-600); }
.mobile-nav-sublink {
    display: block;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    color: #73736a;
    border-radius: 0.375rem;
}
.mobile-nav-sublink:hover { background: var(--brand-50); color: var(--brand-600); }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn-primary {
    display: inline-flex; align-items: center; gap: 0.5rem;
    background: var(--brand-600); color: white;
    padding: 0.625rem 1.375rem;
    border-radius: 0.5rem; font-size: 0.875rem; font-weight: 600;
    transition: all 0.2s; box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    text-decoration: none;
}
.btn-primary:hover { background: var(--brand-700); box-shadow: 0 6px 16px rgba(0,0,0,0.12); transform: translateY(-1px); }
.btn-primary:active { transform: scale(0.97); box-shadow: none; }

.btn-secondary {
    display: inline-flex; align-items: center; gap: 0.5rem;
    background: white; color: #4c4c46;
    border: 1px solid #d1d1cd;
    padding: 0.625rem 1.375rem;
    border-radius: 0.5rem; font-size: 0.875rem; font-weight: 600;
    transition: all 0.2s;
}
.btn-secondary:hover { background: #f6f6f5; transform: translateY(-1px); }
.btn-secondary:active { transform: scale(0.97); }

.btn-outline {
    display: inline-flex; align-items: center; gap: 0.5rem;
    border: 2px solid var(--brand-600); color: var(--brand-700);
    padding: 0.625rem 1.375rem;
    border-radius: 0.5rem; font-size: 0.875rem; font-weight: 600;
    transition: all 0.2s; text-decoration: none;
}
.btn-outline:hover { background: var(--brand-600); color: white; transform: translateY(-1px); }
.btn-outline:active { transform: scale(0.97); }

/* Hero-sized buttons */
.hero-btn-primary {
    display: inline-flex; align-items: center; gap: 0.625rem;
    background: white; color: #1a1a17;
    padding: 0.875rem 2rem;
    border-radius: 0.625rem; font-size: 1rem; font-weight: 700;
    transition: all 0.25s; text-decoration: none;
    box-shadow: 0 4px 24px rgba(0,0,0,0.18);
}
.hero-btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 32px rgba(0,0,0,0.22); }
.hero-btn-primary:active { transform: scale(0.97); }

.hero-btn-outline {
    display: inline-flex; align-items: center; gap: 0.625rem;
    border: 2px solid rgba(255,255,255,0.45); color: white;
    padding: 0.875rem 2rem;
    border-radius: 0.625rem; font-size: 1rem; font-weight: 600;
    transition: all 0.25s; text-decoration: none; backdrop-filter: blur(4px);
}
.hero-btn-outline:hover { background: rgba(255,255,255,0.15); border-color: rgba(255,255,255,0.7); transform: translateY(-2px); }
.hero-btn-outline:active { transform: scale(0.97); }

/* ── Section headings ────────────────────────────────────────────────────── */
.section-eyebrow {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--brand-600);
    margin-bottom: 0.625rem;
}
.section-title {
    font-family: var(--font-display, inherit);
    font-size: clamp(2rem, 3.5vw, 2.875rem);
    font-weight: 800;
    color: #1a1a17;
    line-height: 1.1;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}
.section-subtitle {
    color: #73736a; font-size: 1.0625rem; max-width: 40rem;
    line-height: 1.7;
    margin: 0 auto;
}
.section-header-lg { text-align: center; margin-bottom: 3.5rem; }

/* Legacy compat */
.section-header { text-align: center; margin-bottom: 3rem; }
.section-header h2 {
    font-size: clamp(1.75rem, 3vw, 2.5rem);
    font-weight: 800; margin-bottom: 0.75rem; color: #1a1a17;
}
.section-header p { color: #73736a; font-size: 1.0625rem; max-width: 42rem; margin: 0 auto; }

/* ── Product Cards ───────────────────────────────────────────────────────── */
.product-card {
    background: white; border-radius: 0.875rem; overflow: hidden;
    border: 1px solid #e7e7e5;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.product-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 48px rgba(0,0,0,0.12);
    border-color: var(--brand-200);
}
.product-card:hover .product-card-image { transform: scale(1.05); }
.product-card-image { transition: transform 0.5s; }

/* Range card (featured products) */
.range-card {
    background: white; border-radius: 0.875rem; overflow: hidden;
    border: 1px solid #ebebea;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-decoration: none; display: block;
}
.range-card:hover { transform: translateY(-6px); box-shadow: 0 20px 48px rgba(0,0,0,0.11); }
.range-card-img {
    position: relative; aspect-ratio: 4/3; overflow: hidden;
    background: #f0ede8;
}

/* ── Overlay Cards (Category grid) ──────────────────────────────────────── */
.overlay-card {
    position: relative;
    display: block;
    border-radius: 1.25rem;
    overflow: hidden;
    aspect-ratio: 4/5;
    text-decoration: none;
}
@media (min-width: 768px) {
    .overlay-card { aspect-ratio: 3/4; }
}
.overlay-card-img {
    position: absolute; inset: 0;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.overlay-card:hover .overlay-card-img { transform: scale(1.06); }
.overlay-card-bg {
    position: absolute; inset: 0;
    transition: inherit;
}
/* Gradient overlay from transparent top to dark bottom */
.overlay-card::before {
    content: '';
    position: absolute; inset: 0; z-index: 1;
    background: linear-gradient(to top, rgba(0,0,0,0.88) 0%, rgba(0,0,0,0.3) 50%, transparent 100%);
}
.overlay-card-content {
    position: absolute; bottom: 0; left: 0; right: 0;
    padding: 2rem;
    z-index: 2;
}
.overlay-card-cta {
    opacity: 0.75;
    transition: opacity 0.2s, gap 0.2s;
}
.overlay-card:hover .overlay-card-cta { opacity: 1; gap: 0.5rem; }

/* ── Colour chips ────────────────────────────────────────────────────────── */
.colour-chip { display: flex; flex-direction: column; align-items: center; gap: 0.625rem; cursor: pointer; text-decoration: none; }
.colour-chip-swatch {
    width: 4rem; height: 4rem;
    border-radius: 9999px;
    border: 3px solid white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    transition: all 0.25s;
}
.colour-chip:hover .colour-chip-swatch { transform: scale(1.12) translateY(-4px); box-shadow: 0 8px 20px rgba(0,0,0,0.18); }
.colour-chip-label {
    font-size: 0.75rem; font-weight: 600; color: #73736a;
    transition: color 0.2s;
}
.colour-chip:hover .colour-chip-label { color: #1a1a17; }

/* Old colour filter (product pages) */
.color-filter-btn { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; cursor: pointer; text-decoration: none; }
.color-filter-btn .swatch { width: 3.5rem; height: 3.5rem; border-radius: 9999px; border: 2px solid #e7e7e5; transition: all 0.2s; }
.color-filter-btn:hover .swatch { transform: scale(1.1); box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.color-filter-btn.active .swatch { outline: 2px solid var(--brand-500); outline-offset: 2px; border-color: var(--brand-300); }
.color-filter-btn span { font-size: 0.75rem; font-weight: 500; color: #73736a; }
.color-filter-btn:hover span { color: #40403b; }

/* ── Why cards ───────────────────────────────────────────────────────────── */
.why-card {
    background: white;
    border: 1px solid #ebebea;
    border-radius: 1.25rem;
    padding: 2rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.why-card:hover { transform: translateY(-4px); box-shadow: 0 16px 36px rgba(0,0,0,0.08); }
.why-card-icon {
    width: 3.5rem; height: 3.5rem;
    background: var(--brand-50);
    border-radius: 0.875rem;
    display: flex; align-items: center; justify-content: center;
    color: var(--brand-600);
    margin-bottom: 1.25rem;
    transition: background 0.2s;
}
.why-card:hover .why-card-icon { background: var(--brand-600); color: white; }

/* ── Color Swatches ──────────────────────────────────────────────────────── */
.color-swatch {
    width: 2rem; height: 2rem; border-radius: 9999px;
    border: 2px solid white; box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    cursor: pointer; transition: all 0.2s;
}
.color-swatch:hover { transform: scale(1.1); box-shadow: 0 4px 6px rgba(0,0,0,0.15); }
.color-swatch.active, .color-swatch:focus { outline: 2px solid var(--brand-500); outline-offset: 2px; }
.color-swatch-lg {
    width: 3rem; height: 3rem; border-radius: 9999px;
    border: 2px solid white; box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    cursor: pointer; transition: all 0.2s;
}
.color-swatch-lg:hover { transform: scale(1.1); }
.color-swatch-lg.active { outline: 2px solid var(--brand-500); outline-offset: 2px; }

/* ── Badges ──────────────────────────────────────────────────────────────── */
.badge {
    display: inline-flex; align-items: center;
    padding: 0.2rem 0.625rem; border-radius: 9999px;
    font-size: 0.7rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
}
.badge-new        { background: #d1fae5; color: #047857; }
.badge-bestseller { background: #fef3c7; color: #92400e; }
.badge-premium    { background: #ede9fe; color: #5b21b6; }
.badge-popular    { background: #dbeafe; color: #1d4ed8; }
.badge-sale       { background: #fee2e2; color: #b91c1c; }

/* ── Forms ───────────────────────────────────────────────────────────────── */
.form-input {
    width: 100%; padding: 0.75rem 1rem;
    border: 1px solid #d1d1cd; border-radius: 0.5rem;
    font-size: 0.875rem; outline: none; transition: all 0.2s;
    background: white;
}
.form-input:focus { border-color: var(--brand-500); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-500) 15%, transparent); }
.form-label { display: block; font-size: 0.875rem; font-weight: 500; color: #4c4c46; margin-bottom: 0.375rem; }

/* ── Breadcrumb ──────────────────────────────────────────────────────────── */
.breadcrumb { display: flex; align-items: center; gap: 0.5rem; font-size: 0.875rem; color: #8e8e85; padding: 1rem 0; flex-wrap: wrap; }
.breadcrumb a { transition: color 0.15s; }
.breadcrumb a:hover { color: var(--brand-600); }
.breadcrumb .separator { color: #b0b0aa; }

/* ── Variant Grid ────────────────────────────────────────────────────────── */
.variant-card {
    position: relative; background: white; border-radius: 0.625rem; overflow: hidden;
    border: 1px solid #e7e7e5; cursor: pointer; transition: all 0.2s;
}
.variant-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.1); border-color: var(--brand-200); }
.variant-card.selected { border-color: var(--brand-500); box-shadow: 0 4px 12px rgba(0,0,0,0.1); outline: 1px solid var(--brand-200); }

/* ── Image placeholder — linen texture ───────────────────────────────────── */
.bg-placeholder { aspect-ratio: 4/3; min-height: 200px; }
.img-placeholder {
    background-color: var(--ph, #9c8e7d);
    background-image:
        repeating-linear-gradient(0deg,   rgba(0,0,0,0.07) 0, rgba(0,0,0,0.07) 1px, transparent 1px, transparent 9px),
        repeating-linear-gradient(90deg,  rgba(0,0,0,0.05) 0, rgba(0,0,0,0.05) 1px, transparent 1px, transparent 9px),
        repeating-linear-gradient(45deg,  rgba(255,255,255,0.03) 0, rgba(255,255,255,0.03) 1px, transparent 1px, transparent 18px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 160px;
}

/* ── Hero ────────────────────────────────────────────────────────────────── */
.hero-gradient {
    background: var(--hero-gradient, linear-gradient(135deg, #3a1b0e 0%, #6c381d 40%, #854321 100%));
}
.hero-slide { min-height: 88vh; }

/* ── Hero Slider ─────────────────────────────────────────────────────────── */
.hero-slider { position: relative; overflow: hidden; }
.slider-track { display: flex; transition: transform 0.65s cubic-bezier(0.4, 0, 0.2, 1); will-change: transform; }
.slider-slide { min-width: 100%; flex-shrink: 0; }
.slider-dots { display: flex; justify-content: center; gap: 0.5rem; position: absolute; bottom: 1.75rem; left: 50%; transform: translateX(-50%); z-index: 10; }
.slider-dot { width: 8px; height: 8px; border-radius: 9999px; background: rgba(255,255,255,0.4); border: none; cursor: pointer; transition: background 0.25s, width 0.25s; padding: 0; }
.slider-dot.active { background: white; width: 28px; }
.slider-arrow {
    position: absolute; top: 50%; transform: translateY(-50%); z-index: 10;
    background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.25); color: white;
    width: 48px; height: 48px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: background 0.2s; backdrop-filter: blur(6px);
}
.slider-arrow:hover { background: rgba(255,255,255,0.25); }
.slider-arrow-prev { left: 1.5rem; }
.slider-arrow-next { right: 1.5rem; }

/* ── Reveal on scroll ────────────────────────────────────────────────────── */
.reveal { opacity: 0; transform: translateY(32px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.is-visible { opacity: 1; transform: translateY(0); }
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* ── Smooth scroll & sticky header ──────────────────────────────────────── */
html { scroll-behavior: smooth; }
#main-header { transition: box-shadow 0.3s; }
#main-header.scrolled { box-shadow: 0 4px 20px rgba(0,0,0,0.09); }

/* ── Animations ──────────────────────────────────────────────────────────── */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.animate-fade-in-up { animation: fadeInUp 0.65s ease-out both; }
.animate-delay-100  { animation-delay: 0.1s; }
.animate-delay-200  { animation-delay: 0.2s; }
.animate-delay-300  { animation-delay: 0.3s; }

/* ── Utilities ───────────────────────────────────────────────────────────── */
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.line-clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
