/*
Theme Name: FusionDeals Theme
Theme URI: https://fusiondeals.shop
Author: FusionDeals
Description: Full-featured DealsFinder style affiliate deals theme with rounded brand icon, sticky last sidebar widget, Page Templates, and Customizer controls.
Version: 3.9
Text Domain: fusiondeals
*/

:root {
    --fd-bg: #f6f4ef;
    --fd-header-bg: #14171a;
    --fd-header-text: #ffffff;
    --fd-footer-bg: #efece6;
    --fd-footer-text: #4b5563;
    --fd-primary: #1d63dc;
    --fd-text: #111827;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    background-color: var(--fd-bg);
    color: var(--fd-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.6;
}

/* Top Affiliate Disclosure Bar */
.fd-top-notice {
    background: #0d0f11;
    color: #9ca3af;
    font-size: 12px;
    text-align: center;
    padding: 6px 12px;
    border-bottom: 1px solid #22262a;
}

/* Main Header */
.fd-header {
    background: var(--fd-header-bg);
    color: var(--fd-header-text);
    padding: 14px 20px;
    z-index: 999;
    box-shadow: 0 2px 10px rgba(0,0,0,0.12);
}
.fd-header.is-sticky {
    position: sticky;
    top: 0;
}
.fd-header-inner {
    max-width: 1240px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}
.fd-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--fd-header-text);
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.5px;
}
.fd-logo img.fd-custom-logo-full {
    max-height: 38px;
    width: auto;
    border-radius: 8px;
}
.fd-brand-icon {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    object-fit: cover;
    background: #ffffff;
    padding: 2px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
.fd-nav {
    display: flex;
    align-items: center;
    gap: 18px;
    list-style: none;
    margin: 0;
    padding: 0;
}
.fd-nav a {
    color: var(--fd-header-text);
    opacity: 0.9;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
}
.fd-nav a:hover { opacity: 1; }
.fd-nav-cta {
    background: var(--fd-primary);
    color: #fff !important;
    opacity: 1 !important;
    padding: 8px 15px;
    border-radius: 8px;
}

/* Mobile Menu Button */
.fd-mobile-btn {
    display: none;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.25);
    color: var(--fd-header-text);
    padding: 6px 10px;
    border-radius: 7px;
    font-size: 16px;
    cursor: pointer;
}

/* Hero Search Section */
.fd-hero {
    text-align: center;
    padding: 38px 16px 20px;
    max-width: 780px;
    margin: 0 auto;
}
.fd-live-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fff;
    border: 1px solid #e5e2dc;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 14px;
}
.fd-live-dot {
    width: 8px;
    height: 8px;
    background: #16a34a;
    border-radius: 50%;
}
.fd-hero h1 {
    font-size: 36px;
    font-weight: 800;
    margin: 0 0 8px;
    letter-spacing: -0.8px;
    color: #111827;
}
.fd-hero p {
    font-size: 16px;
    color: #4b5563;
    margin: 0 0 22px;
}
.fd-search-box {
    display: flex;
    background: #fff;
    padding: 6px;
    border-radius: 14px;
    border: 1px solid #e2dfd7;
    box-shadow: 0 4px 15px rgba(0,0,0,0.04);
}
.fd-search-box input {
    flex: 1;
    border: none;
    padding: 10px 14px;
    font-size: 15px;
    outline: none;
    background: transparent;
}
.fd-search-box button {
    background: var(--fd-primary);
    color: #fff;
    border: none;
    padding: 10px 22px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
}

/* Main Content + Sidebar Layout */
.fd-main-container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 10px 15px;
}
.fd-has-sidebar {
    display: grid;
    grid-template-columns: 1fr 310px;
    gap: 24px;
    align-items: stretch;
}
.fd-has-sidebar.sidebar-left {
    grid-template-columns: 310px 1fr;
}
.fd-has-sidebar.sidebar-left .fd-sidebar {
    order: -1;
}
.fd-has-sidebar .fd-grid {
    grid-template-columns: repeat(2, 1fr) !important;
}
.fd-sidebar {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-top: 15px;
}
/* Sticky Last Widget in Sidebar */
.fd-sidebar > .fd-widget-box:last-child {
    position: sticky;
    top: 84px;
    z-index: 10;
}
.fd-widget-box {
    background: #fff;
    border: 1px solid #eae6df;
    border-radius: 16px;
    padding: 18px;
}
.fd-widget-box h3 {
    margin: 0 0 10px;
    font-size: 16px;
    font-weight: 800;
    color: #111827;
}
.fd-widget-box p {
    margin: 0 0 14px;
    font-size: 13px;
    color: #4b5563;
}
.fd-widget-btn {
    display: block;
    text-align: center;
    background: #111827;
    color: #fff !important;
    text-decoration: none;
    font-weight: 700;
    font-size: 13px;
    padding: 10px 14px;
    border-radius: 10px;
    margin-bottom: 8px;
}
.fd-widget-btn.tg { background: #0088cc; }
.fd-widget-btn.wa { background: #16a34a; }

/* Standard Page & Single Post Styling (Privacy Policy, Contact, About, etc.) */
.fd-page-wrap {
    max-width: 860px;
    margin: 35px auto;
    padding: 0 15px;
}
.fd-page-card {
    background: #fff;
    border: 1px solid #eae6df;
    border-radius: 18px;
    padding: 32px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
}
.fd-page-card h1 {
    font-size: 28px;
    font-weight: 800;
    margin: 0 0 18px;
    color: #111827;
    border-bottom: 1px solid #f0ede6;
    padding-bottom: 14px;
}
.fd-page-content {
    font-size: 15px;
    color: #374151;
}
.fd-page-content h2, .fd-page-content h3 {
    color: #111827;
    margin-top: 24px;
}

/* Footer */
.fd-footer {
    background: var(--fd-footer-bg);
    color: var(--fd-footer-text);
    border-top: 1px solid #dcd8cf;
    margin-top: 50px;
    padding: 42px 20px 24px;
    font-size: 14px;
}
.fd-footer-inner {
    max-width: 1240px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.6fr 1fr 1fr 1fr;
    gap: 28px;
    padding-bottom: 26px;
    border-bottom: 1px solid rgba(0,0,0,0.08);
}
.fd-footer h4 {
    color: #111827;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 12px;
}
.fd-footer ul { list-style: none; padding: 0; margin: 0; }
.fd-footer li { margin-bottom: 8px; }
.fd-footer a { color: var(--fd-footer-text); text-decoration: none; }
.fd-footer a:hover { color: #111827; text-decoration: underline; }
.fd-footer-bottom {
    max-width: 1240px;
    margin: 18px auto 0;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 12px;
    opacity: 0.85;
}

@media (min-width: 769px) and (max-width: 1024px) {
    .fd-has-sidebar, .fd-has-sidebar.sidebar-left {
        grid-template-columns: 1fr;
    }
    .fd-grid,
    .fd-has-sidebar .fd-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 16px;
    }
    .fd-grid.fd-list-view,
    .fd-has-sidebar .fd-grid.fd-list-view {
        grid-template-columns: minmax(0, 1fr) !important;
    }
    .fd-sidebar > .fd-widget-box:last-child {
        position: static;
    }
}

@media (max-width: 900px) {
    .fd-has-sidebar, .fd-has-sidebar.sidebar-left {
        grid-template-columns: 1fr;
    }
    .fd-sidebar > .fd-widget-box:last-child {
        position: static;
    }
    .fd-footer-inner {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .fd-grid,
    .fd-has-sidebar .fd-grid {
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 14px;
    }
    .fd-has-sidebar.fd-mobile-sidebar-top .fd-sidebar {
        order: -1;
        margin-top: 0;
        margin-bottom: 14px;
    }
    #fdGrid > .fd-sidebar.is-in-feed {
        grid-column: 1 / -1;
        width: 100%;
        margin: 4px 0;
    }
}

@media (max-width: 768px) {
    .fd-hero h1 { font-size: 26px; }
    .fd-mobile-btn { display: inline-block; }
    .fd-nav {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--fd-header-bg);
        padding: 16px 20px;
        border-top: 1px solid rgba(255,255,255,0.1);
    }
    .fd-nav.open { display: flex; }
    .fd-footer-inner { grid-template-columns: 1fr; gap: 20px; }
    .fd-page-card { padding: 20px; }
}


/* Bottom Affiliate Disclosure Bar & Device Visibility Helpers */
.fd-bottom-notice {
    background: #e5e1d8;
    color: #374151;
    font-size: 12px;
    text-align: center;
    padding: 10px 14px;
    border-top: 1px solid #d6d1c7;
    margin-top: 40px;
}
.fd-bottom-notice + .fd-footer {
    margin-top: 0;
}
@media (min-width: 769px) {
    .hide-on-desktop { display: none !important; }
}
@media (max-width: 768px) {
    .hide-on-mobile { display: none !important; }
}

/* Standard WordPress Widgets Styling inside Deals Sidebar */
.fd-widget-box ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.fd-widget-box li {
    padding: 6px 0;
    border-bottom: 1px solid #f3f1ec;
    font-size: 13px;
}
.fd-widget-box li:last-child {
    border-bottom: none;
}
.fd-widget-box li a {
    color: #1f2937;
    text-decoration: none;
    font-weight: 500;
}
.fd-widget-box li a:hover {
    color: var(--fd-primary);
}
.fd-widget-box .wp-block-search__inside-wrapper {
    display: flex;
    gap: 6px;
}
.fd-widget-box input[type="search"],
.fd-widget-box input[type="text"] {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #dcd8cf;
    border-radius: 8px;
    font-size: 13px;
}
.fd-widget-box button[type="submit"],
.fd-widget-box .wp-block-search__button {
    background: var(--fd-primary);
    color: #fff;
    border: none;
    padding: 8px 14px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}
