/* ==========================================================================
   Cattle Expert — Reusable Components
   ========================================================================== */

/* --- Global overrides for Impreza --- */
body {
    font-family: var(--ce-font-body);
    color: var(--ce-text-primary);
    background-color: var(--ce-cream);
}

h1, h2, h3, h4, h5, h6,
.w-blog-post-title,
.woocommerce-loop-product__title {
    font-family: var(--ce-font-display);
    font-weight: 400;
    color: var(--ce-text-primary);
}

h1 em, h2 em, h3 em {
    font-style: italic;
    color: var(--ce-green-dark);
}

/* --- Section backgrounds --- */
.ce-section--cream  { background-color: var(--ce-cream); }
.ce-section--muted  { background-color: var(--ce-cream-muted); }
.ce-section--green  { background-color: var(--ce-green-dark); color: var(--ce-cream); }
.ce-section--dark   { background-color: var(--ce-dark); color: var(--ce-cream); }

.ce-section--green h2,
.ce-section--green h3,
.ce-section--dark h2,
.ce-section--dark h3 {
    color: var(--ce-cream);
}

/* --- Section padding --- */
.ce-section {
    padding: var(--ce-space-section) var(--ce-content-padding);
}

.ce-section__inner {
    max-width: var(--ce-max-width);
    margin: 0 auto;
}

/* --- Label / tagline --- */
.ce-label {
    font-family: var(--ce-font-body);
    font-size: var(--ce-text-xs);
    font-weight: 500;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--ce-green-dark);
    margin-bottom: var(--ce-space-md);
}

.ce-section--green .ce-label,
.ce-section--dark .ce-label {
    color: var(--ce-green-sage);
    opacity: 0.6;
}

/* --- Buttons --- */
.ce-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--ce-space-sm);
    font-family: var(--ce-font-body);
    font-size: var(--ce-text-sm);
    font-weight: 500;
    letter-spacing: 0.3px;
    padding: 12px 24px;
    border: none;
    cursor: pointer;
    transition: opacity var(--ce-transition-fast), transform var(--ce-transition-fast);
    text-decoration: none;
    line-height: 1;
}

.ce-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.ce-btn:active {
    transform: translateY(0);
}

.ce-btn--primary {
    background-color: var(--ce-green-dark);
    color: var(--ce-cream);
}

.ce-btn--secondary {
    background-color: transparent;
    color: var(--ce-green-dark);
    border-bottom: 1px solid currentColor;
    padding: 0 0 2px 0;
}

.ce-btn--inverse {
    background-color: var(--ce-cream);
    color: var(--ce-green-dark);
}

/* --- Cards --- */
.ce-card {
    background-color: #fff;
    border-top: 2px solid var(--ce-green-dark);
    padding: var(--ce-space-lg) var(--ce-space-md);
    transition: transform var(--ce-transition-base);
}

.ce-card:hover {
    transform: translateY(-2px);
}

.ce-card__icon {
    width: 36px;
    height: 36px;
    background-color: var(--ce-cream-muted);
    border-radius: var(--ce-radius-sm);
    margin-bottom: var(--ce-space-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.ce-card__title {
    font-family: var(--ce-font-body);
    font-size: var(--ce-text-md);
    font-weight: 600;
    color: var(--ce-text-primary);
    margin-bottom: var(--ce-space-xs);
}

.ce-card__text {
    font-size: var(--ce-text-xs);
    color: var(--ce-text-muted);
    line-height: 1.4;
}

/* --- "Why us" pillars (dark green bar) --- */
.ce-pillars {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
}

.ce-pillar {
    padding: var(--ce-space-lg) var(--ce-space-lg) var(--ce-space-lg) 0;
    border-right: 1px solid var(--ce-border-dark);
}

.ce-pillar:last-child {
    border-right: none;
    padding-right: 0;
}

.ce-pillar:not(:first-child) {
    padding-left: var(--ce-space-lg);
}

.ce-pillar__num {
    font-family: var(--ce-font-display);
    font-size: 28px;
    color: rgba(168, 197, 160, 0.4);
    margin-bottom: var(--ce-space-sm);
    line-height: 1;
}

.ce-pillar__title {
    font-family: var(--ce-font-body);
    font-size: var(--ce-text-sm);
    font-weight: 600;
    color: var(--ce-cream);
    margin-bottom: var(--ce-space-xs);
    line-height: 1.3;
}

.ce-pillar__text {
    font-size: var(--ce-text-xs);
    color: rgba(245, 243, 238, 0.45);
    line-height: 1.5;
}

/* --- Stat numbers --- */
.ce-stat__num {
    font-family: var(--ce-font-display);
    font-size: var(--ce-text-4xl);
    color: var(--ce-green-dark);
    line-height: 1;
}

.ce-stat__label {
    font-size: var(--ce-text-xs);
    color: var(--ce-text-muted);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-top: var(--ce-space-xs);
}

/* --- Divider --- */
.ce-divider {
    width: 40px;
    height: 1px;
    background-color: var(--ce-green-dark);
    opacity: 0.3;
}

/* --- Consent checkbox (forms) --- */
.ce-consent {
    display: flex;
    gap: var(--ce-space-sm);
    align-items: flex-start;
    font-size: var(--ce-text-xs);
    color: var(--ce-text-muted);
    line-height: 1.5;
}

.ce-consent input[type="checkbox"] {
    margin-top: 2px;
    flex-shrink: 0;
}

.ce-consent a {
    color: var(--ce-green-dark);
    text-decoration: underline;
}

/* --- WooCommerce Checkout spacing fix --- */
.woocommerce-checkout .woocommerce-billing-fields__field-wrapper > p.form-row {
    margin-bottom: 16px !important;
}

.woocommerce-checkout #billing_country_field {
    margin-top: 24px !important;
}

/* Space between last name field and country dropdown */
.woocommerce-checkout #billing_last_name_field {
    margin-bottom: 24px !important;
}

/* Also fix Impreza WC forms that collapse margins */
body.woocommerce-checkout .woocommerce form .form-row {
    margin-bottom: 16px !important;
}

/* --- WC Composite Products: cart & checkout styling --- */
.woocommerce-cart-form .component_table_item td,
.woocommerce-checkout .component_table_item td {
    padding-left: 32px !important;
    background: rgba(44, 74, 46, 0.03);
    font-size: var(--ce-text-sm);
}

.woocommerce-cart-form .component_table_item td.product-name::before,
.woocommerce-checkout .component_table_item td.product-name::before {
    content: "└ ";
    color: var(--ce-text-muted);
    font-size: var(--ce-text-xs);
}

.woocommerce-cart-form .component_container_table_item td.product-name,
.woocommerce-checkout .component_container_table_item td.product-name {
    font-weight: 600;
}

/* Hide individual prices on child items (price is shown on parent) */
.woocommerce-cart-form .component_table_item td.product-price,
.woocommerce-cart-form .component_table_item td.product-subtotal {
    color: var(--ce-text-muted);
    font-size: var(--ce-text-xs);
}
