/*
Theme Name: Twenty Twenty-Five Child
Description: Child theme of Twenty Twenty-Five
Author: Yumione Art
Author URI: https://yumioneart.com
Template: twentytwentyfive
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: twentytwentyfive-child
*/

/* =============================================================================
   FONT OPTIMIZATION
   ============================================================================= */

/* Add font-display: swap to improve font loading performance */
@font-face {
    font-family: "Manrope";
    src: url("../twentytwentyfive/assets/fonts/manrope/Manrope-VariableFont_wght.woff2") format("woff2");
    font-weight: 200 800;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Fira Code";
    src: url("../twentytwentyfive/assets/fonts/fira-code/FiraCode-VariableFont_wght.woff2") format("woff2");
    font-weight: 300 700;
    font-style: normal;
    font-display: swap;
}

/*
 * Add your custom CSS below this line
 * Any styles you add here will override the parent theme styles
 */

/* Remove underline from all links in WooCommerce product meta block */
.wp-block-woocommerce-product-meta a {
    text-decoration: none;
}
.wp-block-woocommerce-product-meta a:hover {
    text-decoration: underline;
}
.wp-block-woocommerce-product-meta .wp-block-post-terms__prefix {
    font-weight: bold;
}
.wp-block-woocommerce-product-meta .wp-block-post-terms a {
    font-weight: normal;
}

/* Custom width for WooCommerce block quantity input */
.wp-block-add-to-cart-with-options-quantity-selector .quantity .qty,
.wc-block-add-to-cart-with-options__quantity-selector .quantity .qty {
    width: 2.8em;
}

/* Navigation & Cart */
header .navigation-wrapper {
    min-height: auto;
}

header .navigation-container {
    position: relative;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

header .navigation-menu {
    text-align: center;
}

header .navigation-menu a {
    margin: 0 10px;
    text-decoration: none;
    color: #333;
}

header .mini-cart {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    margin: 0;
    z-index: 10;
    /* Ensure the mini-cart doesn't affect page layout */
    max-height: none;
    overflow: visible;
}

/* Header Social Icons */
header .social-icons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 18px;
}

/* Header Social Icons - Inline SVG support */
header .social-icons svg {
    fill: var(--wp--preset--color--custom-color-5);
    transition: transform 0.3s ease;
    width: 24px;
    height: 24px;
}

header .social-icons svg:hover {
    transform: scale(1.1);
}

.wc-block-mini-cart__button {
    padding: 12px;
    margin-right: -12px;
    position: relative;
    z-index: 11;
}

/* Ensure mini-cart dropdown doesn't affect page height */
.wc-block-mini-cart__drawer,
.wc-block-mini-cart__contents {
    position: fixed !important;
    z-index: 9999;
}

/* Additional mini-cart layout fixes */
.wc-block-mini-cart,
.wp-block-woocommerce-mini-cart {
    contain: layout style !important;
}

/* Prevent any WooCommerce elements from expanding page height */
.wc-block-mini-cart *,
.wp-block-woocommerce-mini-cart * {
    max-height: none !important;
    height: auto !important;
}

/* Force body to not expand due to mini-cart */
body.woocommerce-cart body.woocommerce-checkout {
    overflow-x: hidden;
}

/* Fix any potential height issues with the mini-cart container */
.wp-block-group.mini-cart {
    height: auto;
    min-height: 0;
    position: absolute !important;
    top: 50% !important;
    right: 20px !important;
    bottom: auto;
    width: auto;
    transform: translateY(-50%) !important;
}

/* Ensure the navigation container doesn't expand due to absolute positioning */
header .navigation-container {
    position: relative;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
    height: auto;
}

/* Prevent mini-cart from affecting document flow */
.wc-block-mini-cart {
    position: static;
}

/* Force mini-cart drawer to be properly positioned */
.wc-block-mini-cart__drawer {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: auto !important;
    z-index: 9999 !important;
    transform: none !important;
}

/* Ensure mini-cart overlay doesn't affect page height */
.wc-block-mini-cart__backdrop {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 9998 !important;
}

/* Jingle animation keyframes */
@keyframes jingle {

    0%,
    100% {
        transform: rotate(0deg);
    }

    25% {
        transform: rotate(-10deg);
    }

    75% {
        transform: rotate(10deg);
    }
}

/* WooCommerce Catalog Sorting Dropdown Styling */
.wc-block-catalog-sorting {
    display: flex;
    align-items: center;
    gap: 12px;
}

.wc-block-catalog-sorting .woocommerce-ordering {
    display: flex;
    align-items: center;
    gap: 12px;
}

.wc-block-catalog-sorting label,
.woocommerce-ordering label {
    margin: 0;
    white-space: nowrap;
    font-weight: 500;
}

.wc-block-catalog-sorting select.orderby,
.woocommerce-ordering select.orderby {
    padding: 4px 8px;
    border: 1px solid currentColor;
    background-color: transparent;
    font-family: inherit;
    font-size: inherit;
    font-weight: inherit;
    line-height: inherit;
    color: inherit;
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 12px;
    padding-right: 28px;
}

.wc-block-catalog-sorting select.orderby:focus,
.woocommerce-ordering select.orderby:focus {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

.wc-block-catalog-sorting select.orderby option,
.woocommerce-ordering select.orderby option {
    background-color: inherit;
    color: inherit;
}

/* Mobile responsiveness for catalog sorting */
@media (max-width: 782px) {
    /* Hide the "Sort by" label on mobile */
    .wc-block-catalog-sorting label,
    .woocommerce-ordering label {
        display: none;
    }
}

/* WooCommerce Product Gallery */
.woocommerce div.product div.images .woocommerce-product-gallery__trigger {
    opacity: 0.8;
}

.woocommerce div.product div.images .flex-control-thumbs {
    margin-top: 1rem;
}

.flex-control-nav.flex-control-thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.flex-control-nav.flex-control-thumbs li {
    flex: 0 0 calc((100% - 40px) / 5);
    box-sizing: border-box;
}

/* WooCommerce Product Specifications Table */
.wp-block-social-links .wp-block-social-link.wp-social-link .wp-block-social-link-anchor svg {
    fill: var(--wp--preset--color--custom-color-5);
}

.wp-block-social-links .wp-block-social-link.wp-social-link {
    background-color: transparent;
    color: #fff;
}

table.wc-block-product-specifications {
    width: 100%;
    border-collapse: collapse;
}

table.wc-block-product-specifications th {
    padding: 2px;
}

table.wc-block-product-specifications td p {
    padding: 2px 0px 2px 0px;
}

/* Pagination Styling */
.wp-block-query-pagination-numbers .page-numbers {
    color: var(--wp--preset--color--custom-color-5);
}

.wp-block-query-pagination-numbers .page-numbers.current {
    color: var(--wp--preset--color--custom-color-5);
}

.wp-block-query-pagination-previous,
.wp-block-query-pagination-next {
    color: var(--wp--preset--color--custom-color-6);
}

.wp-block-query-pagination-previous-arrow,
.wp-block-query-pagination-next-arrow {
    color: var(--wp--preset--color--custom-color-6);
}

/* Footer Icon Hover Effect */
footer .icon img {
    transition: opacity 0.3s ease, transform 0.3s ease;
    cursor: pointer;
}

footer .icon img:hover {
    opacity: 0.66;
    transform: scale(1.1);
}

/* Button Hover Transitions */
.wp-element-button {
    transition: all 0.2s ease;
}

/*
 * SAVED FOR LATER: Page unavailable styling
 * Uncomment this section if you want the page unavailable styling back
 */
.page-unavailable-wrapper {
    max-width: 400px;
    margin: 2rem auto;
    padding: 2rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: #f9f9f9;
    text-align: center;
}

.page-unavailable-wrapper h3 {
    margin-top: 0;
    color: var(--wp--preset--color--custom-color-5);
}

.page-unavailable-wrapper p {
    margin-bottom: 0;
    color: #666;
}

/* Password Protected Page Styling - Password Form */
.password-form-wrapper {
    max-width: 400px;
    margin: 2rem auto;
    padding: 2rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: #f9f9f9;
    text-align: center;
}

.password-form-wrapper h3 {
    margin-top: 0;
    color: var(--wp--preset--color--custom-color-5);
}

.password-form-wrapper p {
    margin-bottom: 1.5rem;
    color: #666;
}

.password-input-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.password-input-wrapper label {
    font-weight: bold;
    text-align: left;
}

.password-input-wrapper input[type="password"] {
    padding: 0.75rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
}

.password-input-wrapper input[type="submit"] {
    padding: 0.75rem 1.5rem;
    background-color: var(--wp--preset--color--custom-color-5);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.password-input-wrapper input[type="submit"]:hover {
    background-color: var(--wp--preset--color--custom-color-6);
}

/* Product Catalog Image Hover Zoom Effect */
.wc-block-components-product-image,
.wp-block-woocommerce-product-image {
    overflow: hidden;
}

.wc-block-components-product-image img[data-testid="product-image"],
.wp-block-woocommerce-product-image img[data-testid="product-image"],
.wc-block-components-product-image img,
.wp-block-woocommerce-product-image img {
    transition: transform 0.3s ease-in-out;
    transform-origin: center center;
}

.wc-block-components-product-image:hover img[data-testid="product-image"],
.wp-block-woocommerce-product-image:hover img[data-testid="product-image"],
.wc-block-components-product-image:hover img,
.wp-block-woocommerce-product-image:hover img {
    transform: scale(1.05);
}

/* Quantity Free Shipping Block */
.quantity-free-shipping-block {
    padding: 6px;
    font-size: 14px;
    text-align: center;
    background: #4a3b32;
    color: #f0ebdc;
}

/* .quantity-free-shipping-block.empty {} */
/* .quantity-free-shipping-block.progress {} */
.quantity-free-shipping-block.qualified {
    background: #344907;
    color: #f0ebdc;
}

/* Footer Navigation Mobile Centering */
@media (max-width: 782px) {
    footer .wp-block-navigation .wp-block-navigation-item__content {
        text-align: center;
    }
    
    footer .wp-block-navigation.is-vertical {
        align-items: center;
    }
    
    /* Center the main footer flex container */
    footer .wp-block-group.alignfull.is-content-justification-space-between {
        justify-content: center;
        flex-direction: column;
        gap: 2rem;
    }
    
    /* Center the left group (logo and title) */
    footer .wp-block-group.is-content-justification-left {
        justify-content: center;
    }
}

