/**
 * Sale Announcement Modal
 * Elegant modal for Black Friday / promotional sales
 */

/* Overlay */
.sale-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.sale-modal-overlay.active {
    opacity: 1;
    visibility: visible;
    margin-top: 0 !important;
}

/* Modal Container */
.sale-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    z-index: 9999;
    width: calc(100vw - 32px);
    max-width: 550px;
    max-height: 90vh;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
}

.sale-modal.active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

/* Modal Content */
.sale-modal-content {
    position: relative;
    background: #f8f7f5;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
}

/* Close Button */
.sale-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.2s ease;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.sale-modal-close:hover {
    background: #fff;
    transform: scale(1.1);
}

.sale-modal-close:focus {
    outline: 2px solid #383B3B;
    outline-offset: 2px;
}

.sale-modal-close svg {
    width: 18px;
    height: 18px;
    stroke: #383B3B;
    stroke-width: 2;
}

/* Image */
.sale-modal-image {
    display: block;
    width: 100%;
    height: auto;
    max-height: 70vh;
    object-fit: contain;
}

/* Link wrapper */
.sale-modal-link {
    display: block;
    text-decoration: none;
    cursor: pointer;
}

.sale-modal-link:focus {
    outline: 2px solid #383B3B;
    outline-offset: 2px;
}

/* CTA Button */
.sale-modal-cta {
    display: block;
    width: 100%;
    padding: 16px 24px;
    background: #383B3B;
    color: #fff;
    text-align: center;
    text-decoration: none;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    transition: background 0.2s ease;
}

.sale-modal-cta:hover {
    background: #2a2c2c;
}

.sale-modal-cta:focus {
    outline: 2px solid #fff;
    outline-offset: -4px;
}

/* Screen reader only text */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Mobile-first: ensure good sizing on small screens */
@media (max-width: 639px) {
    .sale-modal {
        width: calc(100vw - 24px);
    }

    .sale-modal-cta {
        padding: 14px 20px;
        font-size: 0.9rem;
    }

    .sale-modal-close {
        top: 8px;
        right: 8px;
        width: 32px;
        height: 32px;
    }

    .sale-modal-close svg {
        width: 16px;
        height: 16px;
    }
}

/* Tablet and up */
@media (min-width: 640px) {
    .sale-modal-close {
        top: 16px;
        right: 16px;
        width: 40px;
        height: 40px;
    }

    .sale-modal-close svg {
        width: 20px;
        height: 20px;
    }

    .sale-modal-cta {
        font-size: 1.1rem;
        padding: 18px 32px;
    }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .sale-modal-overlay,
    .sale-modal,
    .sale-modal-close {
        transition: none;
    }
}

/* Print: hide modal */
@media print {
    .sale-modal-overlay,
    .sale-modal {
        display: none !important;
    }
}
