/* Toast Notification */
.mkshop-toast-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}
.mkshop-toast {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    padding: 16px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    transform: translateX(120%);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.4s ease;
    opacity: 0;
    min-width: 250px;
    max-width: 400px;
    pointer-events: auto;
    font-family: 'Quicksand', sans-serif;
    color: #333;
}
.mkshop-toast.show {
    transform: translateX(0);
    opacity: 1;
}
.mkshop-toast .icon {
    font-size: 24px;
    flex-shrink: 0;
}
.mkshop-toast.success .icon { color: #10b981; } /* Green */
.mkshop-toast.error .icon { color: #ef4444; } /* Red */
.mkshop-toast.info .icon { color: #3b82f6; } /* Blue */
.mkshop-toast-content {
    flex-grow: 1;
    font-size: 15px;
    font-weight: 500;
}
.mkshop-toast-close {
    cursor: pointer;
    color: #999;
    font-size: 20px;
    transition: color 0.2s;
    background: none;
    border: none;
    padding: 0;
}
.mkshop-toast-close:hover {
    color: #333;
}

/* Skeleton Loading */
.mkshop-skeleton {
    background: #f0f0f0;
    background: linear-gradient(90deg, #ececec 8%, #f5f5f5 18%, #ececec 33%);
    background-size: 200% 100%;
    animation: 1.5s mkshop-skeleton-shimmer linear infinite;
    border-radius: 4px;
    color: transparent !important;
    border: none !important;
    box-shadow: none !important;
    pointer-events: none;
}
.mkshop-skeleton *, .mkshop-skeleton::before, .mkshop-skeleton::after {
    visibility: hidden;
}

@keyframes mkshop-skeleton-shimmer {
    to {
        background-position-x: -200%;
    }
}

/* Page Transition Overlay (Swup/Pjax concept) */
.mkshop-page-transition {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #ffffff;
    z-index: 9999999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.mkshop-page-transition.active {
    opacity: 1;
    pointer-events: all;
}

/* AJAX Add to Cart Button States */
.woocommerce ul.products li.product .button.loading {
    opacity: 0.7;
    position: relative;
    color: transparent !important;
}
.woocommerce ul.products li.product .button.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin-top: -8px;
    margin-left: -8px;
    border: 2px solid rgba(0,0,0,0.2);
    border-top-color: #333;
    border-radius: 50%;
    animation: mkshop-spin 0.8s linear infinite;
}
.woocommerce ul.products li.product .button.added {
    background-color: #4caf50 !important;
    color: #fff !important;
    border-color: #4caf50 !important;
}
.woocommerce ul.products li.product .button.added::after {
    content: "✓";
    margin-left: 5px;
    font-weight: bold;
}
@keyframes mkshop-spin {
    to { transform: rotate(360deg); }
}

/* Smart Sticky Header */
.mk-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: rgba(255, 255, 255, 0.95);
    transition: transform 0.3s ease-in-out, box-shadow 0.3s ease, background-color 0.3s ease;
}
.mk-header--pinned {
    transform: translateY(0);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    background-color: rgba(255, 255, 255, 0.85);
}
.mk-header--unpinned {
    transform: translateY(-100%);
}


body.mk-nav-open .mk-header {
    z-index: 10000;
}

/* Swup Page Transitions */
html.is-animating #content {
    opacity: 0;
    transform: translateY(10px);
}
html.is-leaving #content {
    opacity: 0;
    transform: translateY(-10px);
}
#content {
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
}

/* Native WooCommerce product gallery */
.single-product .woocommerce-product-gallery {
    overflow: visible !important;
}

.single-product .woocommerce-product-gallery__wrapper {
    border-radius: 14px;
    overflow: hidden;
    background: #f9f9f9;
}

.single-product .woocommerce-product-gallery__image,
.single-product .woocommerce-product-gallery__image a {
    display: block;
    width: 100%;
}

.single-product .woocommerce-product-gallery__image img {
    display: block;
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 1 / 1;
    object-fit: contain !important;
    background-color: #f9f9f9;
    image-rendering: auto;
}

/* Clickable thumbnails below the main image. */
.single-product .woocommerce-product-gallery .flex-control-thumbs {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
    clear: both;
    list-style: none;
    margin: 12px 0 0 !important;
    padding: 0 !important;
}

.single-product .woocommerce-product-gallery .flex-control-thumbs li {
    width: auto !important;
    float: none !important;
    margin: 0 !important;
}

.single-product .woocommerce-product-gallery .flex-control-thumbs img {
    display: block;
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    box-sizing: border-box;
    border: 2px solid transparent;
    border-radius: 9px;
    background: #f5f5f5;
    opacity: 0.65;
    cursor: pointer;
    transition: opacity .2s ease, border-color .2s ease, transform .2s ease;
}

.single-product .woocommerce-product-gallery .flex-control-thumbs img:hover {
    opacity: 1;
    transform: translateY(-1px);
}

.single-product .woocommerce-product-gallery .flex-control-thumbs img.flex-active {
    opacity: 1;
    border-color: var(--mk-red, #ed1c24);
}

@media (max-width: 600px) {
    .single-product .woocommerce-product-gallery .flex-control-thumbs {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 8px;
    }
}
/* Hide default WP widgets in Shop sidebar */
.widget_recent_entries, .widget_recent_comments, .widget_archive,
.wp-block-latest-posts, .wp-block-latest-comments, .wp-block-archives {
    display: none !important;
}


/* Swup Page Transitions */
html.is-animating .transition-fade { opacity: 0; transform: translateY(10px); }
html.is-leaving .transition-fade { opacity: 0; transform: translateY(-10px); }
.transition-fade { transition: opacity 0.3s ease-out, transform 0.3s ease-out; opacity: 1; transform: translateY(0); }

