/* ========================================
   Durable Fasteners - Modern Website
   ======================================== */

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --blue-900: #0c1d3a;
    --blue-800: #122b54;
    --blue-700: #1a3a6b;
    --blue-600: #1e4d8f;
    --blue-500: #2563a8;
    --blue-400: #3b82c4;
    --blue-100: #dbeafe;
    --blue-50: #eff6ff;
    --gold-500: #b8860b;
    --gold-400: #d4a017;
    --gold-300: #e6b422;
    --gray-900: #111827;
    --gray-800: #1f2937;
    --gray-700: #374151;
    --gray-600: #4b5563;
    --gray-500: #6b7280;
    --gray-400: #9ca3af;
    --gray-200: #e5e7eb;
    --gray-100: #f3f4f6;
    --gray-50: #f9fafb;
    --white: #ffffff;
    --radius: 8px;
    --radius-lg: 12px;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07), 0 2px 4px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05);
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--gray-800);
    line-height: 1.6;
    background: var(--white);
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--blue-600);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--blue-400);
}

img {
    max-width: 100%;
    display: block;
}

.container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 24px;
}

/* --- Header --- */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.header-scrolled {
    border-bottom-color: var(--gray-200);
    box-shadow: var(--shadow-sm);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}

.logo {
    display: flex;
    align-items: baseline;
    gap: 6px;
    text-decoration: none;
}

.logo-durable {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--blue-800);
    letter-spacing: -0.02em;
}

.logo-fasteners {
    font-size: 1.35rem;
    font-weight: 300;
    color: var(--gray-500);
    letter-spacing: -0.01em;
}

.nav {
    display: flex;
    gap: 32px;
}

.nav-link {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--gray-600);
    text-decoration: none;
    padding: 4px 0;
    position: relative;
    transition: color 0.2s;
}

.nav-link:hover {
    color: var(--blue-600);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--blue-600);
    transition: width 0.2s;
}

.nav-link:hover::after {
    width: 100%;
}

/* Mobile Toggle */
.mobile-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.mobile-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--gray-700);
    border-radius: 2px;
    transition: transform 0.3s, opacity 0.3s;
}

.mobile-toggle.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.mobile-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-toggle.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* --- Hero --- */
.hero {
    padding: 160px 0 100px;
    background: linear-gradient(135deg, var(--blue-900) 0%, var(--blue-700) 100%);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.03);
}

.hero::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.02);
}

.hero-inner {
    position: relative;
    z-index: 1;
}

.hero-content {
    max-width: 640px;
}

.hero-badge {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--gold-300);
    margin-bottom: 20px;
    padding: 6px 14px;
    border: 1px solid rgba(230, 180, 34, 0.3);
    border-radius: 20px;
}

.hero h1 {
    font-size: 3.2rem;
    font-weight: 800;
    color: var(--white);
    line-height: 1.15;
    letter-spacing: -0.03em;
    margin-bottom: 20px;
}

.hero-sub {
    font-size: 1.15rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.7;
    margin-bottom: 36px;
}

.hero-actions {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 28px;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: var(--radius);
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
    border: 2px solid transparent;
}

.btn-primary {
    background: var(--blue-600);
    color: var(--white);
    border-color: var(--blue-600);
}

.btn-primary:hover {
    background: var(--blue-500);
    border-color: var(--blue-500);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(30, 77, 143, 0.3);
}

.btn-outline {
    background: transparent;
    color: var(--white);
    border-color: rgba(255, 255, 255, 0.3);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.6);
    color: var(--white);
}

/* --- Section Headers --- */
.section-header {
    text-align: center;
    max-width: 600px;
    margin: 0 auto 56px;
}

.section-header h2 {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--gray-900);
    letter-spacing: -0.02em;
    margin-bottom: 12px;
}

.section-header p {
    font-size: 1.05rem;
    color: var(--gray-500);
    line-height: 1.7;
}

/* --- Products --- */
.products {
    padding: 100px 0;
    background: var(--gray-50);
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.product-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 2px solid var(--gray-200);
    transition: box-shadow 0.3s, border-color 0.2s;
    overflow: hidden;
}

.product-card:hover {
    box-shadow: var(--shadow-lg);
    border-color: var(--blue-400);
}

.product-card-active {
    border-color: var(--blue-600);
    box-shadow: var(--shadow-lg);
}

.product-card-active:hover {
    border-color: var(--blue-600);
}

.product-card-header {
    width: 100%;
    padding: 36px 30px;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    font-size: inherit;
    display: flex;
    flex-direction: column;
    transition: background 0.2s;
}

.product-card-active .product-card-header {
    background: var(--blue-50);
}

.product-card-header:focus-visible {
    outline: 2px solid var(--blue-500);
    outline-offset: -2px;
}

.product-card-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--blue-600);
    margin-top: auto;
    padding-top: 12px;
    transition: gap 0.2s;
}

.product-card:hover .product-card-cta {
    gap: 10px;
}

.product-card-cta .arrow {
    display: inline-block;
    transition: transform 0.3s;
}

.product-card-active .product-card-cta .arrow {
    transform: rotate(180deg);
}

.product-icon {
    width: 56px;
    height: 56px;
    color: var(--blue-600);
    margin-bottom: 20px;
}

.product-icon svg {
    width: 100%;
    height: 100%;
}

.product-card h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 10px;
}

.product-card-header p {
    font-size: 0.92rem;
    color: var(--gray-600);
    line-height: 1.65;
    margin-bottom: 8px;
}

/* Shared detail panel (sits as a grid row) */
.detail-panel {
    grid-column: 1 / -1;
    display: none;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.detail-panel-inner {
    background: var(--white);
    border: 2px solid var(--blue-600);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 28px 32px 32px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    align-items: start;
}

.detail-panel-inner.detail-panel-centered {
    display: flex;
    justify-content: center;
}

/* --- Inline Detail Content --- */
.detail-images-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
}

.detail-image-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.detail-image-svg {
    width: 100%;
    aspect-ratio: 1;
    background: var(--gray-50);
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s;
}

.detail-image-svg:hover {
    border-color: var(--blue-400);
}

.detail-image-item:only-child .detail-image-svg {
    aspect-ratio: auto;
}

.detail-image-item:only-child .detail-image-svg img {
    width: 100%;
    height: auto;
}

.detail-image-svg svg,
.detail-image-svg img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.detail-image-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--gray-500);
    text-align: center;
}

.detail-text-block h4 {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--gray-900);
    margin-bottom: 12px;
    letter-spacing: -0.01em;
}

.detail-text-block p {
    font-size: 0.88rem;
    color: var(--gray-600);
    line-height: 1.65;
    margin-bottom: 10px;
}

.detail-text-block a {
    color: var(--blue-600);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.detail-text-block a.btn {
    color: var(--white);
    text-decoration: none;
}

.detail-features {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 16px 0 20px;
}

.detail-feature-tag {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--blue-700);
    background: var(--blue-50);
    padding: 4px 12px;
    border-radius: 20px;
    border: 1px solid var(--blue-100);
}

.detail-enquire {
    font-size: 0.82rem;
    padding: 10px 22px;
}

/* Expand button on images */
.detail-image-svg {
    position: relative;
}

.image-expand-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 28px;
    height: 28px;
    padding: 4px;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    cursor: pointer;
    color: var(--gray-500);
    opacity: 0;
    transition: opacity 0.2s, color 0.2s, background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.detail-image-svg:hover .image-expand-btn {
    opacity: 1;
}

.image-expand-btn:hover {
    background: var(--white);
    color: var(--blue-600);
    border-color: var(--blue-400);
}

.image-expand-btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* Lightbox overlay */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    backdrop-filter: blur(4px);
}

.lightbox-open {
    opacity: 1;
    visibility: visible;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 24px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 2.2rem;
    line-height: 1;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: var(--radius);
    transition: color 0.2s, background 0.2s;
}

.lightbox-close:hover {
    color: var(--white);
    background: rgba(255, 255, 255, 0.1);
}

.lightbox-content {
    max-width: 90vw;
    max-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-content img {
    width: 80vw;
    height: 80vh;
    object-fit: contain;
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    image-rendering: auto;
}

/* --- Finishes --- */
.finishes {
    padding: 100px 0;
    background: var(--white);
}

.finishes-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 32px;
}

.finish-card {
    text-align: center;
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    transition: box-shadow 0.3s, border-color 0.2s;
    overflow: hidden;
}

.finish-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--blue-400);
}

.finish-card-active {
    border-color: var(--blue-600);
    box-shadow: var(--shadow-lg);
}

.finish-card-active:hover {
    border-color: var(--blue-600);
}

.finish-card-header {
    width: 100%;
    padding: 30px 20px;
    background: none;
    border: none;
    cursor: pointer;
    text-align: center;
    font-family: inherit;
    font-size: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: background 0.2s;
}

.finish-card-static {
    cursor: default;
}

.finish-card-active .finish-card-header {
    background: var(--blue-50);
}

.finish-card-header:focus-visible {
    outline: 2px solid var(--blue-500);
    outline-offset: -2px;
}

.finish-card-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--blue-600);
    margin-top: 12px;
    transition: gap 0.2s;
}

.finish-card-cta .arrow {
    display: inline-block;
    transition: transform 0.3s;
}

.finish-card-active .finish-card-cta .arrow {
    transform: rotate(180deg);
}

.finish-card:hover .finish-card-cta {
    gap: 10px;
}

.finish-detail-image {
    position: relative;
    display: inline-block;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--gray-200);
}

.finish-detail-image img {
    display: block;
    max-width: 100%;
    height: auto;
}

.finish-detail-image:hover .image-expand-btn {
    opacity: 1;
}

.finish-swatch {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto 20px;
    border: 3px solid var(--white);
    box-shadow: var(--shadow-md);
}

.finish-brass {
    background: linear-gradient(135deg, #d4a017 0%, #b8860b 50%, #cd9b1d 100%);
}

.finish-silver {
    background: linear-gradient(135deg, #e8e8e8 0%, #b0b0b0 50%, #d0d0d0 100%);
}

.finish-copper {
    background: linear-gradient(135deg, #e88a5d 0%, #b87333 50%, #da7f4a 100%);
}

.finish-custom {
    background: conic-gradient(
        #d4a017 0deg,
        #b87333 90deg,
        #b0b0b0 180deg,
        #2a2a2a 270deg,
        #d4a017 360deg
    );
}

.finish-card h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 8px;
}

.finish-card p {
    font-size: 0.88rem;
    color: var(--gray-500);
    line-height: 1.6;
}

.finishes-note {
    text-align: center;
    font-size: 0.85rem;
    color: var(--gray-400);
    font-style: italic;
}

/* --- Machinery --- */
.machinery {
    padding: 100px 0;
    background: var(--blue-900);
    color: var(--white);
}

.machinery-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.machinery h2 {
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
}

.machinery-tagline {
    font-size: 1.05rem;
    color: var(--gold-300);
    font-weight: 600;
    margin-bottom: 20px;
}

.machinery-content p {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.7;
    margin-bottom: 16px;
}

.machinery-details {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin: 32px 0;
}

.machinery-item {
    padding: 20px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: var(--radius);
    border-left: 3px solid var(--blue-400);
}

.machinery-item h3 {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.machinery-item p {
    font-size: 0.88rem !important;
    margin-bottom: 0 !important;
    color: rgba(255, 255, 255, 0.6) !important;
}

.machinery-visual {
    display: flex;
    justify-content: center;
    align-items: center;
}

.machinery-photo {
    width: 100%;
    max-width: 400px;
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

/* --- Contact --- */
.contact {
    padding: 100px 0;
    background: var(--gray-50);
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.contact-card {
    text-align: center;
    padding: 40px 30px;
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    transition: box-shadow 0.3s;
}

.contact-card:hover {
    box-shadow: var(--shadow-md);
}

.contact-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
    color: var(--blue-600);
}

.contact-icon svg {
    width: 100%;
    height: 100%;
}

.contact-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 8px;
}

.contact-card p {
    font-size: 0.95rem;
    color: var(--gray-600);
    line-height: 1.65;
}

.contact-card a {
    color: var(--blue-600);
    font-weight: 500;
}

.contact-card a:hover {
    color: var(--blue-400);
}

/* --- Footer --- */
.footer {
    padding: 60px 0 40px;
    background: var(--gray-900);
    color: rgba(255, 255, 255, 0.6);
}

.footer-inner {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    padding-bottom: 40px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-brand p {
    margin-top: 12px;
    font-size: 0.88rem;
    line-height: 1.6;
    max-width: 320px;
}

.footer-brand .logo-durable {
    color: var(--white);
}

.footer-brand .logo-fasteners {
    color: var(--gray-400);
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.footer-links h4 {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--white);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 8px;
}

.footer-links a {
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.5);
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--white);
}

.footer-copyright {
    grid-column: 1 / -1;
    padding-top: 24px;
    text-align: center;
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.3);
}

/* --- Responsive --- */
@media (max-width: 900px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .finishes-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .machinery-layout {
        grid-template-columns: 1fr;
    }

    .machinery-visual {
        display: none;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .footer-inner {
        grid-template-columns: 1fr 1fr;
    }

    .footer-brand {
        grid-column: 1 / -1;
    }
}

@media (max-width: 640px) {
    .mobile-toggle {
        display: flex;
    }

    .nav {
        display: none;
        position: absolute;
        top: 72px;
        left: 0;
        right: 0;
        background: var(--white);
        flex-direction: column;
        padding: 20px 24px;
        gap: 16px;
        border-bottom: 1px solid var(--gray-200);
        box-shadow: var(--shadow-md);
    }

    .nav-open {
        display: flex;
    }

    .hero {
        padding: 130px 0 70px;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero-sub {
        font-size: 1rem;
    }

    .section-header h2 {
        font-size: 1.75rem;
    }

    .product-grid {
        grid-template-columns: 1fr;
    }

    .detail-panel-inner {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 20px;
    }

    .finishes-grid {
        grid-template-columns: 1fr 1fr;
    }

    .contact-grid {
        grid-template-columns: 1fr;
    }

    .footer-inner {
        grid-template-columns: 1fr;
    }

    .products,
    .finishes,
    .machinery,
    .contact {
        padding: 70px 0;
    }

    .machinery h2 {
        font-size: 1.75rem;
    }
}
