/*
 * Site-Wide UI Bundle CSS
 * Includes: squarewooNotification.css, globalUXBundle.css, lazyLoading.css
 */

/**
 * SquareWoo Notification System
 * Merkezi bildirim sistemi - Toast tarzı, sağ üst köşe, slide animasyon
 * 
 * @version 1.0.0
 * @package SquareWoo
 */


.squarewoo-notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 380px;
    width: 100%;
    pointer-events: none;
}


@media (max-width: 480px) {
    .squarewoo-notification-container {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
}


.squarewoo-notification {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15), 0 2px 10px rgba(0, 0, 0, 0.1);
    pointer-events: auto;
    position: relative;
    overflow: hidden;
    transform: translateX(120%);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
}

.squarewoo-notification.show {
    transform: translateX(0);
    opacity: 1;
}

.squarewoo-notification.hide {
    transform: translateX(120%);
    opacity: 0;
}


.squarewoo-notification-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.squarewoo-notification-icon svg {
    width: 16px;
    height: 16px;
}


.squarewoo-notification-content {
    flex: 1;
    min-width: 0;
}

.squarewoo-notification-title {
    font-weight: 600;
    font-size: 14px;
    color: #1f2937;
    margin: 0 0 4px 0;
    line-height: 1.4;
}

.squarewoo-notification-message {
    font-size: 13px;
    color: #6b7280;
    margin: 0;
    line-height: 1.5;
    word-wrap: break-word;
}


.squarewoo-notification-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 20px;
    height: 20px;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    color: #9ca3af;
    transition: color 0.2s, background 0.2s;
    padding: 0;
}

.squarewoo-notification-close:hover {
    color: #374151;
    background: #f3f4f6;
}

.squarewoo-notification-close svg {
    width: 14px;
    height: 14px;
}


.squarewoo-notification-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: currentColor;
    opacity: 0.3;
    transition: width linear;
}


.squarewoo-notification--success {
    border-left: 4px solid #10b981;
}

.squarewoo-notification--success .squarewoo-notification-icon {
    background: #d1fae5;
    color: #10b981;
}

.squarewoo-notification--success .squarewoo-notification-progress {
    background: #10b981;
}

.squarewoo-notification--error {
    border-left: 4px solid #ef4444;
}

.squarewoo-notification--error .squarewoo-notification-icon {
    background: #fee2e2;
    color: #ef4444;
}

.squarewoo-notification--error .squarewoo-notification-progress {
    background: #ef4444;
}

.squarewoo-notification--warning {
    border-left: 4px solid #f59e0b;
}

.squarewoo-notification--warning .squarewoo-notification-icon {
    background: #fef3c7;
    color: #f59e0b;
}

.squarewoo-notification--warning .squarewoo-notification-progress {
    background: #f59e0b;
}

.squarewoo-notification--info {
    border-left: 4px solid #3b82f6;
}

.squarewoo-notification--info .squarewoo-notification-icon {
    background: #dbeafe;
    color: #3b82f6;
}

.squarewoo-notification--info .squarewoo-notification-progress {
    background: #3b82f6;
}

.squarewoo-notification--loading {
    border-left: 4px solid #8b5cf6;
}

.squarewoo-notification--loading .squarewoo-notification-icon {
    background: #ede9fe;
    color: #8b5cf6;
}


.squarewoo-notification--loading .squarewoo-notification-icon svg {
    animation: squarewoo-spin 1s linear infinite;
}

@keyframes squarewoo-spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}


.squarewoo-notification--confirm {
    border-left: 4px solid #6366f1;
}

.squarewoo-notification--confirm .squarewoo-notification-icon {
    background: #e0e7ff;
    color: #6366f1;
}

.squarewoo-notification-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.squarewoo-notification-btn {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: background 0.2s, transform 0.1s;
}

.squarewoo-notification-btn:active {
    transform: scale(0.98);
}

.squarewoo-notification-btn--confirm {
    background: var(--primary-background);
    color: #fff;
}

.squarewoo-notification-btn--confirm:hover {
    transform: scale(1.05);
}

.squarewoo-notification-btn--cancel {
    background: #f3f4f6;
    color: #374151;
}

.squarewoo-notification-btn--cancel:hover {
    transform: scale(1.05);
}


.squarewoo-confirm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999998;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.squarewoo-confirm-overlay.show {
    opacity: 1;
}


.squarewoo-confirm-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    z-index: 999999;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    padding: 24px;
    max-width: 400px;
    width: calc(100% - 32px);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.2s ease;
}

.squarewoo-confirm-modal.show {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

.squarewoo-confirm-modal.hide {
    transform: translate(-50%, -50%) scale(0.9);
    opacity: 0;
}

.squarewoo-confirm-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fef3c7;
    color: #f59e0b;
}

.squarewoo-confirm-icon svg {
    width: 24px;
    height: 24px;
}

.squarewoo-confirm-title {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    text-align: center;
    margin: 0 0 8px;
}

.squarewoo-confirm-message {
    font-size: 14px;
    color: #6b7280;
    text-align: center;
    margin: 0 0 24px;
    line-height: 1.5;
}

.squarewoo-confirm-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.squarewoo-confirm-btn {
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    min-width: 100px;
}

.squarewoo-confirm-btn:active {
    transform: scale(0.98);
}

.squarewoo-confirm-btn--yes {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #fff;
}

.squarewoo-confirm-btn--yes:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.squarewoo-confirm-btn--no {
    background: #f3f4f6;
    color: #374151;
}

.squarewoo-confirm-btn--no:hover {
    background: #e5e7eb;
}


@media (prefers-color-scheme: dark) {
    .squarewoo-notification {
        background: #1f2937;
    }

    .squarewoo-notification-title {
        color: #f9fafb;
    }

    .squarewoo-notification-message {
        color: #9ca3af;
    }

    .squarewoo-notification-close {
        color: #6b7280;
    }

    .squarewoo-notification-close:hover {
        color: #d1d5db;
        background: #374151;
    }

    .squarewoo-notification-btn--cancel {
        background: #374151;
        color: #d1d5db;
    }

    .squarewoo-notification-btn--cancel:hover {
        transform: scale(1.05);
    }

    .squarewoo-confirm-modal {
        background: #1f2937;
    }

    .squarewoo-confirm-title {
        color: #f9fafb;
    }

    .squarewoo-confirm-message {
        color: #9ca3af;
    }

    .squarewoo-confirm-btn--no {
        background: #374151;
        color: #d1d5db;
    }

    .squarewoo-confirm-btn--no:hover {
        background: #4b5563;
    }
}
/*
 * Global UX Bundle CSS
 * - Offline warning
 * - Back to top
 */

#offline-warning-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #fff;

    z-index: 999999;

    display: none;

    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #333;
}

#offline-warning-overlay.visible {
    display: flex;
}

.offline-content {
    max-width: 400px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.offline-brand {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 20px;
    color: #000;
}

.offline-message-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    line-height: 1.4;
}

.offline-message-body {
    font-size: 14px;
    color: #666;
    margin: 0;
    line-height: 1.5;
}

.offline-auto-reload {
    font-size: 12px;
    color: #888;
    margin-top: 10px;
}


.offline-spinner {
    width: 40px;
    height: 40px;
    margin-top: 30px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #ff6000;

    border-radius: 50%;
    animation: offline-spin 1s linear infinite;
}

@keyframes offline-spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}


@media (prefers-color-scheme: dark) {
    #offline-warning-overlay {
        background-color: #1a1a1a;
        color: #fff;
    }

    .offline-brand {
        color: #fff;
    }

    .offline-message-body {
        color: #aaa;
    }

    .offline-auto-reload {
        color: #777;
    }

    .offline-spinner {
        border-color: #333;
        border-top-color: var(--loader-color, #ff6000);
    }
}
/**
 * Back to Top Button Styles
 */
.backToTop {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 50%;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.backToTop.isVisible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.backToTop:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.25);
    background: rgba(255, 255, 255, 0.2);
}

.progressRing {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
    pointer-events: none;
}

.progressRingCircle {
    stroke: var(--primary-background);
    stroke-dasharray: 289.026;

    stroke-dashoffset: 289.026;
    transition: stroke-dashoffset 0.1s linear;
}

.backToTopIcon {
    position: relative;
    z-index: 1;
    color: var(--primary-background);
    display: flex;
    align-items: center;
    justify-content: center;
}

.backToTopIcon svg {
    width: 24px;
    height: 24px;
    stroke-width: 2.5;
}

@media (max-width: 768px) {
    .backToTop {
        bottom: 20px;
        right: 20px;
        width: 44px;
        height: 44px;
    }

    .backToTopIcon svg {
        width: 20px;
        height: 20px;
    }
}

/* ==========================================================================
   WhatsApp Button Styles
   ========================================================================== */

.whatsappButton {
    position: fixed;
    bottom: 90px;
    right: 30px;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1;
    background: #25D366;
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
}

.whatsappButton:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 8px 25px rgba(37, 211, 102, 0.5);
    background: #20BA5C;
}

.whatsappButton svg {
    width: 28px;
    height: 28px;
    color: #ffffff;
}


.whatsappButton::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: #25D366;
    z-index: -1;
    animation: whatsappPulse 2s ease-out infinite;
}

@keyframes whatsappPulse {
    0% {
        transform: scale(1);
        opacity: 0.5;
    }

    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

@media (max-width: 768px) {
    .whatsappButton {
        bottom: 74px;
        right: 20px;
        width: 44px;
        height: 44px;
    }

    .whatsappButton svg {
        width: 24px;
        height: 24px;
    }
}

/**
 * Advanced Skeleton Loading System with Progressive Loading
 * Version: 2.0.0
 * Features: GPU acceleration, LQIP support, adaptive animations
 */


.skeleton {
    background: linear-gradient(90deg, #ffffff 25%, #f8fafc 50%, #ffffff 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border: 1px solid #f1f5f9;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
    will-change: background-position;
    transform: translateZ(0);
    backface-visibility: hidden;
    contain: layout style paint;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}


@keyframes skeleton-shimmer-optimized {
    0% {
        transform: translate3d(-100%, 0, 0);
    }

    100% {
        transform: translate3d(100%, 0, 0);
    }
}


.skeleton-image {
    width: 100%;
    height: 200px;
    background: #ffffff;
    border: 1px solid #f1f5f9;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
    contain: layout style paint;
}

.skeleton-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent,
            rgba(241, 245, 249, 0.8),
            transparent);
    animation: skeleton-shimmer-optimized 1.5s infinite;
    will-change: transform;
    transform: translate3d(-100%, 0, 0);
    backface-visibility: hidden;
}

@keyframes skeleton-shimmer {
    0% {
        left: -100%;
    }

    100% {
        left: 100%;
    }
}


.skeleton-product-card {
    padding: 16px;
    border: 1px solid #f1f5f9;
    border-radius: 12px;
    background: #ffffff;
    contain: layout style;
    isolation: isolate;
}

.skeleton-product-image {
    width: 100%;
    aspect-ratio: 1;
    background: #ffffff;
    border: 1px solid #f1f5f9;
    border-radius: 8px;
    margin-bottom: 12px;
    position: relative;
    overflow: hidden;
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
    contain: layout style paint;
}

.skeleton-product-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent,
            rgba(241, 245, 249, 0.8),
            transparent);
    animation: skeleton-shimmer-optimized 1.5s infinite;
    will-change: transform;
    transform: translate3d(-100%, 0, 0);
    backface-visibility: hidden;
}


.skeleton-text {
    height: 16px;
    background: #ffffff;
    border: 1px solid #f1f5f9;
    border-radius: 4px;
    margin-bottom: 8px;
    position: relative;
    overflow: hidden;
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
    contain: layout style paint;
}

.skeleton-text::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent,
            rgba(241, 245, 249, 0.8),
            transparent);
    animation: skeleton-shimmer-optimized 1.5s infinite;
    will-change: transform;
    transform: translate3d(-100%, 0, 0);
    backface-visibility: hidden;
}

.skeleton-text.short {
    width: 60%;
}

.skeleton-text.medium {
    width: 80%;
}

.skeleton-text.long {
    width: 100%;
}


.skeleton-title {
    height: 20px;
    background: #ffffff;
    border: 1px solid #f1f5f9;
    border-radius: 4px;
    margin-bottom: 12px;
    width: 75%;
    position: relative;
    overflow: hidden;
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
    contain: layout style paint;
}

.skeleton-title::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent,
            rgba(241, 245, 249, 0.8),
            transparent);
    animation: skeleton-shimmer-optimized 1.5s infinite;
    will-change: transform;
    transform: translate3d(-100%, 0, 0);
    backface-visibility: hidden;
}


.skeleton-price {
    height: 18px;
    background: #ffffff;
    border: 1px solid #f1f5f9;
    border-radius: 4px;
    width: 40%;
    position: relative;
    overflow: hidden;
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
    contain: layout style paint;
}

.skeleton-price::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent,
            rgba(241, 245, 249, 0.8),
            transparent);
    animation: skeleton-shimmer-optimized 1.5s infinite;
    will-change: transform;
    transform: translate3d(-100%, 0, 0);
    backface-visibility: hidden;
}


.skeleton-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    padding: 20px;
    contain: layout style;
    isolation: isolate;
}


.skeleton-hero {
    width: 100%;
    height: 400px;
    background: #ffffff;
    border: 1px solid #f1f5f9;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
    contain: layout style paint;
}

.skeleton-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent,
            rgba(241, 245, 249, 0.8),
            transparent);
    animation: skeleton-shimmer-optimized 1.8s infinite;
    will-change: transform;
    transform: translate3d(-100%, 0, 0);
    backface-visibility: hidden;
}


.skeleton-avatar {
    width: 40px;
    height: 40px;
    background: #ffffff;
    border: 1px solid #f1f5f9;
    border-radius: 50%;
    position: relative;
    overflow: hidden;
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
    contain: layout style paint;
}

.skeleton-avatar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent,
            rgba(241, 245, 249, 0.8),
            transparent);
    animation: skeleton-shimmer-optimized 1.2s infinite;
    will-change: transform;
    transform: translate3d(-100%, 0, 0);
    backface-visibility: hidden;
}


.image-loading {
    position: relative;
    background: #ffffff;
    border: 1px solid #f1f5f9;
    border-radius: 8px;
    overflow: hidden;
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
    contain: layout style paint;
}


.image-loading.color-palette {
    background: transparent;
    border: none;
}


.progressive-loading {
    position: relative;
    background: transparent;
    border: none;
    overflow: hidden;
}

.progressive-loading img {
    transition: filter 0.5s ease, transform 0.5s ease;
}


.progressive-loading img[style*="blur"] {
    filter: blur(5px);
    transform: scale(1.05);
    will-change: filter, transform;
}


.progressive-loading img:not([style*="blur"]) {
    filter: none;
    transform: scale(1);
}


img.lqip-active {
    filter: blur(10px);
    transform: scale(1.05);
    transition: filter 0.5s ease, transform 0.5s ease;
    will-change: filter, transform;
}

img.lqip-active.image-loaded {
    filter: none;
    transform: scale(1);
}

.image-loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent,
            rgba(241, 245, 249, 0.8),
            transparent);
    animation: skeleton-shimmer-optimized 1.5s infinite;
    will-change: transform;
    transform: translate3d(-100%, 0, 0);
    backface-visibility: hidden;
    z-index: 1;
}

.image-loading img {
    opacity: 0;
    transition: opacity 0.4s ease-out, transform 0.4s ease-out;
    transform: scale(0.95);
    will-change: opacity, transform;
}

.image-loaded::before {
    display: none;
}

.image-loaded img {
    opacity: 1;
    transform: scale(1);
}


@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.image-loaded.fade-in-up img {
    animation: fadeInUp 0.6s ease-out forwards;
}


.image-error {
    background: #fee2e2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100px;
    color: #dc2626;
    position: relative;
    padding: 20px;
}

.image-error img {
    display: none;
}

.image-error::after {
    content: '⚠️ Image failed to load';
    font-size: 14px;
    text-align: center;
}

.image-error-message {
    font-size: 14px;
    text-align: center;
    padding: 20px;
}


img[data-priority="high"] {
    content-visibility: auto;
}


@media (prefers-color-scheme: dark) {

    .skeleton,
    .skeleton-image,
    .skeleton-product-image,
    .skeleton-text,
    .skeleton-title,
    .skeleton-price,
    .skeleton-hero,
    .skeleton-avatar,
    .image-loading {
        background: #D3D3D3;
    }

    .skeleton::before,
    .skeleton-image::before,
    .skeleton-product-image::before,
    .skeleton-text::before,
    .skeleton-title::before,
    .skeleton-price::before,
    .skeleton-hero::before,
    .skeleton-avatar::before,
    .image-loading::before {
        background: linear-gradient(90deg,
                transparent,
                rgba(255, 255, 255, 0.3),
                transparent);
    }

    .skeleton-product-card {
        background: #FFFFFF;
        border-color: #FFFFFF;
    }
}


@media (prefers-reduced-motion: reduce) {

    .skeleton,
    .skeleton::before,
    .skeleton-image::before,
    .skeleton-product-image::before,
    .skeleton-text::before,
    .skeleton-title::before,
    .skeleton-price::before,
    .skeleton-hero::before,
    .skeleton-avatar::before,
    .image-loading::before {
        animation: none;
    }
}


@media (max-width: 768px) {
    .skeleton-gallery {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 15px;
        padding: 15px;
    }

    .skeleton-hero {
        height: 250px;
    }

    .skeleton-product-image {
        aspect-ratio: 1.2;
    }


    .skeleton::before,
    .skeleton-image::before,
    .skeleton-product-image::before,
    .skeleton-text::before,
    .skeleton-title::before,
    .skeleton-price::before,
    .skeleton-hero::before,
    .skeleton-avatar::before,
    .image-loading::before {
        animation-duration: 2s;
    }
}


@media (prefers-reduced-data: reduce) {

    .skeleton::before,
    .skeleton-image::before,
    .skeleton-product-image::before,
    .skeleton-text::before,
    .skeleton-title::before,
    .skeleton-price::before,
    .skeleton-hero::before,
    .skeleton-avatar::before,
    .image-loading::before {
        animation: none;
        background: #f1f5f9;
    }
}


.skeleton-gallery,
.skeleton-product-card {
    content-visibility: auto;
    contain-intrinsic-size: 300px;
}


.color-palette-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f0f0f0 0%, #e0e0e0 100%);
    border-radius: 8px;
    overflow: hidden;
    z-index: 1;
    transition: opacity 0.6s ease-out;
    pointer-events: none;
}


.color-palette-gradient-1 {
    background: linear-gradient(135deg, var(--color-1) 0%, var(--color-2) 100%);
}

.color-palette-gradient-2 {
    background: linear-gradient(45deg, var(--color-1) 0%, var(--color-2) 50%, var(--color-3) 100%);
}

.color-palette-gradient-3 {
    background: radial-gradient(circle at 30% 30%, var(--color-1) 0%, var(--color-2) 70%, var(--color-3) 100%);
}

.color-palette-gradient-4 {
    background: conic-gradient(from 180deg at 50% 50%, var(--color-1), var(--color-2), var(--color-3), var(--color-1));
}


.color-palette-animated {
    background-size: 200% 200%;
    animation: colorPaletteShift 8s ease infinite;
}

@keyframes colorPaletteShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}


.color-palette-shimmer::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.3),
            transparent);
    animation: colorShimmer 2s infinite;
    z-index: 15;
}

@keyframes colorShimmer {
    0% {
        left: -100%;
    }

    100% {
        left: 100%;
    }
}


.image-loading.color-palette {
    background: transparent;
    border: none;
    display: block;
    position: relative;
    min-height: 200px;
}

.image-loading.color-palette .color-palette-placeholder {
    opacity: 1;
    display: block;
}

.image-loaded.color-palette .color-palette-placeholder {
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}


.image-loading.color-palette::before {
    display: none;
}


.no-cssvars .color-palette-placeholder {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}


@media (prefers-color-scheme: dark) {
    .color-palette-placeholder {
        opacity: 0.9;
    }

    .color-palette-shimmer::before {
        background: linear-gradient(90deg,
                transparent,
                rgba(255, 255, 255, 0.1),
                transparent);
    }
}


@media (prefers-reduced-motion: reduce) {
    .color-palette-animated {
        animation: none;
    }

    .color-palette-shimmer::before {
        animation: none;
    }
}


.color-palette-placeholder {
    will-change: opacity;
    contain: layout style paint;
    backface-visibility: hidden;
    transform: translateZ(0);
}


.color-palette-reveal {
    position: relative;
    overflow: hidden;
    display: block;
    width: 100%;
    height: 100%;
}

.color-palette-reveal img {
    position: relative;
    z-index: 2;
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.color-palette-reveal.image-loaded img {
    opacity: 1;
}


.color-palette-loading {
    position: relative;
    background: var(--placeholder-bg, #f8f9fa);
}

.color-palette-loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--color-gradient, linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%));
    z-index: 1;
}


.color-palette-error {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100px;
    color: #dc2626;
    border-radius: 8px;
}

.color-palette-error::after {
    content: '⚠️ Image failed to load';
    font-size: 14px;
    text-align: center;
    padding: 20px;
}

/* ==========================================================================
   SHARED QUANTITY COMPONENT
   ========================================================================== */

:root {
    --sqw-qty-bg: #ffffff;
    --sqw-qty-bg-soft: #f8fafc;
    --sqw-qty-border: #e2e8f0;
    --sqw-qty-border-strong: #cbd5e1;
    --sqw-qty-control-bg: #ffffff;
    --sqw-qty-control-hover: #f1f5f9;
    --sqw-qty-text: #0f172a;
    --sqw-qty-muted: #475569;
    --sqw-qty-accent: var(--primary-background, #7d1d60);
    --sqw-qty-focus: rgba(125, 29, 96, 0.22);
}

.sqw-qty {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    min-height: 2.75rem;
    padding: 0.25rem;
    border-radius: 0.95rem;
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03), 0 12px 24px -22px rgba(15, 23, 42, 0.35);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.sqw-qty:hover {
    border-color: var(--sqw-qty-border-strong);
}

.sqw-qty:focus-within {
    border-color: var(--sqw-qty-accent);
}


.sqw-qty--compact {
    min-height: 2.35rem;
    padding: 0.2rem;
    gap: 0.25rem;
    border-radius: 0.85rem;
}

.sqw-qty .quantity,
.sqw-qty .sqw-qty__input-wrap {
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sqw-qty__btn {
    appearance: none;
    -webkit-appearance: none;
    border: 1px solid var(--sqw-qty-border);
    background: var(--sqw-qty-control-bg);
    color: var(--sqw-qty-muted);
    width: 2.25rem;
    min-width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.7rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    line-height: 1;
    font-size: 1rem;
    font-weight: 700;
    transition: transform 0.14s ease, color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.sqw-qty--compact .sqw-qty__btn {
    width: 2rem;
    min-width: 2rem;
    height: 2rem;
    border-radius: 0.62rem;
    font-size: 0.95rem;
}

.sqw-qty__btn:hover {
    background: var(--sqw-qty-control-hover);
    border-color: var(--sqw-qty-border-strong);
    color: var(--sqw-qty-text);
}

.sqw-qty__btn:active {
    transform: scale(0.94);
}

.sqw-qty__btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--sqw-qty-focus);
}

.sqw-qty__btn:disabled,
.sqw-qty__btn.is-disabled {
    opacity: 0.45;
    cursor: not-allowed;
    color: #94a3b8;
    background: #f1f5f9;
    transform: none;
}

.sqw-qty__btn svg {
    width: 0.92rem;
    height: 0.92rem;
    pointer-events: none;
}

.sqw-qty__value {
    min-width: 2.6rem;
    height: 2.25rem;
    padding: 0;
    margin: 0;
    border: 0;
    background: transparent;
    color: var(--sqw-qty-text);
    text-align: center;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1;
    box-shadow: none;
}

.sqw-qty--compact .sqw-qty__value {
    min-width: 2.35rem;
    height: 2rem;
    font-size: 0.95rem;
}

input.sqw-qty__value {
    width: 2.8rem;
    -moz-appearance: textfield;
    appearance: textfield;
}

input.sqw-qty__value::-webkit-outer-spin-button,
input.sqw-qty__value::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input.sqw-qty__value:focus {
    outline: none;
    box-shadow: none;
}

.quantity:not(.sqw-qty__input-wrap) > input.sqw-qty__value {
    width: 4rem;
    min-width: 4rem;
    padding: 0 0.5rem;
    border: 1px solid var(--sqw-qty-border);
    border-radius: 0.75rem;
    background: #ffffff;
}

.quantity:not(.sqw-qty__input-wrap) > input.sqw-qty__value:focus {
    border-color: var(--sqw-qty-accent);
    box-shadow: 0 0 0 3px var(--sqw-qty-focus);
}

span.sqw-qty__value {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.sqw-qty-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    min-height: 64px;
    padding: 0.625rem 0.75rem 0.625rem 1rem;
    border: 1px solid var(--sqw-qty-border);
    border-radius: 1rem;
    background: #ffffff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.sqw-qty-panel:hover {
    border-color: var(--sqw-qty-border-strong);
}

.sqw-qty-panel:focus-within {
    border-color: var(--sqw-qty-accent);
}

.sqw-qty-panel .sqw-qty__label {
    margin: 0;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--sqw-qty-accent);
    line-height: 1;
}

.sqw-qty-panel .quantity-input-container {
    margin: 0;
    display: flex;
    align-items: center;
}

.variation-quantity-wrapper.sqw-qty {
    width: 100%;
    max-width: 180px;
}

@media (max-width: 640px) {
    .sqw-qty-panel {
        min-height: 56px;
        padding: 0.5rem 0.625rem 0.5rem 0.75rem;
        border-radius: 0.85rem;
    }

    .sqw-qty__btn {
        width: 2.05rem;
        min-width: 2.05rem;
        height: 2.05rem;
    }

    .sqw-qty__value {
        height: 2.05rem;
        font-size: 0.95rem;
    }
}
