/**
 * CBDFunhouse Core - Global CSS
 * Loads on all pages
 * Version: 1.0.0
 */

/* =============================================================
   CSS VARIABLES (Design Tokens)
   ============================================================= */
:root {
    --cbdfh-primary: #2C4C3B;       /* Verde închis - brand principal */
    --cbdfh-secondary: #E7EADB;     /* Verde-gri deschis */
    --cbdfh-accent: #b67e53;        /* Maroniu/Auriu - accente, butoane */
    --cbdfh-bg: #fdf3f2;            /* Crem deschis fundal */
    --cbdfh-text: #202020;          /* Negru/gri închis */
    --cbdfh-white: #ffffff;
    --cbdfh-border: #E7EADB;
    --cbdfh-radius: 8px;
    --cbdfh-shadow: 0 2px 12px rgba(0,0,0,0.08);
    --cbdfh-transition: all 0.3s ease;
}

/* =============================================================
   TYPOGRAPHY
   ============================================================= */
body {
    color: var(--cbdfh-text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* =============================================================
   BUTTONS
   ============================================================= */
.button,
.btn,
button[type="submit"],
.woocommerce a.button,
.woocommerce button.button {
    border-radius: var(--cbdfh-radius);
    transition: var(--cbdfh-transition);
}

/* Primary buttons */
.woocommerce a.button.alt,
.woocommerce button.button.alt,
.woocommerce input.button.alt {
    background-color: var(--cbdfh-primary);
    border-color: var(--cbdfh-primary);
    color: var(--cbdfh-white);
}

.woocommerce a.button.alt:hover,
.woocommerce button.button.alt:hover,
.woocommerce input.button.alt:hover {
    background-color: var(--cbdfh-accent);
    border-color: var(--cbdfh-accent);
    color: var(--cbdfh-white);
}

/* =============================================================
   LINKS
   ============================================================= */
a {
    transition: var(--cbdfh-transition);
}

/* =============================================================
   HIDE BROKEN SHORTCODE TEXT
   ============================================================= */
.entry-content p:empty,
.entry-content br:only-child {
    display: none;
}

/* Hide any leftover VC shortcode text that might slip through */
.page-content > p:first-child:last-child:empty {
    display: none;
}

/* =============================================================
   POLYLANG LANGUAGE SWITCHER (RO/EN)
   ============================================================= */
.lang-item a {
    text-transform: uppercase;
    font-weight: 600;
    font-size: 13px;
}

/* =============================================================
   FIX: Blog images oversized in carousel/sidebar
   ============================================================= */
.slide-post img,
.blog-post-loop .entry-thumbnail img,
.owl-carousel .owl-item img,
.woodmart-blog-holder img {
    max-width: 100%;
    height: auto;
    object-fit: cover;
}

/* Limit blog post image height in carousels */
.slide-post .post-img-wrapp img,
.owl-carousel .slide-post img {
    max-height: 250px;
    width: 100%;
    object-fit: cover;
}

/* =============================================================
   FIX: Hide broken prefooter with WPBakery shortcodes
   ============================================================= */
.woodmart-prefooter [class*="vc_row"],
.woodmart-prefooter [class*="vc_column"] {
    display: none !important;
}

/* Hide raw shortcode text in prefooter */
.woodmart-prefooter > .container > :not(.brands-items-wrapper):not(div[class]) {
    display: none;
}

/* If prefooter still shows shortcode text, hide it completely */
.woodmart-prefooter {
    overflow: hidden;
}

/* =============================================================
   RESPONSIVE FIXES
   ============================================================= */

@media (max-width: 768px) {
    .container,
    .site-content {
        padding-left: 15px;
        padding-right: 15px;
    }

    /* Categories: 2 columns x 4 rows on mobile (not slider) */
    .entry-content table {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
        width: 100% !important;
    }
    .entry-content table tr {
        display: contents !important;
    }
    .entry-content table td {
        display: block !important;
        width: 100% !important;
        min-width: unset !important;
        white-space: normal !important;
    }

    /* Blog grid: 1 column on mobile + smaller card */
    .cbdfh-blog-grid {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }
    .cbdfh-blog-grid a {
        border-radius: 8px !important;
    }
    .cbdfh-blog-grid a > div {
        padding: 15px !important;
    }

    /* Featured product: stack on mobile */
    .entry-content > div[style*="display: flex"] {
        flex-direction: column !important;
    }
}

@media (max-width: 480px) {
    .entry-content table td {
        padding: 15px 8px !important;
    }
    .entry-content table td img {
        width: 40px !important;
        height: 40px !important;
    }
}

/* =============================================================
   DARK MODE (MANUAL ONLY - activated via .cbdfh-dark class on body)
   Light mode is DEFAULT. Dark activates only when user clicks toggle.
   ============================================================= */

/* Theme switcher button */
.cbdfh-theme-toggle {
    cursor: pointer;
    padding: 4px 12px;
    border-radius: 20px;
    border: 1px solid #ddd;
    background: transparent;
    font-size: 16px;
    transition: all 0.3s;
    line-height: 1;
    vertical-align: middle;
}
.cbdfh-theme-toggle:hover {
    border-color: #b67e53;
    transform: scale(1.1);
}

/* === DARK MODE STYLES (only when .cbdfh-dark is on body) === */
body.cbdfh-dark,
body.cbdfh-dark .website-wrapper,
body.cbdfh-dark .main-page-wrapper,
body.cbdfh-dark .site-content,
body.cbdfh-dark .content-area {
    background-color: #1a1a1a !important;
    color: #e0e0e0 !important;
}

body.cbdfh-dark .whb-row,
body.cbdfh-dark header.whb-header,
body.cbdfh-dark .whb-header {
    background-color: #1e1e1e !important;
}

body.cbdfh-dark .entry-content,
body.cbdfh-dark .page-content,
body.cbdfh-dark .container {
    background-color: #1a1a1a !important;
    color: #e0e0e0 !important;
}

/* Cards */
body.cbdfh-dark .entry-content table td,
body.cbdfh-dark .product-grid-item,
body.cbdfh-dark .products .product {
    background-color: #272727 !important;
    color: #e0e0e0 !important;
}

/* Product hover fix */
body.cbdfh-dark .products .product:hover {
    background-color: #2d2d2d !important;
}
body.cbdfh-dark .product-element-top {
    background-color: #333 !important;
}
body.cbdfh-dark .product-grid-item .product-title a,
body.cbdfh-dark .product-grid-item .price,
body.cbdfh-dark .product-grid-item .price .amount,
body.cbdfh-dark .woodmart-hover-alt .product-information *,
body.cbdfh-dark .product-grid-item .woocommerce-product-details__short-description,
body.cbdfh-dark .product-grid-item .woocommerce-product-details__short-description * {
    color: #e0e0e0 !important;
}

/* Text */
body.cbdfh-dark .entry-content h1,
body.cbdfh-dark .entry-content h2,
body.cbdfh-dark .entry-content h3,
body.cbdfh-dark .entry-content h4,
body.cbdfh-dark .entry-content p,
body.cbdfh-dark .entry-content li,
body.cbdfh-dark .entry-content span,
body.cbdfh-dark .entry-content strong {
    color: #e0e0e0 !important;
}

/* Featured product section */
body.cbdfh-dark .entry-content div[style*="background: linear-gradient(135deg, #fdf3f2"] {
    background: linear-gradient(135deg, #2a2a2a 0%, #222 100%) !important;
}

/* Trust badges */
body.cbdfh-dark .entry-content div[style*="background: #f8f9f6"] {
    background: #222 !important;
}

/* Footer */
body.cbdfh-dark .woodmart-footer,
body.cbdfh-dark .woodmart-prefooter,
body.cbdfh-dark footer,
body.cbdfh-dark .copyrights-wrapper {
    background-color: #141414 !important;
    color: #ccc !important;
}

/* Links */
body.cbdfh-dark a:not([style*="background"]) {
    color: #d4996b !important;
}

/* Blog cards */
body.cbdfh-dark .cbdfh-blog-grid a {
    background: #272727 !important;
}

/* Inputs */
body.cbdfh-dark input,
body.cbdfh-dark textarea,
body.cbdfh-dark select {
    background-color: #2a2a2a !important;
    color: #e0e0e0 !important;
    border-color: #444 !important;
}

/* Mobile menu */
body.cbdfh-dark .mobile-nav,
body.cbdfh-dark .wd-dropdown {
    background-color: #1e1e1e !important;
}

/* Toggle button in dark mode */
body.cbdfh-dark .cbdfh-theme-toggle {
    border-color: #555;
    color: #e0e0e0;
}

/* =============================================================
   TRANSLATION OVERRIDES (RO)
   ============================================================= */
html[lang*="ro"] .woocommerce a.button.add_to_cart_button span,
html[lang*="ro"] .add-to-cart-loop span {
    font-size: 0;
}
html[lang*="ro"] .woocommerce a.button.add_to_cart_button span::after,
html[lang*="ro"] .add-to-cart-loop span::after {
    content: "Adaugă în coș";
    font-size: 14px;
}

html[lang*="ro"] a.btn-read-more,
html[lang*="ro"] a.more-link {
    font-size: 0;
}
html[lang*="ro"] a.btn-read-more::after,
html[lang*="ro"] a.more-link::after {
    content: "CITEȘTE MAI MULT";
    font-size: 14px;
}
