/*
 * =============================================================================
 *  OTXAD MARKETPLACE — BANNER AD STANDARDS
 *  File: public/css/banner-ad.css
 *
 *  This is the SINGLE SOURCE OF TRUTH for all advertisement banner styling.
 *  All banner containers, images, sidebars, and placeholders are defined here.
 *
 *  Banner Zones:
 *  ① Header Banner          (.ad-page-banner-header)
 *  ② Hero Banner (Homepage) (.homepage-hero-banner)
 *  ③ Footer Banner          (.footer-banner-global)
 *  ④ Content Footer Banner  (.content-footer-banner)
 *  ⑤ Category Sidebar       (.category-sidebar-banner)
 *  ⑥ Detail Page Sidebar    (.detail-sidebar-banner)
 * =============================================================================
 */

/* =============================================================================
   SHARED BANNER VARIABLES
   ============================================================================= */
:root {
    --banner-max-width: 1000px;
    --banner-sidebar-width: 300px;
    --banner-label-color: #94a3b8;
    --banner-border: 1px solid #e2e8f0;
    --banner-placeholder-bg: #f8fafc;
    --banner-placeholder-dashed: #e2e8f0;
}


/* =============================================================================
   ① HEADER BANNER
   Displayed at the top of all internal pages (ad-detail, category, etc.)
   Spacing: 0 top (flush to header); 15px bottom gap before content.
   Container: 1000px max-width, no horizontal padding.
   ============================================================================= */
.ad-page-banner-header {
    margin-top: 0;
    margin-bottom: 15px;
    padding: 5px 0;
    display: flex;
    justify-content: center;
    width: 100%;
    background: transparent;
}

.ad-page-banner-header .container {
    max-width: var(--banner-max-width);
    padding-left: 0 !important;
    padding-right: 0 !important;
    width: 100%;
}

/* Force all injected banner content (ad_code HTML) to stretch full width */
.ad-page-banner-header .banner-wrapper,
.ad-page-banner-header .banner-wrapper > *,
.ad-page-banner-header .banner-wrapper a,
.ad-page-banner-header .banner-wrapper picture {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
}

.ad-page-banner-header .banner-wrapper img {
    width: 100% !important;
    max-width: var(--banner-max-width) !important;
    height: auto !important;
    display: block !important;
}

.ad-page-banner-header img {
    width: 100% !important;
    max-width: var(--banner-max-width);
    height: auto;
    display: block;
    border-radius: 0 !important;
    box-shadow: none;
}


/* =============================================================================
   ② HERO BANNER (Homepage)
   Displayed on the homepage between the blue hero section and the categories.
   Spacing: 5px top/bottom padding; transparent background.
   Container: 1000px max-width, no horizontal padding.
   ============================================================================= */
.homepage-hero-banner {
    margin-top: 0;
    margin-bottom: 0;
    padding: 5px 0;
    display: flex;
    justify-content: center;
    width: 100%;
    background: #ffffff;
}

.homepage-hero-banner .container {
    max-width: var(--banner-max-width);
    padding-left: 0 !important;
    padding-right: 0 !important;
    width: 100%;
}

.homepage-hero-banner-inner {
    max-width: var(--banner-max-width);
    margin: 0 auto;
    text-align: center;
    width: 100%;
}

.homepage-hero-banner-inner a,
.homepage-hero-banner .banner-wrapper a,
.homepage-hero-banner .banner-wrapper > *,
.homepage-hero-banner .banner-wrapper picture {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
}

.homepage-hero-banner img,
.homepage-hero-banner-inner img {
    width: 100% !important;
    max-width: var(--banner-max-width) !important;
    height: auto;
    display: block;
    border-radius: 0 !important;
    box-shadow: none;
    border: none;
}


/* =============================================================================
   ③ FOOTER BANNER (Global)
   Displayed site-wide just above the footer.
   Spacing: 5px top/bottom padding; transparent background (no white bar).
   Container: 1000px max-width, no horizontal padding.
   ============================================================================= */
.footer-banner-global {
    margin-top: 0;
    margin-bottom: 0;
    padding: 5px 0;
    display: flex;
    justify-content: center;
    width: 100%;
    background: transparent;
    border: none;
}

/* Homepage only: white background for footer banner */
body.page-home .footer-banner-global {
    background: #ffffff;
}

.footer-banner-global .container {
    max-width: var(--banner-max-width);
    padding-left: 0 !important;
    padding-right: 0 !important;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.footer-banner-global .banner-wrapper,
.footer-banner-global .banner-wrapper > *,
.footer-banner-global .banner-wrapper a,
.footer-banner-global .banner-wrapper picture,
.footer-banner-global .banner-code-wrap {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
}

.footer-banner-global img {
    width: 100% !important;
    max-width: var(--banner-max-width) !important;
    height: auto;
    display: block;
    border-radius: 0 !important;
    box-shadow: none;
}


/* =============================================================================
   ④ CONTENT FOOTER BANNER
   An inline banner that appears at the bottom of a content area (inside a page).
   Used for banners embedded inside article/listing bodies, not the global footer.
   ============================================================================= */
.content-footer-banner {
    margin-top: 24px;
    margin-bottom: 0;
    width: 100%;
    display: flex;
    justify-content: center;
}

.content-footer-banner .ad-box-banner {
    width: 100%;
    max-width: var(--banner-max-width);
}

.content-footer-banner img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 0;
    box-shadow: none;
}


/* =============================================================================
   ⑤ CATEGORY SIDEBAR BANNER
   Appears in the right sidebar of category/search listing pages.
   Position: sticky; width: 300px max.
   ============================================================================= */
.category-right-sidebar {
    height: fit-content;
    position: sticky;
    top: 90px;
    align-self: start;
}

.sticky-sidebar-wrapper {
    position: sticky;
    top: 90px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.category-sidebar-banner {
    width: 100%;
    max-width: var(--banner-sidebar-width);
    background: white;
    border: var(--banner-border);
    border-radius: 0;
    box-shadow: none;
    overflow: hidden;
}

.category-sidebar-banner .banner-label {
    font-size: 10px;
    color: var(--banner-label-color);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 8px;
    text-align: center;
    font-weight: 600;
    padding: 8px 8px 0;
}

.category-sidebar-banner .banner-content {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 8px;
}

.category-sidebar-banner img {
    width: 100%;
    max-width: var(--banner-sidebar-width);
    height: auto;
    display: block;
    border-radius: 0;
    box-shadow: none;
}

/* Fallback / Empty State */
.category-sidebar-banner .banner-placeholder,
.ad-sidebar-banner .banner-placeholder {
    width: 100%;
    height: 250px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--banner-placeholder-bg);
    border: 2px dashed var(--banner-placeholder-dashed);
    border-radius: 0;
    color: #cbd5e1;
    text-align: center;
    text-decoration: none;
    transition: background 0.2s, border-color 0.2s;
}

.category-sidebar-banner .banner-placeholder:hover,
.ad-sidebar-banner .banner-placeholder:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.category-sidebar-banner .banner-placeholder i,
.ad-sidebar-banner .banner-placeholder i {
    font-size: 28px;
    margin-bottom: 10px;
}

.category-sidebar-banner .banner-placeholder span,
.ad-sidebar-banner .banner-placeholder span {
    display: block;
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
}

.category-sidebar-banner .banner-placeholder small,
.ad-sidebar-banner .banner-placeholder small {
    display: block;
    font-size: 11px;
    margin-top: 4px;
}


/* =============================================================================
   ⑥ DETAIL PAGE SIDEBAR BANNER
   Appears in the right sidebar of the Ad Detail page.
   Uses a column layout to stack multiple ad boxes.
   Width: fills the sidebar column (typically 280–300px).
   ============================================================================= */
.detail-sidebar-banner,
.ad-banner-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
}

.ad-box-banner {
    background: white;
    border: var(--banner-border);
    border-radius: 0;
    box-shadow: none;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.ad-box-banner .banner-label {
    font-size: 10px;
    color: var(--banner-label-color);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 12px;
    text-align: center;
    font-weight: 600;
    padding: 12px 16px 0;
}

.ad-box-banner .banner-content {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 0 16px 16px;
}

.ad-box-banner img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 0;
    box-shadow: none;
}

/* Shared placeholder for detail sidebar */
.banner-placeholder {
    width: 100%;
    height: 250px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--banner-placeholder-bg);
    border: 2px dashed var(--banner-placeholder-dashed);
    border-radius: 0;
    color: #cbd5e1;
    text-align: center;
    text-decoration: none;
    transition: background 0.2s, border-color 0.2s;
}

.banner-placeholder:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.banner-placeholder i {
    font-size: 32px;
    margin-bottom: 12px;
}

.banner-placeholder span {
    display: block;
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
}

.banner-placeholder small {
    display: block;
    font-size: 11px;
    margin-top: 4px;
}


/* =============================================================================
   FALLBACK BANNERS (Legacy / Admin Fallbacks)
   ============================================================================= */
.fallback-banner {
    color: #fff;
    padding: 40px 20px;
    text-align: center;
    font-size: 32px;
    font-weight: 700;
    text-transform: uppercase;
    border-radius: 0;
}

.header-fallback {
    background: #005EB8;
    font-size: 28px;
}

.footer-fallback {
    background: #149777;
    font-size: 28px;
}


/* =============================================================================
   RESPONSIVE — MOBILE (≤768px)
   ============================================================================= */
@media (max-width: 768px) {

    /* Header banner */
    .ad-page-banner-header {
        margin-top: 10px;
    }

    .ad-page-banner-header .container,
    .homepage-hero-banner .container,
    .footer-banner-global .container {
        padding-left: 8px;
        padding-right: 8px;
    }

    /* Hero banner */
    .homepage-hero-banner .homepage-hero-banner-inner,
    .homepage-hero-banner a,
    .homepage-hero-banner picture,
    .footer-banner-global .banner-wrapper,
    .footer-banner-global .banner-code-wrap,
    .footer-banner-global a,
    .footer-banner-global picture {
        display: block !important;
        width: 100%;
    }

    .homepage-hero-banner img,
    .footer-banner-global img,
    .ad-page-banner-header img {
        width: 100%;
        max-width: 100%;
    }

    /* Hide sidebars on mobile */
    .category-right-sidebar,
    .category-sidebar-banner,
    .detail-sidebar-banner,
    .ad-banner-column {
        display: none;
    }
}

/* =============================================================================
   RESPONSIVE — TABLET (≤1024px)
   ============================================================================= */
@media (max-width: 1024px) {
    .category-right-sidebar {
        display: none;
    }
}
