/* SPAC Frontend CSS */

.spac-wrapper {
    margin: 20px 0;
    padding: 0;
    background: transparent;
    width: 100%;
    clear: both;
    display: block;
    flex: 0 0 100%;
    /* Force full width in flex container */
}

.spac-section-title {
    font-size: 1.1rem;
    margin-bottom: 12px;
    font-weight: 700;
    color: #333;
    padding: 0 5px;
    /* Alignment */
}

/* Carousel */
.spac-carousel-container {
    width: 100%;
    overflow: hidden;
    position: relative;
    padding: 10px 0 20px 0;
    /* Space for shadow */
    display: flex;
    align-items: center;
}

.spac-carousel-track {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding: 20px 30px;
    /* Extra padding prevents clipping hover shadow/movement */
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    /* Firefox */
    scroll-behavior: smooth;
    /* Smooth scrolling for buttons */
}

/* Nav Buttons */
.spac-nav-btn {
    display: none;
    /* Hidden on Mobile */
    background: transparent;
    border: none;
    color: #8a2be2;
    /* Theme color since no bg */
    width: 40px;
    height: 40px;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: none;
    /* No shadow */
    position: absolute;
    z-index: 10;
    font-weight: bold;
    font-size: 24px;
    /* Larger icon */
    transition: all 0.2s;
}

.spac-nav-btn:hover {
    background: rgba(138, 43, 226, 0.1);
    /* Subtle hover bg */
    color: #8a2be2;
    border-color: transparent;
    transform: scale(1.2);
}

.spac-prev {
    left: 10px;
}

.spac-next {
    right: 10px;
}

@media (min-width: 768px) {
    .spac-nav-btn {
        display: flex;
        /* Show on Desktop */
    }

    .spac-carousel-track {
        /* Adjust padding/margin if needed to fit buttons or let buttons float on top */
    }
}

.spac-carousel-track::-webkit-scrollbar {
    display: none;
    /* Chrome/Safari */
}

/* Addon Card */
.spac-card {
    flex: 0 0 80vw;
    /* Use vw to be independent of track padding */
    width: 80vw;
    max-width: 340px;
    background: #fff;
    border-radius: 12px;
    /* Purple Ring Effect - Visible All Time */
    box-shadow: 0 0 0 2px rgba(138, 43, 226, 0.4), 0 12px 28px rgba(138, 43, 226, 0.15);
    overflow: hidden;
    scroll-snap-align: center;
    /* Center alignment usually looks better with peeking */
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: none;
    margin-bottom: 15px;
    margin-left: 0;
    /* Remove left margin, let gap handle spacing */
}

/* On Desktop */
@media (min-width: 768px) {
    .spac-card {
        flex: 0 0 320px;
        width: 320px;
    }
}

.spac-card:hover {
    transform: translateY(-3px);
    /* Even Stronger/Solid on Hover? Or same? */
    /* Let's keep the lift but maybe slightly increase shadow depth */
    box-shadow: 0 0 0 2px rgba(138, 43, 226, 0.6), 0 16px 32px rgba(138, 43, 226, 0.2);
}

.spac-card.spac-selected {
    /* Selected State Ring */
    box-shadow: 0 0 0 2px #8a2be2, 0 8px 20px rgba(138, 43, 226, 0.2);
    border: none;
    /* box-shadow handles the ring */
    background: #fdfaff;
}

/* Structure: Main Content + Footer */
.spac-card-main {
    display: flex;
    flex-direction: row;
    /* Force Horizontal */
    padding: 12px;
    align-items: center;
    gap: 15px;
    min-height: auto;
}

.spac-card-thumb {
    width: 70px;
    height: 70px;
    flex-shrink: 0;
    background: #f9f9f9;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    align-items: center;
    justify-content: center;
    position: relative;
    /* For badge positioning */
}

.spac-thumb-badge {
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    background: #8a2be2;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    min-width: 60px;
    text-align: center;
}

.spac-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.spac-card-details {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: left;
    padding-top: 4px;
    /* Move labels downwards slightly */
    /* Ensure left alignment */
}

.spac-card-title {
    font-size: 14px;
    margin: 0 0 4px 0;
    line-height: 1.3;
    font-weight: 700;
    color: #222;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    overflow: hidden;
}

.spac-card-price-wrapper {
    display: block;
    margin-top: 2px;
}

.spac-current-price {
    font-weight: 700;
    color: #333;
    font-size: 13px;
    display: inline-block;
    padding: 2px 6px;
    background: #f0f0f0;
    border-radius: 4px;
    font-size: 11px;
    color: #555;
}

.spac-card-actions {
    margin-left: auto;
    /* Push to right */
    display: flex;
    align-items: center;
}


/* Add Button & Action Buttons */
.spac-btn-add,
.spac-btn-confirm,
.spac-btn-cancel,
.spac-btn-remove {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 8px 16px;
    /* Slightly reduced to fit better */
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    line-height: normal;
    min-width: 70px;
    /* Reduced min-width slightly */
}

/* Specific button styles override general class */
.spac-btn-add {
    background: #fff;
    border: 1px solid #e0e0e0;
    color: #4169e1;
}

.spac-btn-add:hover {
    box-shadow: 0 4px 10px rgba(138, 43, 226, 0.15);
    transform: translateY(-1px);
    background: #fff;
    border-color: #8a2be2;
    color: #8a2be2;
}

.spac-card.spac-selected .spac-btn-add {
    background: #fff;
    color: #d32f2f;
    /* Red text */
    border-color: #d32f2f;
    box-shadow: none;
}

/* Footer "Unlocked" bar */
.spac-card-footer {
    background: #f3eafa;
    /* Light purple bg */
    color: #5a2d8a;
    /* Darker purple text */
    padding: 2px 6px;
    font-size: 10px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    border-top: 1px solid #eee;
}

.spac-lock-icon {
    font-size: 12px;
}

/* Order Summary */
.spac-order-summary {
    margin-top: 15px;
    background: #fdfdfd;
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    padding: 15px;
}

.spac-summary-line {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 14px;
    color: #333;
}

.spac-summary-product {
    font-weight: 600;
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
    margin-bottom: 10px;
}

.spac-summary-addons {
    margin-bottom: 10px;
}

.spac-summary-addon-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 13px;
    color: #555;
    padding-left: 10px;
}

.spac-summary-total {
    border-top: 1px solid #eee;
    padding-top: 10px;
    margin-bottom: 0;
    font-weight: 700;
    font-size: 16px;
    color: #333;
}

.spac-summary-total .value {
    color: #00c853;
    /* Success Green */
}

/* --- Modal / Popup KFC Style --- */
.spac-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    align-items: center;
    /* Center on Desktop */
    justify-content: center;
}

.spac-modal.active {
    display: flex;
}

.spac-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    /* Darker overlay */
    backdrop-filter: blur(2px);
}

.spac-modal-content {
    position: relative;
    background: #fff;
    width: 100%;
    max-width: 450px;
    /* Mobile width */
    max-height: 90vh;
    /* Allow scrolling within modal if tall */
    border-radius: 16px;
    overflow: hidden;
    /* For image corners */
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    animation: spac-pop-in 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes spac-pop-in {
    from {
        transform: scale(0.9) translateY(20px);
        opacity: 0;
    }

    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

/* Gallery Section */
.spac-modal-gallery-container {
    position: relative;
    width: 100%;
    height: 250px;
    /* Fixed height for image area */
    background: #f5f5f5;
    flex-shrink: 0;
}

.spac-modal-gallery-track {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    height: 100%;
    scrollbar-width: none;
    /* Hide scrollbar Firefox */
    -webkit-overflow-scrolling: touch;
}

.spac-modal-gallery-track::-webkit-scrollbar {
    display: none;
    /* Hide scrollbar Chrome/Safari */
}

.spac-gallery-slide {
    flex: 0 0 100%;
    scroll-snap-align: start;
    width: 100%;
    height: 100%;
}

.spac-gallery-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Floating Close Button */
.spac-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    background: #fff;
    color: #333;
    border: none;
    border-radius: 50%;
    font-size: 20px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    z-index: 10;
    padding: 0;
}

/* Indicators */
.spac-gallery-indicators {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 5;
}

.spac-gallery-indicators span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transition: 0.3s;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.spac-gallery-indicators span.active {
    background: #fff;
    transform: scale(1.2);
}

/* Modal Body */
.spac-modal-body {
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1;
    /* Take remaining space */
}

.spac-modal-header-row {
    margin-bottom: 8px;
}

.spac-modal-title {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: #111;
    line-height: 1.3;
}

.spac-modal-price-badge {
    display: inline-block;
    background: #FFC107;
    /* Amber/Yellow tag */
    color: #333;
    font-weight: 700;
    font-size: 14px;
    padding: 2px 8px;
    border-radius: 4px;
    margin-top: 6px;
}

.spac-modal-price-badge .woocommerce-Price-amount {
    font-weight: 800;
}

.spac-modal-desc {
    font-size: 13px;
    color: #666;
    line-height: 1.5;
    margin-bottom: 20px;
}

/* Fields */
.spac-addon-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.spac-form-group {
    margin-bottom: 0;
    /* Reset */
}

.spac-form-group label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    color: #333;
    margin-bottom: 6px;
}

.spac-form-group input[type="text"],
.spac-form-group textarea,
.spac-form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    background: #f9f9f9;
    color: #333;
}

.spac-form-group input:focus,
.spac-form-group select:focus,
.spac-form-group textarea:focus {
    background: #fff;
    border-color: #8A2BE2;
    outline: none;
}

/* Footer Actions */
.spac-modal-footer-bar {
    margin-top: 20px;
    display: flex;
    gap: 12px;
    align-items: center;
    border-top: 1px solid #eee;
    /* Slight separator */
    padding-top: 15px;
}

.spac-qty-dummy {
    flex: 1;
    /* Push button to right if needed, or hold qtys */
}

.spac-btn-confirm {
    flex: 2;
    background: #DC0E2A;
    /* KFC Redish/Brand Color? Or Green for Add? User image showed Green ADD */
    /* Let's stick to Green for action or use provided image color which was green/white? */
    /* Re-checking prompt: "Add button" in image is White with Green text border? No, looks like a button "ADD" */
    /* Let's start with a solid primary color. */
    background: #00875a;
    color: #fff;
    border: none;
    padding: 14px 20px;
    font-size: 15px;
    font-weight: 700;
    border-radius: 8px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: background 0.2s;
}

.spac-btn-confirm:hover {
    background: #00704a;
}

.spac-btn-remove {
    padding: 0 15px;
    height: 48px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
    background: #fee;
    color: #d32f2f;
    border: 1px solid #ffcdd2;
    cursor: pointer;
}

/* Mobile Bottom Sheet override */
@media (max-width: 600px) {
    .spac-modal {
        align-items: flex-end;
        /* Align to bottom */
    }

    .spac-modal-content {
        max-width: 100%;
        border-radius: 20px 20px 0 0;
        /* Top corners only */
        max-height: 85vh;
        animation: spac-slide-up 0.3s ease-out;
    }

    @keyframes spac-slide-up {
        from {
            transform: translateY(100%);
        }

        to {
            transform: translateY(0);
        }
    }
}

/* Popup Alert (Bottom) */
.spac-popup-alert {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #333;
    color: #fff;
    padding: 12px 24px;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 100000;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    visibility: hidden;
}

.spac-popup-alert.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    visibility: visible;
}

.spac-popup-icon {
    font-size: 18px;
}

.spac-popup-text {
    font-weight: 600;
    color: #fff;
    font-size: 14px;
}

/* Neo Woo Sticky Bar Hidden State (added by SPAC) */
.neo-sticky-wrapper.spac-hidden {
    opacity: 0 !important;
    pointer-events: none !important;
    transition: opacity 0.3s ease;
}