/* Mode Switcher Button */
.mode-switcher-toggle {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    font-size: 1.2rem;
    color: var(--wp--preset--color--main);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
    margin-left: 6px !important;
    line-height: 20px;
}

.mode-switcher-toggle:hover {
    transform: rotate(15deg);
}

/* Light Mode Icon (Default) */
.icon-moon {
    display: none;
}

.icon-sun {
    display: block;
}

/* Dark Mode Icon */
.is-dark-theme .mode-switcher-toggle .icon-moon {
    display: block;
    color: var(--wp--preset--color--main-accent);
}

.is-dark-theme .mode-switcher-toggle .icon-sun {
    display: none;
}

span:where(.wc-block-mini-cart__badge) {
    background-color: rgb(30, 30, 38);
    color: rgb(255, 255, 255);
}

body.is-dark-theme span:where(.wc-block-mini-cart__badge) {
    background-color:rgb(255, 255, 255);
    color:rgb(30, 30, 38);
}

/* Ensure links and other elements inherit correctly if not using variables directly */

/* Fix for inputs in Dark Mode */
body.is-dark-theme input:not([type="submit"]),
body.is-dark-theme select,
body.is-dark-theme textarea,
body.is-dark-theme .wp-block-post-comments-form input:not([type="submit"]):not([type="checkbox"]),
body.is-dark-theme .wp-block-post-comments-form textarea {
    background-color: var(--wp--preset--color--tertiary) !important;
    color: var(--wp--preset--color--main) !important;
    border-color: var(--wp--preset--color--border-light) !important;
}

body.is-dark-theme input::placeholder,
body.is-dark-theme textarea::placeholder {
    color: var(--wp--preset--color--main-accent);
    opacity: 0.7;
}

body.is-dark-theme input:focus-visible,
body.is-dark-theme textarea:focus-visible {
    border-color: var(--wp--preset--color--primary);
    outline-color: var(--wp--preset--color--primary);
}

/* Enhanced Select support for Dark Mode (including WooCommerce) */
body.is-dark-theme select,
body.is-dark-theme .woocommerce select,
body.is-dark-theme .variations select,
body.is-dark-theme .wp-block-post-comments-form select {
    background-color: var(--wp--preset--color--tertiary) !important;
    color: var(--wp--preset--color--main) !important;
    border-color: var(--wp--preset--color--border-light) !important;
    
    /* Remove default arrow */
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    
    /* Custom White Arrow for Dark Mode */
    background: var(--wp--preset--color--tertiary) url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9IndoaXRlIiBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCI+PHBvbHlsaW5lIHBvaW50cz0iNiA5IDEyIDE1IDE4IDkiLz48L3N2Zz4=") no-repeat right 10px center !important;
    background-size: 16px !important;
    
    padding-right: 30px !important; /* Space for the arrow */
}

/* Fix for buttons and submit inputs in Dark Mode */
body.is-dark-theme button:not(.wc-block-mini-cart__button),
body.is-dark-theme input[type="button"],
body.is-dark-theme input[type="reset"],
body.is-dark-theme input[type="submit"],
body.is-dark-theme .wp-block-button__link,
body.is-dark-theme .wp-block-search__button {
    color: var(--wp--preset--color--base);
    transition: all 0.2s ease;
}

body.is-dark-theme button:not(.mode-switcher-toggle):hover,
body.is-dark-theme input[type="button"]:hover,
body.is-dark-theme input[type="reset"]:hover,
body.is-dark-theme input[type="submit"]:hover,
body.is-dark-theme .wp-block-button__link:hover,
body.is-dark-theme .wp-block-search__button:hover {
    background-color: var(--wp--preset--color--main-accent);
    color: var(--wp--preset--color--base);
}
