/**
 * Theme Name: Blocksy Child
 * Description: Blocksy Child theme
 * Author: Creative Themes
 * Template: blocksy
 * Text Domain: blocksy
 */

/* ===== Category Tree with Lines - Compact ===== */
.wc-block-product-categories-list {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* All items in nested lists get tree lines */
.wc-block-product-categories-list--depth-1 > .wc-block-product-categories-list-item,
.wc-block-product-categories-list--depth-2 > .wc-block-product-categories-list-item {
    position: relative;
    padding-left: 20px !important;
}

/* Vertical line */
.wc-block-product-categories-list--depth-1 > .wc-block-product-categories-list-item::before,
.wc-block-product-categories-list--depth-2 > .wc-block-product-categories-list-item::before {
    content: "";
    position: absolute;
    left: 6px;
    top: 0;
    bottom: 0;
    border-left: 1px solid #999;
}

/* Horizontal branch */
.wc-block-product-categories-list--depth-1 > .wc-block-product-categories-list-item::after,
.wc-block-product-categories-list--depth-2 > .wc-block-product-categories-list-item::after {
    content: "";
    position: absolute;
    left: 6px;
    top: 11px;
    width: 10px;
    border-top: 1px solid #999;
}

/* Last item └ shape */
.wc-block-product-categories-list--depth-1 > .wc-block-product-categories-list-item:last-child::before,
.wc-block-product-categories-list--depth-2 > .wc-block-product-categories-list-item:last-child::before {
    height: 11px;
    bottom: auto;
}

/* Nested list positioning */
.wc-block-product-categories-list--depth-1,
.wc-block-product-categories-list--depth-2 {
    margin-left: 5px !important;
    padding-left: 0 !important;
}

/* Compact link styling */
.wc-block-product-categories-list-item a {
    display: block;
    padding: 3px 5px !important;
    text-decoration: none !important;
    line-height: 1.3;
}

/* Top-level categories bold - target both a and span */
.wc-block-product-categories-list--depth-0 > .wc-block-product-categories-list-item > a,
.wc-block-product-categories-list--depth-0 > .wc-block-product-categories-list-item > a > span,
.wc-block-product-categories-list--depth-0 > .wc-block-product-categories-list-item > a .wc-block-product-categories-list-item__name {
    font-weight: 700 !important;
}

.wc-block-product-categories-list-item a:hover {
    background-color: rgba(0,0,0,0.05);
}

/* Mobile - slightly larger for touch */
@media (max-width: 768px) {
    .wc-block-product-categories-list-item a {
        padding: 6px 5px !important;
    }
}

/* Mobile - reduce gap between parallax/hero section and category sidebar */
@media (max-width: 999px) {
    /* General sidebar gap reduction */
    [data-sidebar] {
        grid-row-gap: 0 !important;
    }

    aside.ct-sidebar,
    .ct-sidebar {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }

    /* Category widget - move up */
    .ct-sidebar .ct-widget,
    .ct-sidebar .wp-block-woocommerce-product-categories {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }

    .ct-sidebar .widget-title {
        margin-top: 0 !important;
        padding-top: 10px !important;
    }

    /* Product page specific */
    [data-prefix="product"] [data-sidebar] {
        grid-row-gap: 0 !important;
    }

    [data-prefix="product"] .ct-sidebar {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }

    /* Hero section spacing */
    .hero-section,
    [data-type="type-2"] {
        margin-bottom: 5px !important;
    }

    /* Reduce vertical content spacing on product pages */
    [data-prefix="product"] {
        --theme-content-vertical-spacing: 10px;
    }

    /* Stackable blocks spacing */
    .stk-inner-blocks {
        margin-bottom: 5px !important;
    }

    /* Entry summary spacing */
    .single-product .entry-summary {
        margin-bottom: 10px !important;
    }

    /* Parallax sections */
    [data-parallax] + aside,
    [data-parallax] + .ct-sidebar,
    section[data-parallax] + * {
        margin-top: 0 !important;
    }

    /* Category list container */
    .wc-block-product-categories-list--depth-0 {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }
}

/* Note: Stackable square card styles are in functions.php (wp_footer)
   to load after Stackable's inline styles */

/* ===== Contact Form 7 Styles ===== */
.wpcf7 {
    max-width: 450px !important;
    margin: 15px auto 0 !important;
    padding: 0 15px !important;
}

.wpcf7-form label {
    display: block !important;
    margin-bottom: 12px !important;
    font-weight: 500 !important;
    font-size: 14px !important;
    color: #365951 !important;
}

.wpcf7-form input[type="text"],
.wpcf7-form input[type="email"],
.wpcf7-form input[type="tel"],
.wpcf7-form textarea {
    width: 100% !important;
    padding: 8px 12px !important;
    border: 1px solid #ddd !important;
    border-radius: 6px !important;
    font-size: 14px !important;
    margin-top: 3px !important;
    transition: border-color 0.3s, box-shadow 0.3s !important;
}

.wpcf7-form input[type="text"]:focus,
.wpcf7-form input[type="email"]:focus,
.wpcf7-form input[type="tel"]:focus,
.wpcf7-form textarea:focus {
    border-color: #007f5f !important;
    box-shadow: 0 0 0 2px rgba(0, 127, 95, 0.1) !important;
    outline: none !important;
}

.wpcf7-form textarea {
    min-height: 70px !important;
    resize: vertical !important;
}

/* Remove default p margins in form */
.wpcf7-form p {
    margin: 0 !important;
    padding: 0 !important;
}

/* Turnstile widget */
.wpcf7-form .cf-turnstile {
    display: block !important;
    margin: 15px 0 0 0 !important;
}

/* Submit button */
.wpcf7-form input[type="submit"] {
    display: block !important;
    width: 100% !important;
    padding: 10px 20px !important;
    background-color: #007f5f !important;
    color: #fff !important;
    border: none !important;
    border-radius: 6px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: background-color 0.3s, transform 0.2s !important;
    margin-top: 15px !important;
}

.wpcf7 input[type="submit"]:hover {
    background-color: #006648;
    transform: translateY(-1px);
}

.wpcf7 input[type="submit"]:active {
    transform: translateY(0);
}

.wpcf7-response-output {
    margin: 15px 0 0 !important;
    padding: 10px !important;
    border-radius: 6px !important;
    text-align: center;
    font-size: 14px;
}

.wpcf7-mail-sent-ok {
    background-color: #d4edda !important;
    border-color: #c3e6cb !important;
    color: #155724 !important;
}

.wpcf7-validation-errors {
    background-color: #f8d7da !important;
    border-color: #f5c6cb !important;
    color: #721c24 !important;
}

.wpcf7-not-valid-tip {
    color: #dc3545;
    font-size: 12px;
    margin-top: 3px;
}

.wpcf7 .wpcf7-spinner {
    margin: 0 auto;
    display: block;
}

/*
 * Desktop horizontal form layout.
 * Note: CF7 puts <div class="cf-turnstile"> inside a <p>, which is invalid HTML.
 * Browsers break it up, so turnstile and submit become direct children of <form>.
 * Selectors below target the actual browser-parsed DOM structure.
 */
@media (min-width: 769px) {
    .wpcf7 {
        max-width: 750px !important;
    }

    .wpcf7-form {
        display: grid !important;
        grid-template-columns: 1fr 1fr 1fr;
        gap: 12px 15px;
    }

    /* Hidden fieldset — no grid space */
    .wpcf7-form > fieldset {
        display: none;
    }

    /* Empty <p> tags from browser fixing div-in-p — hide */
    .wpcf7-form > p:empty {
        display: none !important;
    }

    /* Textarea field spans full width */
    .wpcf7-form > p:has(textarea) {
        grid-column: 1 / -1;
    }

    /* Turnstile and Submit on same row, right-aligned */
    .wpcf7-form > .cf-turnstile {
        grid-column: 2 / 3;
        grid-row: 3;
        justify-self: end;
        margin: 0 !important;
    }

    .wpcf7-form > input[type="submit"] {
        grid-column: 3 / 4;
        grid-row: 3;
        width: auto !important;
        margin: 0 !important;
        padding: 10px 30px !important;
        height: 65px;
    }

    /* Response output spans full width */
    .wpcf7-form > .wpcf7-response-output {
        grid-column: 1 / -1;
    }
}

@media (max-width: 768px) {
    .wpcf7 {
        max-width: 100%;
        padding: 0 10px;
    }
}

/* ===== Contacts Page: Equal Height Cards ===== */
.page-id-1340 .wp-block-column > .wp-block-group {
    height: 100%;
    box-sizing: border-box;
}
