/* ==========================================================================
   Site Footer, Sabit Butonlar & Teklif Modalı (Design System)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Site Footer
   -------------------------------------------------------------------------- */
.site-footer {
    background-color: #111315;
    background-image:
        radial-gradient(ellipse at 0% 100%, rgba(215, 25, 32, 0.045), transparent 50%),
        linear-gradient(135deg, #15181b, #111315 65%);
    color: #94a3b8;
    padding-top: clamp(52px, 6vw, 76px);
    padding-bottom: 28px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    position: relative;
    font-size: 0.9375rem;
    line-height: 1.6;
    z-index: 10;
    isolation: isolate;
}

/* Decorative vector linework stays behind the content and above the credits. */
.site-footer::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 82px;
    height: clamp(160px, 20vw, 280px);
    z-index: -1;
    pointer-events: none;
    background: url('../../images/footer-energy-linework.svg?v=2') center bottom / max(100%, 1200px) auto no-repeat;
    opacity: .19;
}

@media (max-width: 640px) {
    .site-footer::before {
        bottom: 132px;
        height: 180px;
        background-size: 900px auto;
        background-position: left bottom;
        opacity: .14;
    }
}

.site-footer::after {
    content: '';
    position: absolute;
    top: -1px;
    left: 0;
    right: 0;
    height: 1px;
    pointer-events: none;
    background: linear-gradient(90deg, transparent, var(--color-brand-accent, #d71920) 22%, rgba(215, 25, 32, 0.15) 60%, transparent);
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 32px 20px;
    margin-bottom: clamp(36px, 5vw, 60px);
}

.footer-brand {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.footer-col--menu {
    grid-column: 1;
}

.footer-col--services {
    grid-column: 2;
}

.footer-col--projects {
    grid-column: 1;
}

.footer-col--contact {
    grid-column: 2;
}

@media (max-width: 480px) {
    .footer-grid {
        gap: 28px 16px;
    }

    .footer-col-title {
        font-size: 0.95rem;
        margin-bottom: 12px;
    }

    .footer-links a,
    .footer-contact-item {
        font-size: 0.8125rem;
    }

    .footer-contact-item {
        gap: 8px;
    }

    .footer-contact-icon {
        width: 15px;
        height: 15px;
    }
}

@media (min-width: 640px) {
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 40px 32px;
    }

    .footer-brand {
        grid-column: 1 / -1;
    }

    .footer-col--menu {
        grid-column: 1;
    }

    .footer-col--services {
        grid-column: 2;
    }

    .footer-col--projects {
        grid-column: 1;
    }

    .footer-col--contact {
        grid-column: 2;
    }
}

@media (min-width: 1024px) {
    .footer-grid {
        grid-template-columns: 1.5fr 0.9fr 1.15fr 1.15fr 1.35fr;
        gap: 36px;
    }

    .footer-brand,
    .footer-col--menu,
    .footer-col--services,
    .footer-col--projects,
    .footer-col--contact {
        grid-column: auto;
    }
}

.footer-logo {
    display: inline-flex;
    align-items: center;
    margin-bottom: 18px;
    text-decoration: none;
}

.footer-logo-img {
    max-height: 64px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

@media (max-width: 640px) {
    .footer-logo-img {
        max-height: 48px;
        max-width: min(220px, 100%);
    }
}

.footer-logo:hover .footer-logo-img {
    transform: scale(1.02);
}

.footer-logo-text {
    font-size: 1.6rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.02em;
}

.footer-desc {
    color: #94a3b8;
    font-size: 0.875rem;
    line-height: 1.65;
    margin: 0 0 20px 0;
    max-width: 320px;
}

.footer-social {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.footer-social-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    color: #cbd5e1;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.25s ease;
    text-decoration: none;
}

.footer-social-btn:hover {
    background: var(--color-brand-accent, #d71920);
    color: #ffffff;
    border-color: var(--color-brand-accent, #d71920);
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(215, 25, 32, 0.35);
}

.footer-col {
    display: flex;
    flex-direction: column;
}

.footer-col-title {
    color: #ffffff;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    margin: 0 0 20px 0;
    position: relative;
    padding-bottom: 10px;
}

.footer-col-title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 28px;
    height: 2px;
    background: var(--color-brand-accent, #d71920);
    border-radius: 2px;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-links li {
    margin: 0;
    padding: 0;
}

.footer-links a {
    color: #94a3b8;
    font-size: 0.875rem;
    line-height: 1.4;
    display: inline-flex;
    align-items: flex-start;
    gap: 8px;
    text-decoration: none;
    transition: color 0.2s ease, transform 0.2s ease;
}

.footer-link-chevron {
    color: var(--color-brand-accent, #d71920);
    flex-shrink: 0;
    margin-top: 3px;
    transition: transform 0.2s ease;
}

.footer-links a:hover {
    color: #ffffff;
    transform: translateX(4px);
}

.footer-links a:hover .footer-link-chevron {
    transform: translateX(2px);
}

.footer-contact-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.footer-contact-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 0.875rem;
    color: #94a3b8;
}

.footer-contact-icon {
    color: var(--color-brand-accent, #d71920);
    flex-shrink: 0;
    margin-top: 2px;
}

.footer-contact-text {
    color: #cbd5e1;
    line-height: 1.55;
    text-decoration: none;
    font-style: normal;
}

.footer-contact-link {
    transition: color 0.2s ease;
}

.footer-contact-link:hover {
    color: #ffffff;
    text-decoration: underline;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    font-size: 0.8125rem;
    color: #64748b;
}

.footer-copyright {
    color: #94a3b8;
}

.footer-credits {
    color: #64748b;
}

.footer-backlink {
    color: #e2e8f0;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.2s ease;
}

.footer-backlink:hover {
    color: var(--color-brand-accent, #d71920);
}

@media (max-width: 640px) {
    .footer-bottom {
        flex-direction: column;
        text-align: center;
        justify-content: center;
        gap: 10px;
    }
}

/* --------------------------------------------------------------------------
   2. Sayfa Başına Dön (Back to Top) Butonu
   -------------------------------------------------------------------------- */
.back-to-top {
    position: fixed;
    z-index: 950;
    right: 26px;
    bottom: 26px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--color-brand-primary, #b5121b);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28), 0 4px 12px rgba(181, 18, 27, 0.3);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(18px) scale(0.92);
    transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1),
        visibility 0.35s ease,
        transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
        background-color 0.2s ease,
        box-shadow 0.2s ease;
    will-change: transform, opacity;
    -webkit-tap-highlight-color: transparent;
    outline: none;
}

.back-to-top svg {
    display: block;
    width: 22px;
    height: 22px;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.back-to-top.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.back-to-top.is-footer-hidden {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transform: translateY(24px) scale(0.85) !important;
}

.back-to-top:hover {
    background: var(--color-brand-hover, #d71920);
    transform: translateY(-4px) scale(1.06);
    box-shadow: 0 14px 35px rgba(0, 0, 0, 0.38), 0 6px 16px rgba(215, 25, 32, 0.45);
}

.back-to-top:hover svg {
    transform: translateY(-2px);
}

.back-to-top:focus-visible {
    outline: 3px solid var(--color-brand-accent, #d71920);
    outline-offset: 3px;
}

@media (max-width: 576px) {
    .back-to-top {
        right: 18px;
        bottom: 18px;
        width: 48px;
        height: 48px;
    }

    .back-to-top svg {
        width: 20px;
        height: 20px;
    }
}

/* --------------------------------------------------------------------------
   3. Teklif Modalı (#quote-modal) & Form Stilleri
   -------------------------------------------------------------------------- */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background-color: rgba(10, 12, 15, 0.82);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1300;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s ease;
}

.modal-backdrop.is-active {
    opacity: 1;
    visibility: visible;
}

.site-modal {
    background-color: #15181b;
    background-image:
        radial-gradient(circle at 85% 15%, rgba(181, 18, 27, 0.08) 0%, transparent 45%),
        linear-gradient(180deg, #171a1e 0%, #121417 100%);
    color: #e2e8f0;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    position: relative;
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.04);
    max-width: 580px;
    width: 100%;
    max-height: 92vh;
    overflow-y: auto;
    padding: clamp(24px, 4vw, 36px);
    opacity: 0;
    transform: scale(0.95);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-backdrop.is-active .site-modal {
    opacity: 1;
    transform: scale(1);
}

.modal-close-btn,
.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-close-btn:hover {
    background: var(--color-brand-accent, #d71920);
    color: #ffffff;
    border-color: var(--color-brand-accent, #d71920);
    transform: rotate(90deg);
}

.site-modal .form-control {
    background-color: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border-radius: 8px;
}

.site-modal .form-control:focus {
    border-color: var(--color-brand-accent, #d71920);
    background-color: rgba(255, 255, 255, 0.07);
    box-shadow: 0 0 0 3px rgba(215, 25, 32, 0.25);
}

.site-modal .form-select option {
    background-color: #1a1d22;
    color: #ffffff;
}

.sticky-quote-button {
    position: fixed;
    right: 0;
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
    transform-origin: right center;
    z-index: 900;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    white-space: nowrap;
    gap: 9px;
    min-width: 48px;
    min-height: 120px;
    padding: 18px 13px;
    border: 0;
    border-radius: 8px 0 0 8px;
    background: var(--color-brand-primary);
    color: #fff;
    font: 700 .9rem var(--font-body, Arial, sans-serif);
    box-shadow: 0 5px 20px rgba(0, 0, 0, .18);
    cursor: pointer;
    transition: background-color .2s ease, transform .18s ease, opacity .18s ease, visibility .18s ease;
}

.sticky-quote-button svg { flex-shrink: 0; transform: rotate(90deg); }
.sticky-quote-button.is-footer-hidden { opacity: 0; visibility: hidden; pointer-events: none; }
html.scroll-locked, body.scroll-locked { overflow: hidden !important; overscroll-behavior: none; }
body.nav-open .sticky-quote-button, body.scroll-locked .sticky-quote-button { visibility: hidden; }
.sticky-quote-button:focus-visible { outline: 3px solid var(--color-ink); outline-offset: 3px; }

#quote-modal .site-modal {
    max-width: 620px;
    max-height: calc(100dvh - 40px);
    background: #fff;
    color: var(--color-ink);
    overscroll-behavior: contain;
    transition: opacity .2s ease, transform .2s cubic-bezier(.23, 1, .32, 1);
}

#quote-modal .modal-header { padding-right: 30px; margin-bottom: 24px; }
#quote-modal .modal-badge { color: var(--color-brand-primary); font-size: .75rem; font-weight: 700; }
#quote-modal .modal-title { margin: 8px 0 12px; font-size: clamp(1.65rem, 4vw, 2.2rem); line-height: 1.15; }
#quote-modal .modal-desc { margin: 0; color: #585c61; font-size: .9rem; line-height: 1.65; }
#quote-modal .modal-close { width: 44px; height: 44px; top: 16px; right: 16px; background: #f1f3f5; color: #292b30; border-color: #e5e7eb; }
#quote-modal .form-control { background-color: #fff; border-color: #cbd5e1; color: #0f172a; font-size: 1rem; }
#quote-modal .form-select option { background: #fff; color: #0f172a; }
#quote-modal .form-actions { margin-top: 20px; }
#quote-modal .form-privacy-note { margin: 14px 0 0; font-size: .75rem; color: #585c61; }
#quote-modal .form-result { margin-top: 16px; padding: 12px; border-radius: 6px; }
#quote-modal .form-result.is-success { background: #edf8f0; color: #176438; }
#quote-modal .form-result.is-error { background: #fff0f0; color: #a1121b; }

@media (hover: hover) and (pointer: fine) {
    .sticky-quote-button:hover { background: #9f1118; transform: translateY(-50%) scale(1.05); }
}

@media (max-width: 600px) {
    .sticky-quote-button { right: 0; min-width: 44px; min-height: 110px; padding: 15px 11px; font-size: .8rem; }
    #quote-modal { padding: 12px; }
    #quote-modal .site-modal { max-height: calc(100dvh - 24px); padding: 24px 20px; }
}

@media (prefers-reduced-motion: reduce) {
    #quote-modal, #quote-modal .site-modal { transition: none; }
    .sticky-quote-button { transition: background-color .2s ease; }
    .sticky-quote-button:hover { transform: translateY(-50%); }
}
