/* K87 UI polish layer (loaded last). */

:root {
    --k87-max-content: 1200px;
    --k87-max-narrow: 980px;
    --k87-space-1: 8px;
    --k87-space-2: 12px;
    --k87-space-3: 16px;
    --k87-space-4: 24px;
    --k87-radius-sm: 10px;
    --k87-radius-md: 14px;
    --k87-radius-lg: 20px;
}

/* Remove focus borders/highlights on click for all interactive elements */
a,
button,
input,
select,
textarea,
[role="button"] {
    -webkit-tap-highlight-color: transparent !important;
}

a:focus,
a:focus-visible,
button:focus,
button:focus-visible,
input:focus,
input:focus-visible,
select:focus,
select:focus-visible,
textarea:focus,
textarea:focus-visible,
[role="button"]:focus,
[role="button"]:focus-visible {
    outline: none !important;
    box-shadow: none !important;
    border-color: inherit !important;
}

button::-moz-focus-inner {
    border: 0 !important;
}

html {
    font-size: 16px;
}

body,
button,
input,
select,
textarea {
    font-size: 1rem;
    line-height: 1.55;
}

h1 {
    font-size: clamp(1.5rem, 2.4vw, 2rem);
    line-height: 1.25;
}

h2 {
    font-size: clamp(1.25rem, 2vw, 1.75rem);
    line-height: 1.3;
}

h3 {
    font-size: clamp(1.1rem, 1.6vw, 1.4rem);
    line-height: 1.35;
}

h4 {
    font-size: clamp(1rem, 1.3vw, 1.2rem);
    line-height: 1.4;
}

/* Shared page wrappers */
.woocommerce-cart .cart-main-wrapper,
.woocommerce-checkout .woocommerce-checkout,
.woocommerce-checkout .my-checkout-container,
.woocommerce-account .woocommerce-MyAccount-content,
.woocommerce-account .woocommerce-MyAccount-navigation,
.tc-wrapper,
.tc-create-wrapper,
.tc-view-wrapper,
.hc-wrapper,
.hc-split-container,
.hc-single-split {
    width: min(100% - 2rem, var(--k87-max-content)) !important;
    margin-inline: auto !important;
}

.tc-form-container,
.tc-list,
.hc-article-box,
.salla-card-section,
.cart_totals,
.order-card-item,
.download-card,
.address-card-item,
.order-address-card,
.woocommerce-EditAccountForm fieldset,
.form-section-card {
    border-radius: var(--k87-radius-lg) !important;
}

/* Buttons */
.button,
button.button,
input[type="submit"],
input[type="button"],
.k87-btn,
.tc-submit-action,
.tc-btn-new-bar,
.checkout-button,
.tc-send-icon-btn,
.tc-main-btn,
.tc-submit-btn {
    min-height: 46px !important;
    border-radius: var(--k87-radius-md) !important;
    font-size: 0.95rem !important;
    font-weight: 700 !important;
    padding-inline: 18px !important;
    line-height: 1.2 !important;
    text-align: center !important;
}

.checkout-button,
.tc-submit-action,
.tc-submit-btn {
    min-height: 52px !important;
    font-size: 1rem !important;
}

.tc-back-btn,
.salla-edit-btn {
    width: 44px !important;
    height: 44px !important;
    border-radius: 12px !important;
}

/* Inputs */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="number"],
input[type="date"],
select,
textarea,
.k87-input,
.tc-form-input,
.tc-select-input,
.tc-chat-input {
    border-radius: var(--k87-radius-md) !important;
    font-size: 0.95rem !important;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="number"],
input[type="date"],
select,
.k87-input,
.tc-form-input,
.tc-select-input,
.tc-chat-input {
    min-height: 46px !important;
}

textarea,
.tc-textarea-simple {
    min-height: 120px !important;
    padding: 12px 14px !important;
}

/* Alignment + spacing consistency */
.tc-action-bar,
.salla-card-section .card-header,
.order-card-header,
.address-card-header,
.card-head {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: var(--k87-space-2) !important;
}

.tc-card,
.k87-cart-card,
.hc-article-card {
    padding: var(--k87-space-3) !important;
    gap: var(--k87-space-3) !important;
}

.tc-card-title,
.product-name,
.product-name a,
.woocommerce-loop-product__title {
    font-size: 0.95rem !important;
    line-height: 1.4 !important;
}

.k87-summary-title,
.cart_totals .summary-title {
    font-size: 1.125rem !important;
    line-height: 1.3 !important;
}

.tc-status-pill,
.ticket-status-badge,
.order-status-badge,
.status-badge {
    font-size: 0.8rem !important;
    border-radius: 999px !important;
}

/* Tickets/chat readability */
.tc-bubble {
    font-size: 0.95rem !important;
    line-height: 1.65 !important;
}

#tc-scroll-area {
    padding: 18px !important;
}

.tc-chat-footer {
    padding: 10px 12px !important;
}

/* Checkout/cart top-level rhythm */
.woocommerce-checkout .salla-card-section,
.woocommerce-cart .cart_totals,
.woocommerce-cart .k87-cart-card {
    margin-bottom: 14px !important;
}

/* My account nav */
.spectra-nav-item {
    min-height: 86px !important;
    font-size: 0.9rem !important;
}

/* Mobile */
@media (max-width: 991px) {
    html {
        font-size: 15px;
    }

    .woocommerce-cart .cart-main-wrapper,
    .woocommerce-checkout .woocommerce-checkout,
    .woocommerce-checkout .my-checkout-container,
    .woocommerce-account .woocommerce-MyAccount-content,
    .woocommerce-account .woocommerce-MyAccount-navigation,
    .tc-wrapper,
    .tc-create-wrapper,
    .tc-view-wrapper,
    .hc-wrapper,
    .hc-split-container,
    .hc-single-split {
        width: calc(100% - 1rem) !important;
    }

    .tc-form-container,
    .hc-article-box,
    .cart_totals,
    .woocommerce-EditAccountForm fieldset,
    .form-section-card {
        padding: 16px !important;
    }

    .tc-action-bar,
    .k87-cart-card,
    .hc-article-card {
        padding: 12px !important;
        gap: 12px !important;
    }

    .button,
    button.button,
    input[type="submit"],
    .k87-btn,
    .tc-submit-action,
    .checkout-button,
    .tc-main-btn,
    .tc-submit-btn {
        min-height: 44px !important;
        font-size: 0.9rem !important;
        padding-inline: 14px !important;
    }

    .checkout-button,
    .tc-submit-action,
    .tc-submit-btn {
        min-height: 48px !important;
    }

    .tc-bubble {
        max-width: 92% !important;
        font-size: 0.9rem !important;
    }

    .k87-summary-title,
    .cart_totals .summary-title {
        font-size: 1rem !important;
    }

    .spectra-nav-item {
        min-height: 78px !important;
        font-size: 0.78rem !important;
    }
}

