/**
 * IndusVally Theme - Main Styles
 * 
 * Custom styles and WooCommerce overrides
 */

/* ============================================
   TYPOGRAPHY
   ============================================ */
.prose {
    line-height: 1.75;
}

.prose h1,
.prose h2,
.prose h3,
.prose h4 {
    font-weight: 700;
    color: #0f172a;
    margin-top: 1.5em;
    margin-bottom: 0.5em;
}

.prose p {
    margin-bottom: 1em;
}

.prose ul,
.prose ol {
    padding-left: 1.5em;
    margin-bottom: 1em;
}

.prose a {
    color: #2563eb;
}

.prose a:hover {
    text-decoration: underline;
}

/* ============================================
   WOOCOMMERCE OVERRIDES
   ============================================ */

/* Ordering dropdown */
.woocommerce-ordering select {
    padding: 0.5rem 2rem 0.5rem 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    background-color: #f9fafb;
    font-size: 0.875rem;
    color: #374151;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
}

.woocommerce-ordering select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Result count */
.woocommerce-result-count {
    margin: 0;
    font-size: 0.875rem;
    color: #6b7280;
}

/* Pagination */
.woocommerce-pagination {
    margin-top: 2rem;
}

.woocommerce-pagination ul {
    display: flex;
    gap: 0.5rem;
    list-style: none;
    padding: 0;
    margin: 0;
    justify-content: center;
}

.woocommerce-pagination ul li {
    margin: 0;
}

.woocommerce-pagination ul li a,
.woocommerce-pagination ul li span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    height: 2.5rem;
    padding: 0 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    background-color: #fff;
    transition: all 0.15s;
}

.woocommerce-pagination ul li a:hover {
    border-color: #2563eb;
    color: #2563eb;
    background-color: #eff6ff;
}

.woocommerce-pagination ul li span.current {
    background-color: #0f172a;
    border-color: #0f172a;
    color: #fff;
}

/* Add to cart button */
.single_add_to_cart_button,
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 2rem;
    background-color: #0f172a;
    color: #fff;
    font-weight: 600;
    font-size: 0.875rem;
    border-radius: 0.75rem;
    border: none;
    cursor: pointer;
    transition: all 0.15s;
}

.single_add_to_cart_button:hover,
.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce input.button:hover {
    background-color: #1e293b;
    color: #fff;
}

.single_add_to_cart_button:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.2);
}

/* Quantity input */
.woocommerce .quantity {
    display: inline-flex;
    align-items: center;
    margin-right: 1rem;
}

.woocommerce .quantity input[type="number"] {
    width: 4rem;
    padding: 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    text-align: center;
    font-size: 1rem;
    font-weight: 500;
}

.woocommerce .quantity input[type="number"]:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Tabs */
.woocommerce-tabs {
    background-color: #fff;
    border-radius: 1rem;
    border: 1px solid #e5e7eb;
    overflow: hidden;
}

.woocommerce-tabs ul.tabs {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    border-bottom: 1px solid #e5e7eb;
    background-color: #f9fafb;
}

.woocommerce-tabs ul.tabs li {
    margin: 0;
}

.woocommerce-tabs ul.tabs li a {
    display: block;
    padding: 1rem 1.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    color: #6b7280;
    border-bottom: 2px solid transparent;
    transition: all 0.15s;
}

.woocommerce-tabs ul.tabs li a:hover {
    color: #0f172a;
}

.woocommerce-tabs ul.tabs li.active a {
    color: #0f172a;
    background-color: #fff;
    border-bottom-color: #2563eb;
}

.woocommerce-tabs .panel {
    padding: 2rem;
}

.woocommerce-tabs .panel h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 1rem;
}

/* Related Products */
.related.products {
    padding-top: 2rem;
    border-top: 1px solid #e5e7eb;
    margin-top: 2rem;
}

.related.products>h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 2rem;
}

.related.products ul.products {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

@media (max-width: 1024px) {
    .related.products ul.products {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .related.products ul.products {
        grid-template-columns: repeat(1, 1fr);
    }
}

.related.products ul.products li.product {
    background-color: #fff;
    border-radius: 0.75rem;
    border: 1px solid #e5e7eb;
    overflow: hidden;
    transition: all 0.2s ease;
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.related.products ul.products li.product::before {
    display: none !important;
}

.related.products ul.products li.product:hover {
    border-color: #cbd5e1;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.related.products ul.products li.product a.woocommerce-LoopProduct-link {
    display: block;
    text-decoration: none;
}

.related.products ul.products li.product a img,
.related.products ul.products li.product img {
    width: 100%;
    height: 180px;
    object-fit: contain;
    background-color: #f8fafc;
    padding: 1.5rem;
    border-bottom: 1px solid #f1f5f9;
}

.related.products ul.products li.product .woocommerce-loop-product__title,
.related.products ul.products li.product a h2,
.related.products ul.products li.product h2 {
    padding: 1rem 1rem 0.5rem;
    font-size: 0.875rem !important;
    font-weight: 600;
    color: #0f172a;
    margin: 0;
    line-height: 1.4;
    min-height: 2.5rem;
}

.related.products ul.products li.product .price {
    display: block;
    padding: 0 1rem 1rem;
    font-weight: 700;
    font-size: 1rem;
    color: #0f172a;
}

.related.products ul.products li.product .price del {
    color: #9ca3af;
    font-size: 0.875rem;
    font-weight: 400;
}

.related.products ul.products li.product .price ins {
    text-decoration: none;
    color: #0f172a;
}

.related.products ul.products li.product .button,
.related.products ul.products li.product .add_to_cart_button {
    display: none;
}

/* Star Ratings - Hide "x out of x" text */
.star-rating {
    display: inline-flex;
    font-size: 0;
    position: relative;
    width: 5.4em;
    height: 1em;
    font-size: 1rem;
    overflow: hidden;
}

.star-rating::before {
    content: "★★★★★";
    color: #e5e7eb;
    font-size: 1em;
    letter-spacing: 0.1em;
}

.star-rating span {
    position: absolute;
    top: 0;
    left: 0;
    overflow: hidden;
    height: 100%;
}

.star-rating span::before {
    content: "★★★★★";
    color: #fbbf24;
    font-size: 1em;
    letter-spacing: 0.1em;
}

/* Hide the accessibility text "Rated x out of 5" */
.star-rating .rating,
.star-rating strong {
    position: absolute;
    left: -9999px;
    font-size: 0;
    opacity: 0;
    visibility: hidden;
}

/* Related products star rating */
.related.products .star-rating {
    margin: 0 1rem 0.5rem;
}

/* Product loop star rating */
.products .star-rating {
    margin-bottom: 0.5rem;
}

/* Single product page star rating (custom implementation) */
.woocommerce-product-rating {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.woocommerce-product-rating .star-rating {
    font-size: 1.125rem;
}

.woocommerce-product-rating .woocommerce-review-link {
    color: #6b7280;
    font-size: 0.875rem;
}

/* Reviews star rating */
.comment-form-rating .stars {
    display: flex;
    gap: 0.25rem;
}

.comment-form-rating .stars a {
    font-size: 1.5rem;
    color: #e5e7eb;
    text-decoration: none;
}

.comment-form-rating .stars a:hover,
.comment-form-rating .stars a.active {
    color: #fbbf24;
}

.comment-form-rating .stars.selected a.active~a {
    color: #e5e7eb;
}

/* Cart page */
.woocommerce-cart-form table {
    width: 100%;
    border-collapse: collapse;
}

.woocommerce-cart-form table th {
    text-align: left;
    padding: 1rem;
    font-weight: 600;
    color: #374151;
    border-bottom: 1px solid #e5e7eb;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.woocommerce-cart-form table td {
    padding: 1.5rem 1rem;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
}

.woocommerce-cart-form table td.product-thumbnail img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border-radius: 0.5rem;
    background-color: #f1f5f9;
}

.woocommerce-cart-form table td.product-name a {
    font-weight: 600;
    color: #0f172a;
}

.woocommerce-cart-form table td.product-name a:hover {
    color: #2563eb;
}

/* Checkout page */
.woocommerce-checkout .woocommerce-billing-fields label,
.woocommerce-checkout .woocommerce-shipping-fields label {
    display: block;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.woocommerce-checkout input[type="text"],
.woocommerce-checkout input[type="email"],
.woocommerce-checkout input[type="tel"],
.woocommerce-checkout select,
.woocommerce-checkout textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    transition: all 0.15s;
}

.woocommerce-checkout input[type="text"]:focus,
.woocommerce-checkout input[type="email"]:focus,
.woocommerce-checkout input[type="tel"]:focus,
.woocommerce-checkout select:focus,
.woocommerce-checkout textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* ============================================
   UTILITIES
   ============================================ */
[x-cloak] {
    display: none !important;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ============================================
   WOOCOMMERCE BLOCKS (Gutenberg)
   ============================================ */

/* Block Cart & Checkout Buttons */
.wc-block-components-button,
.wc-block-cart__submit-button,
.wc-block-components-checkout-place-order-button,
.wc-block-checkout__actions_row .wc-block-components-button {
    background-color: #1e293b !important;
    color: #fff !important;
    border-radius: 0.75rem !important;
    padding: 0.875rem 2rem !important;
    font-weight: 600 !important;
    border: none !important;
    cursor: pointer !important;
    transition: all 0.15s ease !important;
}

.wc-block-components-button:hover,
.wc-block-cart__submit-button:hover,
.wc-block-components-checkout-place-order-button:hover {
    background-color: #0f172a !important;
    color: #fff !important;
}

/* Block quantity selector */
.wc-block-components-quantity-selector {
    border: 1px solid #e5e7eb !important;
    border-radius: 0.5rem !important;
    overflow: hidden;
}

.wc-block-components-quantity-selector input {
    border: none !important;
    font-weight: 600 !important;
}

.wc-block-components-quantity-selector__button {
    background-color: #f8fafc !important;
    border: none !important;
    color: #475569 !important;
    transition: all 0.15s ease;
}

.wc-block-components-quantity-selector__button:hover {
    background-color: #e2e8f0 !important;
    color: #0f172a !important;
}

/* Block cart remove item */
.wc-block-cart-item__remove-link {
    color: #dc2626 !important;
    font-size: 0.75rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    transition: all 0.15s ease;
}

.wc-block-cart-item__remove-link:hover {
    color: #b91c1c !important;
    text-decoration: none !important;
}

/* Block form inputs */
.wc-block-components-text-input input,
.wc-block-components-text-input textarea,
.wc-block-components-select__input {
    border: 1px solid #d1d5db !important;
    border-radius: 0.5rem !important;
    padding: 0.75rem 1rem !important;
    transition: all 0.15s ease;
}

.wc-block-components-text-input input:focus,
.wc-block-components-text-input textarea:focus,
.wc-block-components-select__input:focus {
    border-color: #2563eb !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1) !important;
    outline: none !important;
}

/* Block payment method radio buttons */
.wc-block-components-radio-control__input {
    accent-color: #1e293b !important;
}

.wc-block-components-radio-control-accordion-option {
    border: 1px solid #e5e7eb !important;
    border-radius: 0.5rem !important;
    margin-bottom: 0.5rem !important;
    transition: all 0.15s ease;
}

.wc-block-components-radio-control-accordion-option--checked {
    border-color: #1e293b !important;
    background-color: #f8fafc !important;
}

/* ============================================
   MY ACCOUNT PAGES
   ============================================ */

/* Account navigation */
.woocommerce-MyAccount-navigation {
    background-color: #f8fafc;
    border-radius: 0.75rem;
    padding: 1rem;
    margin-bottom: 2rem;
    border: 1px solid #e5e7eb;
}

.woocommerce-MyAccount-navigation ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

@media (max-width: 768px) {
    .woocommerce-MyAccount-navigation ul {
        flex-direction: column;
    }
}

.woocommerce-MyAccount-navigation ul li {
    margin: 0;
}

.woocommerce-MyAccount-navigation ul li a {
    display: block;
    padding: 0.75rem 1.25rem;
    color: #475569;
    font-weight: 500;
    font-size: 0.875rem;
    border-radius: 0.5rem;
    transition: all 0.15s ease;
}

.woocommerce-MyAccount-navigation ul li a:hover {
    background-color: #e2e8f0;
    color: #0f172a;
}

.woocommerce-MyAccount-navigation ul li.is-active a {
    background-color: #1e293b;
    color: #fff;
}

/* Account content */
.woocommerce-MyAccount-content {
    background-color: #fff;
    border-radius: 0.75rem;
    padding: 2rem;
    border: 1px solid #e5e7eb;
}

/* Account forms */
.woocommerce-EditAccountForm p {
    margin-bottom: 1.5rem;
}

.woocommerce-EditAccountForm label {
    display: block;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.woocommerce-EditAccountForm input[type="text"],
.woocommerce-EditAccountForm input[type="email"],
.woocommerce-EditAccountForm input[type="password"] {
    width: 100%;
    max-width: 400px;
    padding: 0.75rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    transition: all 0.15s ease;
}

.woocommerce-EditAccountForm input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Orders table */
.woocommerce-orders-table {
    width: 100%;
    border-collapse: collapse;
}

.woocommerce-orders-table th {
    text-align: left;
    padding: 1rem;
    font-weight: 600;
    color: #374151;
    border-bottom: 2px solid #e5e7eb;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.woocommerce-orders-table td {
    padding: 1rem;
    border-bottom: 1px solid #f3f4f6;
    font-size: 0.875rem;
}

.woocommerce-orders-table .woocommerce-orders-table__cell-order-actions a {
    display: inline-block;
    padding: 0.5rem 1rem;
    background-color: #f1f5f9;
    color: #475569;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 0.375rem;
    margin-right: 0.5rem;
    margin-bottom: 0.25rem;
    transition: all 0.15s ease;
}

.woocommerce-orders-table .woocommerce-orders-table__cell-order-actions a:hover {
    background-color: #1e293b;
    color: #fff;
}

/* ============================================
   LOGIN / REGISTER FORMS
   ============================================ */

.woocommerce-form-login,
.woocommerce-form-register {
    background-color: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 2rem;
    max-width: 400px;
}

.woocommerce-form-login p,
.woocommerce-form-register p {
    margin-bottom: 1.25rem;
}

.woocommerce-form-login label,
.woocommerce-form-register label {
    display: block;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.woocommerce-form-login input[type="text"],
.woocommerce-form-login input[type="email"],
.woocommerce-form-login input[type="password"],
.woocommerce-form-register input[type="text"],
.woocommerce-form-register input[type="email"],
.woocommerce-form-register input[type="password"] {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    transition: all 0.15s ease;
}

.woocommerce-form-login input:focus,
.woocommerce-form-register input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Remember me checkbox */
.woocommerce-form-login .woocommerce-form-login__rememberme {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.woocommerce-form-login .woocommerce-form-login__rememberme input {
    width: auto;
    accent-color: #1e293b;
}

.woocommerce-form-login .woocommerce-form-login__rememberme span {
    font-size: 0.875rem;
    color: #475569;
}

/* Lost password link */
.woocommerce-LostPassword a {
    color: #2563eb;
    font-size: 0.875rem;
}

.woocommerce-LostPassword a:hover {
    text-decoration: underline;
}

/* ============================================
   PRODUCT CARDS (Shop Grid)
   ============================================ */

/* Uniform product card heights */
.products .product {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.products .product .woocommerce-loop-product__link {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.products .product .woocommerce-loop-product__title {
    min-height: 2.5rem;
    line-height: 1.25;
}

/* Product image consistency */
.products .product img {
    background-color: #f8fafc;
    object-fit: contain;
}

/* Add to cart button on grid */
.products .product .add_to_cart_button,
.products .product .product_type_variable {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1rem;
    background-color: #1e293b;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 0.5rem;
    margin-top: auto;
    transition: all 0.15s ease;
}

.products .product .add_to_cart_button:hover,
.products .product .product_type_variable:hover {
    background-color: #0f172a;
}

/* ============================================
   SINGLE PRODUCT PAGE
   ============================================ */

/* Fix strikethrough price display */
.woocommerce-variation-price del,
.product .price del {
    color: #9ca3af;
    font-size: 0.875em;
}

/* Hide zero price strikethrough */
.woocommerce-variation-price del .woocommerce-Price-amount:has([data-price="0"]),
.product .price del:has(.woocommerce-Price-amount[data-price="0"]) {
    display: none;
}

/* Quantity input styling */
.single-product .quantity {
    display: inline-flex;
    align-items: center;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    overflow: hidden;
}

.single-product .quantity input[type="number"] {
    border: none;
    width: 3rem;
    text-align: center;
    font-weight: 600;
    padding: 0.5rem;
}

.single-product .quantity input[type="number"]::-webkit-inner-spin-button,
.single-product .quantity input[type="number"]::-webkit-outer-spin-button {
    opacity: 1;
}

/* Breadcrumbs styling */
.woocommerce-breadcrumb {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 1.5rem;
}

.woocommerce-breadcrumb a {
    color: #475569;
    transition: color 0.15s ease;
}

.woocommerce-breadcrumb a:hover {
    color: #2563eb;
}

.woocommerce-breadcrumb .breadcrumb-separator {
    margin: 0 0.5rem;
    color: #9ca3af;
}

/* ============================================
   SIDEBAR FIXES
   ============================================ */

/* Hide empty category counts */
.widget_product_categories .cat-item .count:is([textContent="(0)"]) {
    display: none;
}

/* Price filter styling */
.widget_price_filter .price_slider_wrapper {
    padding: 1rem 0;
}

.widget_price_filter .price_slider {
    background-color: #e2e8f0 !important;
    height: 4px !important;
    border-radius: 2px !important;
}

.widget_price_filter .ui-slider-range {
    background-color: #1e293b !important;
}

.widget_price_filter .ui-slider-handle {
    width: 16px !important;
    height: 16px !important;
    background-color: #1e293b !important;
    border-radius: 50% !important;
    border: 2px solid #fff !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
    top: -6px !important;
}

/* ============================================
   EMPTY STATES
   ============================================ */

.woocommerce-info,
.woocommerce-message,
.woocommerce-error {
    padding: 1.5rem;
    border-radius: 0.75rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.woocommerce-info {
    background-color: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
}

.woocommerce-message {
    background-color: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

.woocommerce-error {
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
}

.woocommerce-info a,
.woocommerce-message a {
    background-color: #1e293b;
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.15s ease;
}

.woocommerce-info a:hover,
.woocommerce-message a:hover {
    background-color: #0f172a;
}

/* No posts found / empty blog */
.no-results {
    text-align: center;
    padding: 4rem 2rem;
}

.no-results .page-title {
    font-size: 1.5rem;
    color: #374151;
    margin-bottom: 1rem;
}

.no-results .page-content p {
    color: #6b7280;
    margin-bottom: 1.5rem;
}

/* ============================================
   HEADER BUTTON CONSISTENCY
   ============================================ */

/* Make My Account and Logout consistent */
.header-account-link,
.site-header .woocommerce-MyAccount-link {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #475569;
    transition: all 0.15s ease;
}

.header-account-link:hover,
.site-header .woocommerce-MyAccount-link:hover {
    color: #0f172a;
}

/* ============================================
   SEARCH DROPDOWN STYLING
   ============================================ */

.header-search select,
.site-header .search-form select {
    appearance: none;
    background-color: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-left: none;
    padding: 0.625rem 2rem 0.625rem 1rem;
    font-size: 0.875rem;
    color: #475569;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.25em 1.25em;
    transition: all 0.15s ease;
}

.header-search select:focus,
.site-header .search-form select:focus {
    outline: none;
    border-color: #2563eb;
    background-color: #fff;
}

/* ============================================
   WP BLOCK EDITOR COMPATIBILITY
   ============================================ */

/* Cart block link styling */
.wc-block-cart .wc-block-components-product-name {
    color: #0f172a !important;
    font-weight: 600;
}

.wc-block-cart .wc-block-components-product-name:hover {
    color: #2563eb !important;
}

/* Checkout express payment buttons */
.wc-block-components-express-payment__event-buttons button {
    border-radius: 0.5rem !important;
}

/* Order summary styling */
.wc-block-components-order-summary {
    border: 1px solid #e5e7eb !important;
    border-radius: 0.75rem !important;
    overflow: hidden;
}

.wc-block-components-order-summary-item__image img {
    border-radius: 0.5rem !important;
}

/* Coupon toggle */
.wc-block-components-totals-coupon__button {
    background-color: #1e293b !important;
    color: #fff !important;
    border-radius: 0.5rem !important;
    padding: 0.5rem 1rem !important;
}

.wc-block-components-totals-coupon__button:hover {
    background-color: #0f172a !important;
}

/* Link to cart from checkout */
.wc-block-checkout__actions_row a {
    color: #2563eb;
    font-size: 0.875rem;
}

.wc-block-checkout__actions_row a:hover {
    text-decoration: underline;
}

/* ============================================
   CSS FIXES v1.2.0 - Audit Issues Resolution
   ============================================ */

/* --------------------------------------------
   FIX #1: Product Name Truncation with Tooltips
   Shows full name on hover, prevents text cutoff
   -------------------------------------------- */

/* Product cards - show full title with ellipsis and tooltip */
.ivmp-product-card .iv-product-title,
.products .product .woocommerce-loop-product__title,
.iv-product-card h3 a {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 2.5rem;
    line-height: 1.25;
}

/* Ensure parent has title attribute for native tooltip */
.ivmp-product-card .iv-product-title[title],
.products .product .woocommerce-loop-product__title[title] {
    cursor: pointer;
}

/* Custom tooltip on hover for truncated text */
.ivmp-product-card:hover .iv-product-title,
.products .product:hover .woocommerce-loop-product__title {
    -webkit-line-clamp: unset;
    line-clamp: unset;
    overflow: visible;
    position: relative;
    z-index: 10;
    background: white;
    padding: 0.25rem;
    margin: -0.25rem;
    border-radius: 0.25rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* --------------------------------------------
   FIX #2: Consistent Badge Positioning
   All badges appear top-left with consistent spacing
   -------------------------------------------- */

/* Standardize badge container positioning */
.ivmp-product-card,
.products .product,
.iv-product-card {
    position: relative;
}

/* All badges: Sale, New, Featured - consistent top-left */
.ivmp-product-card .iv-badge,
.products .product .onsale,
.iv-product-card .badge,
.ivmp-badge,
.woocommerce span.onsale {
    position: absolute !important;
    top: 0.75rem !important;
    left: 0.75rem !important;
    right: auto !important;
    z-index: 5;
    padding: 0.25rem 0.75rem;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    border-radius: 0.375rem;
}

/* Sale badge - red styling */
.products .product .onsale,
.woocommerce span.onsale {
    background-color: #dc2626 !important;
    color: white !important;
}

/* New badge - blue styling */
.ivmp-badge.new,
.iv-badge.new {
    background-color: #2563eb !important;
    color: white !important;
}

/* Featured badge - amber styling */
.ivmp-badge.featured,
.iv-badge.featured {
    background-color: #f59e0b !important;
    color: white !important;
}

/* Stack multiple badges vertically */
.ivmp-product-card .iv-badge:nth-child(2),
.products .product .onsale+.iv-badge {
    top: 2.5rem !important;
}

/* --------------------------------------------
   FIX #3: Hide Empty Category Counts
   Categories with 0 products are hidden
   -------------------------------------------- */

/* Hide categories with zero count in sidebar */
.iv-sidebar .iv-category-item .count-zero,
.iv-sidebar .iv-category-item:has(.iv-cat-count:empty),
.widget_product_categories .cat-item:has(.count:contains("(0)")),
.iv-sidebar .iv-child-link:has([data-count="0"]) {
    display: none;
}

/* Alternative: Just hide the (0) text, keep category visible */
.iv-cat-count:empty,
.iv-sidebar .iv-cat-count[data-count="0"],
.iv-sidebar span:contains("- 0") {
    visibility: hidden;
    width: 0;
}

/* Style for categories with products - add subtle count badge */
.iv-sidebar .iv-cat-count {
    font-size: 0.75rem;
    color: #6b7280;
    margin-left: 0.25rem;
}

/* --------------------------------------------
   FIX #4: Feature Card Equal Heights
   Cards stretch to match tallest in row
   -------------------------------------------- */

/* Product description feature cards - equal heights */
.prose [style*="display: grid"] {
    align-items: stretch;
}

.prose [style*="display: grid"]>div {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.prose [style*="display: grid"]>div p:last-child {
    margin-top: auto;
}

/* Specific fix for feature-card style grids */
.feature-grid,
.feature-teaser-list,
[class*="feature-grid"] {
    align-items: stretch !important;
}

.feature-card,
.feature-teaser-item,
[class*="feature-card"] {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
}

.feature-card p,
.feature-teaser-item p,
[class*="feature-card"] p:last-of-type {
    flex-grow: 1;
}

/* --------------------------------------------
   FIX #5: Unified Search Bar Styling
   Consistent borders and radii across input, dropdown, button
   -------------------------------------------- */

/* Search bar container - unified styling */
.iv-header .iv-search-form,
.iv-search-bar,
header .search-form {
    display: flex;
    align-items: stretch;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    overflow: hidden;
    background-color: #f8fafc;
    transition: all 0.15s ease;
}

.iv-header .iv-search-form:focus-within,
.iv-search-bar:focus-within {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Search input - remove individual borders */
.iv-header .iv-search-input,
.iv-search-bar input[type="search"],
.iv-search-bar input[type="text"] {
    border: none !important;
    background: transparent !important;
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    flex-grow: 1;
    min-width: 200px;
}

.iv-header .iv-search-input:focus,
.iv-search-bar input:focus {
    outline: none !important;
    box-shadow: none !important;
}

/* Search dropdown - unified border */
.iv-header .iv-search-select,
.iv-search-bar select {
    border: none !important;
    border-left: 1px solid #e2e8f0 !important;
    background-color: transparent !important;
    padding: 0.625rem 2rem 0.625rem 1rem;
    font-size: 0.875rem;
    color: #475569;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.25em 1.25em;
}

/* Search button - unified styling */
.iv-header .iv-search-btn,
.iv-search-bar button[type="submit"] {
    border: none !important;
    border-left: 1px solid #e2e8f0 !important;
    background-color: #2563eb !important;
    color: white !important;
    padding: 0.625rem 1.25rem;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background-color 0.15s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.iv-header .iv-search-btn:hover,
.iv-search-bar button[type="submit"]:hover {
    background-color: #1d4ed8 !important;
}

/* --------------------------------------------
   FIX #6: Category Name Capitalization (via CSS)
   Proper case styling for category labels
   -------------------------------------------- */

/* Capitalize first letter of all category names */
.iv-sidebar .iv-category-item,
.iv-sidebar .iv-child-link,
.woocommerce-breadcrumb a,
.iv-badge-category {
    text-transform: capitalize;
}

/* Specific fix for "woo" category - show as "WooCommerce" */
.iv-badge-category[data-category="woo"],
.woocommerce-breadcrumb a[href*="/woo/"] {
    text-transform: uppercase;
    font-variant: small-caps;
}