/*
 * Theme Name:   Boule d'Occase Premium
 * Theme URI:    https://bouledoccase.fr
 * Description:  Child theme premium pour la marketplace de boules de pétanque d'occasion. Basé sur Astra.
 * Author:       Espritz
 * Author URI:   https://espritz.fr
 * Template:     astra
 * Version:      1.0.0
 * License:      GPL-2.0-or-later
 * Text Domain:  bdo-premium
 */

/* ==========================================================================
   0. IMPORTS & CSS VARIABLES
   ========================================================================== */

/* [BDO] Google Fonts loaded via wp_enqueue_style in functions.php */
:root {
    --bg-main: #F8F9FA;
    --text-dark: #111827;
    --accent: #E65100;
    --accent-hover: #BF360C;
    --gray-500: #6B7280;
    --gray-200: #E2E8F0;
    --white: #FFFFFF;
    --radius: 16px;
    --radius-pill: 60px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
    --shadow-hover: 0 12px 40px rgba(0, 0, 0, 0.15);
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font-heading: 'Plus Jakarta Sans', sans-serif;
    --font-body: 'Inter', sans-serif;
}

/* ==========================================================================
   1. BODY RESET
   ========================================================================== */

body,
html {
    font-family: var(--font-body);
    background-color: var(--bg-main);
    color: var(--text-dark);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
}

/* ==========================================================================
   2. GLASSMORPHISM STICKY HEADER
   ========================================================================== */

.site-header {
    position: sticky;
    top: 16px;
    z-index: 999;
    background: transparent !important;
    border-bottom: none !important;
    padding: 0 20px;
}

.site-header .ast-container {
    max-width: 1100px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius-pill);
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: var(--shadow-sm);
    padding: 8px 32px;
    transition: box-shadow var(--transition);
}

.site-header .ast-container:hover {
    box-shadow: var(--shadow-md);
}

/* Fix Astra header wrapper background */
.site-primary-header-wrap,
.ast-primary-header-bar,
.site-primary-header-wrap .ast-builder-grid-row {
    background: transparent !important;
}

/* Navigation links in header */
.site-header .main-navigation a,
.site-header .ast-header-link a {
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 14px;
    color: var(--text-dark);
    transition: color var(--transition);
}

.site-header .main-navigation a:hover {
    color: var(--accent);
}

/* ==========================================================================
   3. LOGO SVG REPLACEMENT
   ========================================================================== */

/* Hide the uploaded custom logo image */
.custom-logo-link .custom-logo {
    display: none !important;
}

/* SVG logo via pseudo-element: two overlapping circles */
.custom-logo-link::before {
    content: '';
    display: block;
    width: 36px;
    height: 36px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Ccircle cx='15' cy='20' r='12' fill='%23111827'/%3E%3Ccircle cx='25' cy='20' r='12' fill='%23E65100' opacity='0.9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: contain;
    margin-right: 10px;
    flex-shrink: 0;
}

.custom-logo-link {
    display: flex !important;
    align-items: center;
}

/* Site title reformatted */
.site-branding {
    display: flex;
    flex-direction: column;
    line-height: 1;
}

.site-title {
    font-family: var(--font-heading) !important;
    font-weight: 800 !important;
    font-size: 18px !important;
    color: var(--text-dark) !important;
    line-height: 1.1 !important;
    margin: 0 !important;
}

.site-title a {
    color: inherit !important;
    text-decoration: none !important;
}

/* Tagline as "D'OCCASE." */
.site-description {
    font-family: var(--font-heading) !important;
    font-weight: 600 !important;
    font-size: 10px !important;
    color: var(--gray-500) !important;
    text-transform: uppercase !important;
    letter-spacing: 1.5px !important;
    margin: 0 !important;
    line-height: 1.2 !important;
}

/* ==========================================================================
   4. HERO SECTION (Elementor)
   ========================================================================== */

.bdo-hero-section,
.elementor-section.bdo-hero {
    padding: 100px 0 80px;
    text-align: center;
}

.bdo-hero-section h1,
.elementor-section.bdo-hero h1,
.elementor-widget-heading .bdo-gradient-title {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: clamp(2.5rem, 5vw, 4rem);
    line-height: 1.1;
    max-width: 800px;
    margin: 0 auto;
    background: linear-gradient(135deg, var(--text-dark) 0%, var(--accent) 50%, var(--accent-hover) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.bdo-hero-section p,
.elementor-section.bdo-hero p {
    font-size: 18px;
    color: var(--gray-500);
    max-width: 600px;
    margin: 20px auto 0;
    line-height: 1.7;
}

/* ==========================================================================
   5. WOOCOMMERCE PRODUCT CARDS
   ========================================================================== */

/* Product card container */
ul.products li.product,
.woocommerce ul.products li.product {
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--white);
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(0, 0, 0, 0.04);
    transition: transform var(--transition), box-shadow var(--transition);
    padding: 0;
    margin-bottom: 24px;
}

ul.products li.product:hover,
.woocommerce ul.products li.product:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-hover);
}

/* Product image */
ul.products li.product .woocommerce-LoopProduct-link img,
.woocommerce ul.products li.product a img {
    border-radius: 0;
    transition: transform 0.5s ease;
}

ul.products li.product:hover .woocommerce-LoopProduct-link img,
.woocommerce ul.products li.product:hover a img {
    transform: scale(1.05);
}

/* Product image wrapper */
ul.products li.product .astra-shop-thumbnail-wrap,
ul.products li.product .woocommerce-LoopProduct-link {
    overflow: hidden;
    border-radius: var(--radius) var(--radius) 0 0;
}

/* Product title */
ul.products li.product .woocommerce-loop-product__title,
.woocommerce ul.products li.product .woocommerce-loop-product__title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 15px;
    color: var(--text-dark);
    padding: 14px 16px 4px;
    margin: 0;
}

/* Product price */
ul.products li.product .price,
.woocommerce ul.products li.product .price {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 20px;
    color: var(--accent) !important;
    padding: 0 16px 14px;
}

ul.products li.product .price del {
    font-size: 14px;
    color: var(--gray-500) !important;
    font-weight: 500;
    opacity: 0.7;
}

ul.products li.product .price ins {
    text-decoration: none;
    color: var(--accent) !important;
}

/* Add to cart button on product cards */
ul.products li.product .button,
.woocommerce ul.products li.product .button {
    background: var(--accent);
    color: var(--white) !important;
    border: none;
    border-radius: var(--radius-pill);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 13px;
    padding: 10px 20px;
    margin: 0 16px 16px;
    transition: background var(--transition), transform var(--transition);
    text-transform: none;
}

ul.products li.product .button:hover {
    background: var(--accent-hover);
    transform: scale(1.02);
}

/* Custom petanque attribute tags on product cards */
.bdo-product-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 16px 10px;
}

.bdo-product-tags .bdo-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: var(--font-body);
    font-size: 11px;
    font-weight: 500;
    color: var(--gray-500);
    background: var(--bg-main);
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid var(--gray-200);
}

.bdo-product-tags .bdo-tag .bdo-tag-icon {
    font-size: 12px;
}

/* ==========================================================================
   6. CTA BUTTONS (Elementor)
   ========================================================================== */

.elementor-button,
.elementor-widget-button .elementor-button {
    background-color: var(--accent) !important;
    color: var(--white) !important;
    border: none !important;
    border-radius: var(--radius-pill) !important;
    font-family: var(--font-heading) !important;
    font-weight: 700 !important;
    font-size: 15px !important;
    padding: 16px 36px !important;
    transition: background-color var(--transition), transform var(--transition), box-shadow var(--transition) !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
}

.elementor-button:hover,
.elementor-widget-button .elementor-button:hover {
    background-color: var(--accent-hover) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 24px rgba(230, 81, 0, 0.3) !important;
}

/* Secondary / outline button variant */
.elementor-button.bdo-btn-outline {
    background-color: transparent !important;
    color: var(--text-dark) !important;
    border: 2px solid var(--gray-200) !important;
}

.elementor-button.bdo-btn-outline:hover {
    border-color: var(--accent) !important;
    color: var(--accent) !important;
    background-color: rgba(230, 81, 0, 0.04) !important;
    box-shadow: none !important;
}

/* ==========================================================================
   7. ICON BOXES (Elementor)
   ========================================================================== */

.elementor-widget-icon-box .elementor-icon-box-wrapper,
.elementor-widget-icon-box {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 28px 24px;
    transition: box-shadow var(--transition), transform var(--transition);
    background: var(--white);
}

.elementor-widget-icon-box:hover .elementor-icon-box-wrapper,
.elementor-widget-icon-box:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-4px);
}

.elementor-widget-icon-box .elementor-icon-box-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 16px;
    color: var(--text-dark);
}

.elementor-widget-icon-box .elementor-icon-box-description {
    font-size: 14px;
    color: var(--gray-500);
    line-height: 1.7;
}

.elementor-widget-icon-box .elementor-icon {
    color: var(--accent) !important;
}

/* ==========================================================================
   8. FOOTER
   ========================================================================== */

.site-footer,
footer.site-footer {
    background-color: var(--text-dark) !important;
    color: var(--white) !important;
}

.site-footer a,
.site-footer .ast-footer-copyright a,
.site-footer .widget a {
    color: rgba(255, 255, 255, 0.7) !important;
    transition: color var(--transition);
}

.site-footer a:hover,
.site-footer .widget a:hover {
    color: var(--accent) !important;
}

.site-footer h1,
.site-footer h2,
.site-footer h3,
.site-footer h4,
.site-footer .widget-title {
    color: var(--white) !important;
    font-family: var(--font-heading);
}

.site-footer p,
.site-footer .widget {
    color: rgba(255, 255, 255, 0.6) !important;
}

.ast-footer-copyright {
    border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
}

/* ==========================================================================
   9. WOOCOMMERCE SINGLE PRODUCT
   ========================================================================== */

.single-product .summary .product_title {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 28px;
    color: var(--text-dark);
}

.single-product .summary .price {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 26px;
    color: var(--accent) !important;
}

.single-product .single_add_to_cart_button {
    background: var(--accent) !important;
    color: var(--white) !important;
    border-radius: var(--radius-pill) !important;
    font-family: var(--font-heading) !important;
    font-weight: 700 !important;
    padding: 14px 32px !important;
    transition: background var(--transition), transform var(--transition) !important;
}

.single-product .single_add_to_cart_button:hover {
    background: var(--accent-hover) !important;
    transform: translateY(-2px) !important;
}

/* ==========================================================================
   10. CUSTOM SCROLLBAR
   ========================================================================== */

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-main);
}

::-webkit-scrollbar-thumb {
    background: #CBD5E1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-500);
}

/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: #CBD5E1 var(--bg-main);
}

/* ==========================================================================
   11. ADSENSE NATIVE AD CARD (Plugin Integration)
   ========================================================================== */

.bdo-ad-card {
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--white);
    border: 1px solid var(--gray-200);
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 280px;
    position: relative;
}

.bdo-ad-card::after {
    content: 'Annonce';
    position: absolute;
    top: 8px;
    right: 10px;
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-500);
    opacity: 0.6;
}

/* ==========================================================================
   12. BOOSTED PRODUCT BADGE
   ========================================================================== */

.bdo-boosted-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: linear-gradient(135deg, var(--accent), #FF8A00);
    color: var(--white);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 12px;
    border-radius: 20px;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(230, 81, 0, 0.3);
}

/* ==========================================================================
   13. RESPONSIVE
   ========================================================================== */

@media (max-width: 921px) {

    /* Header adjustments */
    .site-header {
        top: 8px;
        padding: 0 12px;
    }

    .site-header .ast-container {
        padding: 6px 20px;
        border-radius: var(--radius);
    }

    /* Hero */
    .bdo-hero-section h1,
    .elementor-section.bdo-hero h1 {
        font-size: clamp(1.8rem, 6vw, 2.5rem);
        max-width: 100%;
    }

    .bdo-hero-section p,
    .elementor-section.bdo-hero p {
        font-size: 16px;
    }

    /* Product grid */
    ul.products li.product,
    .woocommerce ul.products li.product {
        margin-bottom: 16px;
    }

    /* Buttons */
    .elementor-button,
    .elementor-widget-button .elementor-button {
        padding: 14px 28px !important;
        font-size: 14px !important;
    }

    /* Footer */
    .site-footer {
        text-align: center;
    }
}

@media (max-width: 544px) {

    /* Tighter header on small screens */
    .site-header {
        top: 4px;
        padding: 0 8px;
    }

    .site-header .ast-container {
        padding: 4px 16px;
    }

    .site-title {
        font-size: 16px !important;
    }

    .site-description {
        font-size: 9px !important;
    }

    /* Product cards full width */
    .woocommerce ul.products[class*="columns-"] li.product {
        width: 100% !important;
        margin-right: 0 !important;
    }

    /* Single product */
    .single-product .summary .product_title {
        font-size: 22px;
    }

    .single-product .summary .price {
        font-size: 22px;
    }
}

/* ==========================================================================
   14. UTILITY CLASSES
   ========================================================================== */

.bdo-text-gradient {
    background: linear-gradient(135deg, var(--text-dark), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.bdo-card {
    background: var(--white);
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    padding: 24px;
    transition: box-shadow var(--transition);
}

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