/*
Theme Name: Barkat Store
Theme URI: https://example.com/barkat-store
Author: Antigravity
Author URI: https://google.com
Description: A simple, clean e-commerce theme inspired by major retailers but using a generic, Safe-for-Work color palette. No banners, purely product focused.
Version: 1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: flipkart-lite
*/

:root {
    /* Core Palette */
    --primary-color: #2563eb;
    --secondary-color: #fbbf24;
    --success-color: #10b981;
    --danger-color: #ef4444;

    /* Light Theme (Default) */
    --bg-body: #f3f4f6;
    --bg-card: #ffffff;
    --bg-input: #f9fafb;
    --text-main: #1f2937;
    --text-muted: #4b5563;
    --border-color: #e5e7eb;
    --border-focus: rgba(37, 99, 235, 0.1);
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);

    /* Spacing */
    --container-width: 1200px;
    --header-height: 64px;
}

/* Dark Mode Palette Variables */
.dark-mode {
    --bg-body: #111827;
    --bg-card: #1f2937;
    --bg-input: #374151;
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --border-color: #4b5563;
}

/* --- DARK MODE GLOBAL OVERRIDES --- */
body.dark-mode {
    background-color: var(--bg-body) !important;
    color: var(--text-main) !important;
}

body.dark-mode .site-header {
    background-color: #1f2937;
    border-bottom: 1px solid var(--border-color);
}

/* --- GLOBAL HERO SLIDER --- */
.hero-slider-section {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 2rem;
}

.hero-slider-container {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-behavior: smooth;
}

.hero-slider-container::-webkit-scrollbar {
    display: none;
}

.hero-slide {
    min-width: 100%;
    scroll-snap-align: start;
    position: relative;
    overflow: hidden;
}

.hero-slide img {
    width: 100%;
    display: block;
    height: 550px;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.hero-btn {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 30px;
    padding: 12px 30px;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    z-index: 10;
    transition: all 0.3s ease;
    border-radius: 4px;
}

.hero-btn:hover {
    transform: translateX(-50%) translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
    background-color: #1d4ed8;
}

.hero-slider-section .slider-arrow {
    opacity: 0;
    transition: opacity 0.3s ease, background 0.2s, transform 0.2s;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 20;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.hero-slider-section:hover .slider-arrow {
    opacity: 1;
}

.slider-arrow.prev-hero {
    left: 20px;
}

.slider-arrow.next-hero {
    right: 20px;
}

.slider-arrow:hover {
    background: #fff;
    transform: translateY(-50%) scale(1.1);
}

/* Card & Containers Backgrounds (Dark Mode) */
body.dark-mode .card,
body.dark-mode .woocommerce-cart-form,
body.dark-mode .cart-collaterals .cart_totals,
body.dark-mode #customer_details,
body.dark-mode #order_review,
body.dark-mode .woocommerce-MyAccount-navigation ul,
body.dark-mode .woocommerce-MyAccount-content,
body.dark-mode .widget,
body.dark-mode .product-slider-section,
body.dark-mode .category-slider-section,
body.dark-mode .woocommerce-EditAccountForm fieldset,
body.dark-mode .woocommerce-address-fields__field-wrapper,
body.dark-mode .woocommerce-checkout-review-order-table,
body.dark-mode #payment,
body.dark-mode #payment div.payment_box {
    background-color: var(--bg-card) !important;
    border-color: var(--border-color) !important;
    color: var(--text-main);
    box-shadow: none !important;
    border: 1px solid var(--border-color) !important;
}

/* Sliders (Product Cards) (Dark Mode) */
body.dark-mode ul.products li.product,
body.dark-mode .woocommerce ul.products li.product {
    background-color: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
}

/* Headings & Text in Dark Mode */
body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3,
body.dark-mode h4,
body.dark-mode h5,
body.dark-mode h6,
body.dark-mode p,
body.dark-mode li,
body.dark-mode span,
body.dark-mode strong,
body.dark-mode label,
body.dark-mode .woocommerce-MyAccount-navigation-link a,
body.dark-mode .woocommerce-loop-product__title,
body.dark-mode .widget-title,
body.dark-mode a:not(.btn) {
    color: var(--text-main);
}

body.dark-mode .text-muted,
body.dark-mode .price del,
body.dark-mode .woocommerce-info,
body.dark-mode .woocommerce-message {
    color: var(--text-muted) !important;
}

body.dark-mode ul.products li.product .price,
body.dark-mode ul.products li.product .price ins {
    color: var(--text-main) !important;
}

/* Inputs & Forms (Dark Mode) */
body.dark-mode input[type="text"],
body.dark-mode input[type="password"],
body.dark-mode input[type="email"],
body.dark-mode input[type="search"],
body.dark-mode textarea,
body.dark-mode select,
body.dark-mode .select2-selection {
    background-color: var(--bg-input) !important;
    border-color: var(--border-color) !important;
    color: var(--text-main) !important;
}

body.dark-mode input::placeholder {
    color: var(--text-muted);
}

/* My Account Specifics (Dark Mode) */
body.dark-mode .woocommerce-MyAccount-navigation ul li {
    border-color: var(--border-color);
}

body.dark-mode .woocommerce-MyAccount-navigation ul li.is-active a {
    background-color: #374151;
    color: var(--primary-color) !important;
}

body.dark-mode .account-welcome-banner h2 {
    color: var(--text-main) !important;
}

/* Tables (Dark Mode) */
body.dark-mode table,
body.dark-mode th,
body.dark-mode td,
body.dark-mode thead tr,
body.dark-mode tbody tr {
    background-color: transparent !important;
    color: var(--text-main) !important;
    border-color: var(--border-color) !important;
}

body.dark-mode .shop_table thead,
body.dark-mode .woocommerce-orders-table__header {
    background-color: var(--bg-input) !important;
}

/* Mobile Menu Button (Dark Mode) */
body.dark-mode .account-mobile-menu-toggle {
    background-color: var(--bg-card);
    border-color: var(--border-color);
    color: var(--text-main);
}

/* Fix Header Icons in Dark Mode */
body.dark-mode .header-nav a.text-white {
    color: var(--text-main) !important;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.5;
    transition: background-color 0.3s ease, color 0.3s ease;
}

a {
    text-decoration: none;
    color: inherit;
}

/* Utilities (Bootstrap overrides or additions) */
/* .container and .btn are handled by Bootstrap now */

/* Custom Button Enhancement */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: #1d4ed8;
    border-color: #1d4ed8;
}

/* Header Styles */
.site-header {
    background-color: var(--primary-color);
    color: var(--white);
    height: var(--header-height);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.site-logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--white);
    font-style: italic;
}

.site-logo span {
    color: var(--secondary-color);
    font-style: normal;
}

.header-search {
    flex: 1;
    margin: 0 2rem;
    max-width: 600px;
    display: flex;
}

.header-search input {
    width: 100%;
    padding: 0.6rem 1rem;
    border: none;
    border-radius: 2px 0 0 2px;
    font-size: 0.95rem;
}

.header-search button {
    background-color: var(--white);
    /* Or a highlight color */
    border: none;
    padding: 0 1rem;
    border-radius: 0 2px 2px 0;
    cursor: pointer;
    color: var(--primary-color);
}

.header-nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.header-nav a {
    color: var(--white);
    font-weight: 500;
}

/* Product Grid (Flipkart-lite) */
/* Product Grid (Flipkart-lite) - Enforce Grid over Flex */
.woocommerce ul.products.product-grid,
.product-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)) !important;
    gap: 1.5rem !important;
    padding: 1rem 0;
    margin: 0 !important;
}

.woocommerce ul.products.product-grid li.product,
.product-grid li.product {
    width: auto !important;
    /* Reset WC width */
    margin: 0 !important;
    /* Reset WC margins */
    /* Reset floats */
}

/* Fix: Remove WC clearfix pseudo-elements from Grid Layout */
.woocommerce ul.products.product-grid::before,
.woocommerce ul.products.product-grid::after,
.product-grid::before,
.product-grid::after {
    content: none !important;
    display: none !important;
}

/* WooCommerce Overrides (Minimal) */
.woocommerce ul.products li.product {
    background: var(--white);
    padding: 1rem;
    border-radius: 4px;
    transition: box-shadow 0.2s;
    text-align: center;
}

.woocommerce ul.products li.product:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.woocommerce ul.products li.product img {
    margin-bottom: 1rem;
    max-height: 200px;
    object-fit: contain;
}

.woocommerce ul.products li.product .woocommerce-loop-product__title {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-main);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.woocommerce ul.products li.product .price {
    color: var(--text-main);
    font-weight: 700;
    font-size: 1.1rem;
    display: block;
    margin-bottom: 0.5rem;
}

/* --- Animations --- */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-up {
    animation: fadeUp 0.6s ease-out forwards;
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-8px);
    }

    60% {
        transform: translateY(-4px);
    }
}

.animate-bounce {
    animation: bounce 2s infinite;
    display: inline-block;
}

/* Promo Banner Details */
.promo-item {
    position: relative;
}

.promo-btn {
    position: absolute;
    bottom: 15px;
    /* Position at bottom left */
    left: 15px;
    padding: 8px 16px;
    font-size: 0.85rem;
    opacity: 0.9;
    transition: all 0.3s;
    z-index: 5;
}

.promo-item:hover .promo-btn {
    opacity: 1;
    transform: translateY(-2px);
}

/* Mobile Responsiveness - Header & Grid */
@media (max-width: 768px) {
    /* Header Styles are now consolidated in the bottom media query block for cleaner management */

    /* Grid Adjustments */
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .woocommerce ul.products li.product {
        padding: 0.5rem;
    }

    .category-slider-section {
        margin-top: -1px;
    }

    /* Scrollable Menu */
    .primary-menu-ul {
        display: flex;
        overflow-x: auto;
        padding-bottom: 5px;
        width: 100%;
    }
}

/* Hero slider duplicate properties removed */

/* Professional Product Slider */
.product-slider-wrapper {
    overflow-x: auto;
    padding: 10px 5px 20px 5px;
    /* Padding for shadow breathing room */
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) #f0f0f0;
    -webkit-overflow-scrolling: touch;
}

ul.products.product-slider {
    display: flex !important;
    gap: 16px;
    margin: 0 !important;
    padding: 0 !important;
}

ul.products.product-slider li.product {
    min-width: 240px;
    /* Widened to match typical grid card better */
    max-width: 240px;

    /* Inherit Visuals from global .woocommerce ul.products li.product */
    /* background, border, radius handled globally now */

    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    /* No overflow hidden here to allow shadow/lift effect to show */
    margin-right: 15px;
    /* Spacing between slides */
    padding: 10px;
    /* Default woocommerce padding usually */
}

/* Ensure images fit well in the slider card */
ul.products.product-slider li.product img {
    height: 200px;
    /* Fixed height for alignment */
    width: 100%;
    object-fit: contain;
    margin-bottom: 10px;
}

/* --- Global Product Card Styling & Animation --- */
.woocommerce ul.products li.product {
    /* Base style handled above, adding transition */
    transition: all 0.3s ease;
    border: 1px solid #e5e7eb;
    /* Ensure border is present */
    border-radius: 8px;
    position: relative;
    /* Context for wishlist */
    overflow: hidden;
}

/* Hover Effect: Lift and Shadow (Global) */
.woocommerce ul.products li.product:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
    border-color: transparent;
    z-index: 2;
    /* Lift above neighbors */
}

/* Image Zoom (Global) */
.woocommerce ul.products li.product img {
    transition: transform 0.3s ease;
}

.woocommerce ul.products li.product:hover img {
    transform: scale(1.05);
}

/* --- Wishlist Button --- */
.wishlist-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    background: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s;
    border: 1px solid #f3f4f6;
    color: #cbd5e1;
    /* Gray by default */
}

.wishlist-btn:hover {
    background: #fef2f2;
    color: #ef4444;
    /* Red on hover */
    transform: scale(1.1);
}

.wishlist-btn.active {
    color: #ef4444;
    fill: #ef4444;
}

.wishlist-btn svg {
    width: 18px;
    height: 18px;
    stroke-width: 2;
}

/* --- Arrow Visibility Fix --- */
.slider-arrow {
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    /* Stronger shadow */
    z-index: 50;
    /* Ensure visible */
    opacity: 0.9;
}

.cat-slider-wrapper {
    position: relative;
    /* Context for arrows */
}

/* Promo Banner Hover */
.hover-scale {
    overflow: hidden;
    border-radius: 8px;
    /* Ensure rounded corners */
}

.hover-scale img {
    transition: transform 0.3s ease;
    height: 180px;
    /* Reduced fixed height for professional look */
    width: 100%;
    object-fit: cover;
    /* Crop to fit */
}

.hover-scale:hover img {
    transform: scale(1.03);
    /* Subtle zoom effect */
}

/* Title Styling */
ul.products.product-slider li.product .woocommerce-loop-product__title {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-main);
    line-height: 1.4;
    margin-bottom: 8px;

    /* Line Clamp 2 lines */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 2.8em;
    /* Force height for alignment */
}

/* Price Styling */
ul.products.product-slider li.product .price {
    font-size: 1.1rem;
    font-weight: 700;
    color: #111;
    margin-top: auto;
    /* Push to bottom */
}

ul.products.product-slider li.product .price del {
    color: #9ca3af;
    font-weight: 400;
    font-size: 0.85rem;
    margin-right: 5px;
}

/* Button/Add to Cart Styling (If visible) */
ul.products.product-slider li.product .button {
    margin-top: 10px;
    background: var(--primary-color);
    color: #fff;
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    width: 100%;
    transition: background 0.2s;
}

ul.products.product-slider li.product .button:hover {
    background: #1d4ed8;
}

/* Mobile Adjustments */
@media (max-width: 991px) {

    /* Tablet Layout Adjustments */
    :root {
        --container-width: 100%;
        --header-height: auto;
    }

    .site-header .container {
        padding: 0.5rem 1rem;
    }

    .hero-slide img {
        height: 350px !important;
        /* Intermediate height for tablets */
    }
}

@media (max-width: 768px) {

    /* 1. Header & Layout */
    .site-header {
        height: auto;
        padding: 0.5rem 0;
    }

    .header-inner {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .site-logo {
        font-size: 1.25rem;
        /* Smaller logo on mobile */
    }

    /* Search bar takes full width on new line */
    .header-search {
        width: 100%;
        margin: 0.5rem 0;
        order: 3;
        flex-basis: 100%;
    }

    /* User actions (Cart, Login) align to right */
    .header-nav {
        order: 2;
        margin-left: auto;
    }

    /* 2. Slider Cards Mobile */
    ul.products.product-slider li.product {
        min-width: 150px;
        max-width: 150px;
        width: 45vw;
        /* Responsive half-screen approx */
        padding: 8px !important;
    }

    ul.products.product-slider li.product img {
        height: 140px;
    }

    ul.products.product-slider li.product .woocommerce-loop-product__title {
        font-size: 0.85rem;
        height: 2.4em;
        /* compressed height */
    }

    ul.products.product-slider li.product .price {
        font-size: 0.95rem;
    }

    /* Hero Slider Mobile Height */
    .hero-slide img {
        height: 200px !important;
        /* Smaller height for mobile */
    }

    .hero-btn {
        padding: 8px 16px;
        font-size: 0.8rem;
        bottom: 15px;
    }

    /* 3. Slider Arrows on Mobile */
    .slider-arrow {
        display: flex !important;
        /* Force Show */
        width: 30px;
        height: 30px;
        font-size: 1rem;
        opacity: 0.8;
    }

    .slider-arrow.prev {
        left: -5px;
    }

    .slider-arrow.next {
        right: -5px;
    }

    /* Category specific arrows mobile placement */
    .slider-arrow.prev-cat {
        left: -5px;
    }

    .slider-arrow.next-cat {
        right: -5px;
    }

    /* 4. General Spacing */
    .container-xl-custom {
        padding-left: 5px !important;
        padding-right: 5px !important;
    }
}

/* --- Professional Trust Section --- */
.trust-section {
    background: #fff;
    border-top: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
}

.trust-item {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    color: #374151;
}

.trust-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
    background: #eff6ff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.trust-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
    font-size: 0.95rem;
}

.trust-desc {
    font-size: 0.8rem;
    color: #6b7280;
}

/* --- Slider Arrows --- */
.slider-container-relative {
    position: relative;
}

.slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid #e5e7eb;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 20;
    transition: all 0.2s;
    font-size: 1.2rem;
    line-height: 1;
    color: #374151;
}

.slider-arrow:hover {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

.slider-arrow.prev {
    left: -15px;
}

.slider-arrow.next {
    right: -15px;
}

/* Hide scrollbar but allow scroll */
.product-slider-wrapper {
    scrollbar-width: none !important;
}

.product-slider-wrapper::-webkit-scrollbar {
    display: none !important;
}

/* --- Category Slider Inline (Clean) --- */
.cat-item-wrapper {
    /* No relative needed since no dropdown */
    margin-bottom: 0.5rem;
}

/* --- Professional My Account / Dashboard Styles --- */

/* 1. Dashboard Grid Layout (Horizontal Tabs Refactor) */
.woocommerce-account .woocommerce {
    display: flex;
    flex-direction: column;
    /* Stack vertically: Nav on top, Content below */
    gap: 1.5rem;
}

/* Navigation Container */
.woocommerce-account .woocommerce-MyAccount-navigation {
    flex: 0 0 auto;
    width: 100%;
    max-width: 100%;
}

@media (min-width: 992px) {
    .woocommerce-account .woocommerce-MyAccount-navigation {
        flex: 0 0 auto;
        max-width: 100%;
        margin-bottom: 1rem;
    }

    .woocommerce-account .woocommerce-MyAccount-content {
        flex: 1;
        width: 100%;
    }
}

/* Nav Item Styling (Horizontal Bar) */
.woocommerce-MyAccount-navigation ul {
    list-style: none;
    padding: 0;
    margin: 0;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    display: flex;
    /* Horizontal alignment */
    overflow-x: auto;
    /* Scrollable if too many items */
    white-space: nowrap;
    border: 1px solid #f3f4f6;
}

.woocommerce-MyAccount-navigation ul li {
    border-bottom: none;
    border-right: 1px solid #f3f4f6;
    /* Separators */
    flex: 1;
    /* Distribute space */
    text-align: center;
}

.woocommerce-MyAccount-navigation ul li:last-child {
    border-right: none;
}

.woocommerce-MyAccount-navigation ul li a {
    display: block;
    padding: 1rem 1.5rem;
    color: #4b5563;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
    border-bottom: 3px solid transparent;
    /* Bottom active indicator */
}

.woocommerce-MyAccount-navigation ul li a:hover {
    background: #f9fafb;
    color: var(--primary-color);
    padding-left: 1.5rem;
    /* Reset padding shift from previous Sidebar style */
}

/* Active State Highlighting */
.woocommerce-MyAccount-navigation ul li.is-active a {
    background: #eff6ff;
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}


/* Content Area Styling */
.woocommerce-account .woocommerce-MyAccount-content {
    background: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Headings */
.woocommerce-account h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: #111;
}

/* Forms (Address, etc) */
.woocommerce-EditAccountForm fieldset,
.woocommerce-address-fields__field-wrapper {
    background: #f9fafb;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

/* Orders Table Professionalism */
.woocommerce-orders-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.woocommerce-orders-table th {
    background: #f3f4f6;
    padding: 1rem;
    font-weight: 600;
    text-align: left;
}

.woocommerce-orders-table td {
    border-bottom: 1px solid #f3f4f6;
    padding: 1rem;
    vertical-align: middle;
}

.woocommerce-orders-table__cell-order-actions .button {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    background: #fff;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    border-radius: 4px;
}


/* --- FINAL FIXES V1.4.4 --- */

/* 1. Category Slider Arrow Positioning */
.slider-arrow.prev-cat {
    left: -10px;
    /* Slight overlap */
    top: 50%;
    transform: translateY(-50%);
}

.slider-arrow.next-cat {
    right: -10px;
    top: 50%;
    transform: translateY(-50%);
}

/* 2. FORCE Sale Badge to Top Left relative to Card */
/* Ensure the card is relative positioning context */
ul.products li.product,
.woocommerce ul.products li.product,
ul.products.product-slider li.product {
    position: relative !important;
    overflow: visible !important;
    /* Allow badge to sit on edge if needed */
}

/* The Badge Itself */
span.onsale,
.woocommerce span.onsale,
ul.products.product-slider li.product .onsale {
    top: 0 !important;
    left: 0 !important;
    right: auto !important;
    bottom: auto !important;
    margin: 0 !important;
    position: absolute !important;

    /* Design */
    background: #26a541 !important;
    /* Green */
    color: #fff !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    padding: 4px 8px !important;
    border-radius: 4px 0 8px 0 !important;
    z-index: 99 !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
    line-height: 1 !important;
    min-height: auto !important;
    width: auto !important;
    display: block !important;
}


/* --- PROFESSIONAL CART & CHECKOUT STYLES (V1.4.7) --- */

/* --- 1. Cart Page Styling --- */
/* Increase Width for Cart Page */
.woocommerce-cart .container {
    max-width: 95% !important;
}

.woocommerce-cart .woocommerce {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
}

/* Cart Table Container */
.woocommerce-cart .woocommerce-cart-form {
    flex: 1 1 65%;
    /* Take up 65% width */
    background: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
    border: 1px solid #e5e7eb;
}

/* Cart Tabular Data */
.shop_table.cart {
    border: none !important;
    border-collapse: separate;
    border-spacing: 0 1rem;
    /* Spacing between rows */
}

.shop_table.cart thead {
    background: #f9fafb;
    border-bottom: 2px solid #e5e7eb;
}

.shop_table.cart th {
    padding: 1rem !important;
    font-weight: 600;
    color: #4b5563;
    text-transform: uppercase;
    font-size: 0.85rem;
    border: none;
}

.shop_table.cart tbody tr {
    /* Row styling usually tricky in tables, but we can style cells */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    background: #fff;
}

.shop_table.cart td {
    border-top: 1px solid #f3f4f6;
    border-bottom: 1px solid #f3f4f6;
    padding: 1.5rem 1rem !important;
    vertical-align: middle;
}

.shop_table.cart td:first-child {
    border-left: 1px solid #f3f4f6;
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
}

.shop_table.cart td:last-child {
    border-right: 1px solid #f3f4f6;
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
}

/* Product Thumb in Cart */
.shop_table.cart img {
    width: 64px !important;
    height: 64px !important;
    border-radius: 6px;
    object-fit: cover;
}

/* Coupon & Update Cart */
.actions {
    padding: 1.5rem 0 !important;
    background: transparent !important;
    border: none !important;
}

.coupon {
    display: flex;
    gap: 10px;
}

.coupon input {
    border: 1px solid #d1d5db;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    min-width: 200px;
}

/* Cart Totals (Sidebar) */
.cart-collaterals {
    flex: 1 1 30%;
    /* 30% width */
    width: 100%;
}

.cart_totals {
    background: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border-top: 4px solid var(--primary-color);
    width: 100% !important;
    float: none !important;
}

.cart_totals h2 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cart_totals table {
    width: 100%;
    margin-bottom: 1.5rem;
    border: none !important;
}

.cart_totals th,
.cart_totals td {
    padding: 1rem 0;
    border-bottom: 1px solid #e5e7eb;
}

/* Checkout Button - Theme Aware */
.wc-proceed-to-checkout a.checkout-button {
    background-color: var(--primary-color) !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    padding: 1rem 2rem !important;
    /* Larger touch target */
    border: none !important;
    border-radius: 4px !important;
    width: 100%;
    display: block;
    text-align: center;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.wc-proceed-to-checkout a.checkout-button:hover {
    background-color: #1d4ed8 !important;
    /* Slightly darker blue */
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

/* Dark Mode Specific Adjustments for Button */
.dark-mode .wc-proceed-to-checkout a.checkout-button {
    box-shadow: 0 4px 6px rgba(255, 255, 255, 0.05);
    /* Softer shadow in dark */
}

.dark-mode .wc-proceed-to-checkout a.checkout-button:hover {
    box-shadow: 0 6px 12px rgba(255, 255, 255, 0.1);
}

/* --- WooCommerce BLOCKS Cart Button (User Request) --- */
.wc-block-components-button.wc-block-cart__submit-button {
    background-color: #000000 !important;
    /* Black in Light Mode */
    color: #ffffff !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    border-radius: 4px !important;
    transition: all 0.2s ease;
}

.wc-block-components-button.wc-block-cart__submit-button:hover {
    background-color: #333333 !important;
    /* Dark Gray Hover */
    opacity: 1 !important;
}

/* Dark Mode Override for Blocks Button */
.dark-mode .wc-block-components-button.wc-block-cart__submit-button {
    background-color: var(--primary-color) !important;
    /* Blue in Dark Mode */
    color: #ffffff !important;
}

.dark-mode .wc-block-components-button.wc-block-cart__submit-button:hover {
    background-color: #1d4ed8 !important;
    /* Darker Blue Hover */
}

/* My Account - Container Width Increase */
@media (min-width: 992px) {
    .woocommerce-account .container {
        max-width: 90% !important;
    }
}

/* --- MY ACCOUNT THEME STYLING --- */
.woocommerce-account .woocommerce {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    align-items: flex-start;
    /* Prevent stretching */
}

/* Navigation Sidebar */
.woocommerce-MyAccount-navigation {
    flex: 1 1 25%;
    /* 25% width */
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    border: 1px solid #e5e7eb;
}

.woocommerce-MyAccount-navigation ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.woocommerce-MyAccount-navigation ul li {
    border-bottom: 1px solid #f3f4f6;
    margin: 0;
}

.woocommerce-MyAccount-navigation ul li:last-child {
    border-bottom: none;
}

.woocommerce-MyAccount-navigation ul li a {
    display: block;
    padding: 1rem 1.5rem;
    text-decoration: none;
    color: #4b5563;
    font-weight: 500;
    transition: all 0.2s;
}

.woocommerce-MyAccount-navigation ul li a:hover {
    background-color: #f9fafb;
    color: var(--primary-color);
    padding-left: 1.75rem;
    /* Slight slide effect */
}

/* Active Menu Item */
.woocommerce-MyAccount-navigation ul li.is-active a {
    background-color: var(--primary-color);
    color: #ffffff;
}

/* Content Area */
.woocommerce-MyAccount-content {
    flex: 1 1 70%;
    /* 70% width */
    background: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border: 1px solid #e5e7eb;
}

/* Content Headings */
.woocommerce-MyAccount-content h2,
.woocommerce-MyAccount-content h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: #111;
    border-bottom: 2px solid #f3f4f6;
    padding-bottom: 0.5rem;
}

/* My Account - Mobile Menu (Hamburger Style) */
.account-mobile-menu-toggle {
    display: none;
    /* Hidden on desktop */
    width: 100%;
    background: #fff;
    border: 1px solid #e5e7eb;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--primary-color);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    cursor: pointer;
    align-items: center;
    justify-content: space-between;
}

.account-mobile-menu-toggle:after {
    content: '\2630';
    /* Hamburger Icon */
    font-size: 1.2rem;
}

@media (max-width: 992px) {

    /* Show Toggle Button */
    .account-mobile-menu-toggle {
        display: flex;
    }

    /* Hide Navigation List by Default on Mobile */
    .woocommerce-MyAccount-navigation ul {
        display: none;
        /* Hidden initially */
        flex-direction: column;
        /* Vertical Stack when open */
    }

    /* When Active (Toggled via JS) */
    .woocommerce-MyAccount-navigation ul.active {
        display: flex;
        /* Show vertically */
    }

    .woocommerce-MyAccount-navigation ul li {
        border-right: none;
        border-bottom: 1px solid #f3f4f6;
        text-align: left;
    }
}


/* --- 2. Checkout Page Styling --- */
.woocommerce-checkout .woocommerce {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* Left Column: Billing & Shipping */
#customer_details {
    flex: 1 1 60%;
    background: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

#customer_details h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

/* Form Fields */
.woocommerce-input-wrapper {
    display: block;
}

.woocommerce form .form-row input.input-text,
.woocommerce form .form-row textarea {
    padding: 0.8rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    background: #f9fafb;
    transition: all 0.2s;
}

.woocommerce form .form-row input.input-text:focus,
.woocommerce form .form-row textarea:focus {
    background: #fff;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    outline: none;
}

.woocommerce form .form-row {
    margin-bottom: 1.5rem;
}

/* Right Column: Order Review */
#order_review_heading {
    display: none;
    /* Hide default heading, we wrap it in box */
}

#order_review {
    flex: 1 1 35%;
    background: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    /* Stronger shadow */
    border: 1px solid #e5e7eb;
    height: fit-content;
    position: sticky;
    top: 100px;
    /* Sticky sidebar */
}

#order_review table.shop_table {
    border: none;
    margin-bottom: 2rem;
}

#order_review th,
#order_review td {
    border-bottom: 1px solid #e5e7eb;
    padding: 1rem 0;
}

#order_review tfoot th {
    color: #4b5563;
}

#order_review .order-total th,
#order_review .order-total td {
    border-top: 2px solid #e5e7eb;
    font-size: 1.25rem;
    font-weight: 700;
    color: #111;
}

/* Payment Methods */
#payment {
    background: #f9fafb !important;
    border-radius: 4px;
    padding: 1rem;
}

#payment ul.payment_methods {
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 1rem;
}

#payment div.payment_box {
    background: #fff !important;
    font-size: 0.9rem;
    padding: 1rem !important;
    color: #4b5563;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    margin-top: 10px;
}

#place_order {
    background: var(--primary-color) !important;
    color: #fff !important;
    font-size: 1.1rem !important;
    font-weight: 700 !important;
    padding: 1.2rem !important;
    width: 100%;
    border-radius: 4px !important;
    margin-top: 1rem;
    transition: background 0.2s;
}

#place_order:hover {
    background: #1d4ed8 !important;
}

/* Mobile Adjustments for Checkout */
@media (max-width: 992px) {

    .woocommerce-cart .woocommerce-cart-form,
    .cart-collaterals,
    #customer_details,
    #order_review {
        flex: 1 1 100%;
        max-width: 100%;
        position: static;
        /* No sticky on mobile */
    }

    .shop_table.cart {
        display: block;
        overflow-x: auto;
    }
}

/* Ensure section titles are visible in dark mode */
.section-header h2 {
    color: var(--text-main);
}

/* --- Address Book Buttons (Add/Edit) --- */
.woocommerce-Address-title .edit,
header.title .edit,
.woocommerce-address-fields .button {
    background-color: var(--primary-color) !important;
    color: #fff !important;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    display: inline-block;
    border: none !important;
}

.woocommerce-Address-title .edit:hover,
header.title .edit:hover,
.woocommerce-address-fields .button:hover {
    background-color: #013323 !important;
    /* Darker Green shade manually or via opacity */
    opacity: 0.9;
    color: #fff !important;
    text-decoration: none;
}

/* --- Side Panel Mini Cart Styling --- */
.side-cart-body .widget_shopping_cart_content {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.side-cart-body .woocommerce-mini-cart {
    flex-grow: 1;
    overflow-y: auto;
    margin: 0;
    padding: 0;
    list-style: none;
}

.side-cart-body .woocommerce-mini-cart-item {
    display: flex;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid #f3f4f6;
    position: relative;
    align-items: flex-start;
}

/* Remove Item Icon */
.side-cart-body .woocommerce-mini-cart-item a.remove {
    position: absolute;
    top: 10px;
    right: 0;
    background: #fee2e2;
    color: #ef4444 !important;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 1.2rem;
    line-height: 1;
    font-weight: 700;
    z-index: 10;
}

.side-cart-body .woocommerce-mini-cart-item a.remove:hover {
    background: #ef4444;
    color: #fff !important;
}

/* Image */
.side-cart-body .woocommerce-mini-cart-item img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #e5e7eb;
    margin: 0 !important;
    flex-shrink: 0;
}

/* Title & Meta */
/* Title & Meta */
.side-cart-body .woocommerce-mini-cart-item a:not(.remove) {
    font-weight: 600;
    color: #111;
    text-decoration: none;
    display: flex !important;
    /* Align Image and Text side-by-side */
    align-items: center;
    gap: 12px;
    margin-bottom: 0.25rem;
    line-height: 1.3;
    padding-right: 20px;
    /* Space for remove icon */
    font-size: 0.95rem;
    width: 100%;
}

.side-cart-body .woocommerce-mini-cart-item .quantity {
    display: block;
    font-size: 0.85rem;
    color: #6b7280;
    margin-top: 5px;
}

/* Footer Section (Total + Buttons) */
.side-cart-body .woocommerce-mini-cart__total {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 2px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.side-cart-body .woocommerce-mini-cart__buttons {
    display: grid;
    gap: 10px;
    margin: 0;
}

.side-cart-body .woocommerce-mini-cart__buttons .button {
    width: 100%;
    text-align: center;
    margin: 0;
    padding: 0.8rem;
    border-radius: 4px;
    font-weight: 600;
    display: block;
}

.side-cart-body .woocommerce-mini-cart__buttons .button.checkout {
    background-color: var(--primary-color) !important;
    color: #fff !important;
}

.side-cart-body .woocommerce-mini-cart__buttons .button.checkout:hover {
    background-color: #013323 !important;
}

.side-cart-body .woocommerce-mini-cart__buttons .button:not(.checkout) {
    background-color: #f3f4f6 !important;
    color: #111 !important;
}

.side-cart-body .woocommerce-mini-cart__buttons .button:not(.checkout):hover {
    background-color: #e5e7eb !important;
}

/* --- Mobile/Tablet: Icon-Only Add to Cart Button --- */
@media (max-width: 991px) {

    .woocommerce ul.products li.product .button.add_to_cart_button,
    ul.products.product-slider li.product .button.add_to_cart_button {
        font-size: 0 !important;
        /* Hide Text */
        text-indent: -9999px;
        width: 40px !important;
        height: 40px !important;
        padding: 0 !important;
        border-radius: 50% !important;
        position: relative;
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        min-width: 0 !important;
        overflow: hidden;
        margin: 0.5rem auto 0 !important;
        /* Center button */
    }

    /* Inject Icon using Mask (allows color change) */
    .woocommerce ul.products li.product .button.add_to_cart_button::before,
    ul.products.product-slider li.product .button.add_to_cart_button::before {
        content: '' !important;
        text-indent: 0;
        width: 20px;
        height: 20px;
        background-color: #fff;
        /* Icon Color */
        -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="9" cy="21" r="1"></circle><circle cx="20" cy="21" r="1"></circle><path d="M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6"></path></svg>') no-repeat center;
        mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="9" cy="21" r="1"></circle><circle cx="20" cy="21" r="1"></circle><path d="M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6"></path></svg>') no-repeat center;
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        opacity: 1 !important;
        display: block !important;
    }

    /* Ensure Checkmark shows on success if standard WC script runs */
    .woocommerce ul.products li.product .button.added::before {
        -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"></polyline></svg>') no-repeat center;
        mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"></polyline></svg>') no-repeat center;
    }
}