/*
Theme Name: HHI starter
Theme URI: https://hairhealthinstitute.com
Author: Hair Health Institute
Author URI: https://hairhealthinstitute.com
Description: Custom WordPress theme converted from a Next.js static export. Built for full compatibility with Elementor Page Builder using the Hello Elementor architecture as a baseline.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: hhi-theme
Tags: custom-menu, custom-logo, elementor, full-width-template, one-column, two-columns
*/

html, body {
    height: auto;
    min-height: 100%;
    overflow-x: hidden;
}

header > div,
header nav {
    overflow: visible !important;
}

/* Active nav menu item styling */
header nav .is-menu-active > a,
header nav .current-menu-item > a,
header nav .current_page_item > a {
    color: #ffffff !important;
    background-color: #0ea5e9 !important;
}

/* 404 page full viewport layout */
.error404 {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.error404 #main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

#main-content {
    min-height: 100vh;
    padding-top: 59px;
}

.error-404-number {
    font-size: 120px;
}

@media (min-width: 640px) {
    .error-404-number {
        font-size: 160px;
    }
}

/* Force logo size on all pages, especially WooCommerce */
header img[alt="Hair Health Institute"] {
    height: 28px !important;
    width: auto !important;
    max-width: none !important;
}

/* ─── WooCommerce Cart Fixes ─── */

/* Hide native number input spinners */
.woocommerce-cart-form input[type="number"]::-webkit-outer-spin-button,
.woocommerce-cart-form input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.woocommerce-cart-form input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

/* Hide update cart button — triggered automatically by +/- stepper */
.woocommerce-cart-form button[name="update_cart"] {
    display: none !important;
}

/* Essential WooCommerce form resets (default CSS dequeued) */
.woocommerce .quantity .qty {
    background: transparent;
}
.woocommerce form .form-row .required {
    color: #e53e3e;
}
.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
    padding: 1em 1.5em;
    margin: 0 0 1em;
    border-radius: 0.75rem;
}
.woocommerce-message {
    background: #ecfdf5;
    border: 1px solid #10b981;
    color: #047857;
}
.woocommerce-info {
    background: #eff6ff;
    border: 1px solid #3b82f6;
    color: #1d4ed8;
}
.woocommerce-error {
    background: #fef2f2;
    border: 1px solid #ef4444;
    color: #b91c1c;
}
.woocommerce-message a,
.woocommerce-info a {
    color: inherit;
    text-decoration: underline;
}

/* Shipping calculator in cart totals */
.shipping-calculator-form {
    margin-top: 0.5rem;
}
.shipping-calculator-form input,
.shipping-calculator-form select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    font-size: 0.875rem;
}
.shipping-calculator-form button {
    margin-top: 0.5rem;
    padding: 0.5rem 1rem;
    background: #1f2937;
    color: white;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Cross-sells on cart */
.cross-sells h2 {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 2rem 0 1rem;
}

/* ─── Shop Page Filter & Sort ─── */

/* Custom arrow for sort select */
.hhi-sort-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 36px;
}

/* Mobile: collapse category pills behind filter toggle */
@media (max-width: 640px) {
    .hhi-filter-panel {
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        margin-bottom: 0;
    }
    .hhi-filter-panel.is-open {
        max-height: 500px;
        opacity: 1;
        margin-bottom: 1rem;
    }
}

/* Desktop: always show pills */
@media (min-width: 641px) {
    .hhi-filter-panel {
        max-height: none !important;
        opacity: 1 !important;
        overflow: visible !important;
    }
}

/* ─── My Account Navigation ─── */
.woocommerce-MyAccount-navigation {
    margin-bottom: 2rem;
}
.woocommerce-MyAccount-navigation ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    list-style: none;
    padding: 0;
    margin: 0;
}
.woocommerce-MyAccount-navigation li a {
    display: inline-flex;
    align-items: center;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #4b5563;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 9999px;
    text-decoration: none;
    transition: all 0.15s ease;
}
.woocommerce-MyAccount-navigation li a:hover {
    border-color: #d1d5db;
}
.woocommerce-MyAccount-navigation li.is-active a {
    background: #0ea5e9;
    color: white;
    border-color: #0ea5e9;
}
.woocommerce-MyAccount-content {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
}

/* Account page form field styling */
.woocommerce-MyAccount-content .form-row {
    margin-bottom: 0;
    padding: 0;
}
.woocommerce-MyAccount-content .form-row label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.375rem;
}
.woocommerce-MyAccount-content .form-row input[type="text"],
.woocommerce-MyAccount-content .form-row input[type="email"],
.woocommerce-MyAccount-content .form-row input[type="password"],
.woocommerce-MyAccount-content .form-row input[type="tel"],
.woocommerce-MyAccount-content .form-row select,
.woocommerce-MyAccount-content .form-row textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    outline: none;
    transition: all 0.15s ease;
}
.woocommerce-MyAccount-content .form-row input:focus,
.woocommerce-MyAccount-content .form-row select:focus,
.woocommerce-MyAccount-content .form-row textarea:focus {
    border-color: #0ea5e9;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}
.woocommerce-MyAccount-content .form-row .select2-container .select2-selection--single {
    height: 44px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
}
.woocommerce-MyAccount-content .form-row .select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 42px;
    padding-left: 1rem;
    color: #1f2937;
    font-size: 0.875rem;
}
.woocommerce-MyAccount-content .form-row .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 42px;
    right: 8px;
}
.woocommerce-MyAccount-content .clear {
    display: none;
}
.woocommerce-MyAccount-content fieldset {
    border: 0;
    padding: 0;
    margin: 0;
}
.woocommerce-MyAccount-content fieldset legend {
    padding: 0;
}

/* Select2 fixes for account address forms */
.woocommerce-MyAccount-content .select2-container {
    width: 100% !important;
}
.woocommerce-MyAccount-content .select2-container .select2-selection--single {
    height: 44px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
}
.woocommerce-MyAccount-content .select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 42px;
    padding-left: 1rem;
    color: #1f2937;
    font-size: 0.875rem;
}
.woocommerce-MyAccount-content .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 42px;
    right: 8px;
}
.woocommerce-MyAccount-content .select2-dropdown {
    border-color: #e5e7eb;
    border-radius: 0.75rem;
}
.woocommerce-MyAccount-content .select2-results__option {
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
}
.woocommerce-MyAccount-content .select2-results__option--highlighted[aria-selected] {
    background-color: #0ea5e9;
}

/* Form row spacing in account content */
.woocommerce-MyAccount-content p.form-row,
.woocommerce-address-fields p.form-row,
.woocommerce-EditAccountForm p.form-row,
.woocommerce-form-login p.form-row,
.woocommerce-ResetPassword p.form-row,
.woocommerce-form-register p.form-row {
    margin-bottom: 1rem;
}
.woocommerce-MyAccount-content p.form-row:last-of-type,
.woocommerce-MyAccount-content p.form-row.mb-0,
.woocommerce-address-fields p.form-row:last-of-type,
.woocommerce-address-fields p.form-row.mb-0,
.woocommerce-EditAccountForm p.form-row:last-of-type,
.woocommerce-EditAccountForm p.form-row.mb-0,
.woocommerce-form-login p.form-row:last-of-type,
.woocommerce-form-login p.form-row.mb-0,
.woocommerce-ResetPassword p.form-row:last-of-type,
.woocommerce-ResetPassword p.form-row.mb-0,
.woocommerce-form-register p.form-row:last-of-type,
.woocommerce-form-register p.form-row.mb-0 {
    margin-bottom: 0;
}

/* Ensure space-y classes work with WooCommerce form-row floats */
.woocommerce-address-fields__field-wrapper .form-row {
    float: none;
    width: 100%;
}

/* ─── Cart Quantity Stepper Fixes ─── */

/* Ensure WooCommerce quantity wrapper doesn't break layout */
.woocommerce-cart-form .quantity {
    display: inline-block;
    margin: 0;
    padding: 0;
}

/* Cart quantity input visibility */
.woocommerce-cart-form .quantity input[type="number"] {
    display: block;
    width: 2.5rem;
    height: 2.25rem;
    text-align: center;
    font-size: 0.875rem;
    line-height: 2.25rem;
    color: #1f2937;
    background: transparent;
    border: none;
    outline: none;
    -moz-appearance: textfield;
    appearance: textfield;
}

/* Remove browser number spinners */
.woocommerce-cart-form .quantity input[type="number"]::-webkit-outer-spin-button,
.woocommerce-cart-form .quantity input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* ─── Cart Order Summary Fixes ─── */

/* Ensure checkout button is always styled */
.wc-proceed-to-checkout .checkout-button {
    display: block !important;
    width: 100% !important;
    text-align: center !important;
    padding: 1rem 1.5rem !important;
    background-color: #0ea5e9 !important;
    color: #ffffff !important;
    font-weight: 600 !important;
    border-radius: 9999px !important;
    text-decoration: none !important;
    transition: background-color 0.15s ease !important;
    box-shadow: 0 1px 3px rgba(14, 165, 233, 0.25) !important;
}
.wc-proceed-to-checkout .checkout-button:hover {
    background-color: #0284c7 !important;
}

/* Shipping options in cart totals */
.cart_totals .woocommerce-shipping-methods {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: right;
}
.cart_totals .woocommerce-shipping-methods li {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}
.cart_totals .woocommerce-shipping-methods li:last-child {
    margin-bottom: 0;
}
.cart_totals .woocommerce-shipping-methods input[type="radio"] {
    width: 1rem;
    height: 1rem;
    accent-color: #0ea5e9;
    margin: 0;
}
.cart_totals .woocommerce-shipping-methods label {
    font-size: 0.875rem;
    color: #1f2937;
    margin: 0;
    display: inline;
}
.cart_totals .woocommerce-shipping-methods .amount {
    font-weight: 500;
}
.cart_totals .woocommerce-shipping-destination {
    font-size: 0.75rem;
    color: #9ca3af;
    margin-top: 0.25rem;
}
.cart_totals .shipping-calculator-button {
    font-size: 0.75rem;
    color: #0ea5e9;
    text-decoration: none;
}
.cart_totals .shipping-calculator-button:hover {
    color: #0284c7;
}

/* Submit button spacing in account forms */
.woocommerce-MyAccount-content form .form-row:has(button[type="submit"]),
.woocommerce-MyAccount-content form .form-row:has(input[type="submit"]),
.woocommerce-MyAccount-content form p:has(> button[type="submit"]),
.woocommerce-MyAccount-content form p:has(> input[type="submit"]) {
    margin-top: 1.5rem;
}

/* ── Elementor container width (match home page max-w-[1440px]) ── */
.elementor-section.elementor-section-boxed,
.elementor-section.elementor-section-boxed > .elementor-container,
.elementor-section.elementor-section-full_width > .elementor-container {
    max-width: 1440px;
}
