/* =========================
   SHARED COMPONENTS
   - image controls
   - popups
   - sliders
   - messages / animations
========================= */

/* Image controls (used in cart + product list) */
.image-controls {
    margin-top: 10px;
    display: flex;
    gap: 10px;
    justify-content: center;
}

.image-controls .edit-image,
.image-controls .replace-image,
.image-controls .delete-image {
    padding: 8px 16px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #f9f9f9;
    cursor: pointer;
}

.image-controls .edit-image:hover,
.image-controls .replace-image:hover,
.image-controls .delete-image:hover {
    background: #e0e0e0;
}

/* Upload row helpers */
.upload-row {
    display: flex;
    align-items: center;
    gap: 15px;
}

.upload-wrapper {
    display: inline-block;
}

/* Background slider */
.background-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 80%;
    height: 20px;
    background: #ddd;
    outline: none;
    opacity: 0.7;
    transition: opacity 0.2s;
    margin: 0 auto;
    display: block;
    border-radius: 5px;
}

.background-slider:hover {
    opacity: 1;
}

.background-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 30px;
    height: 30px;
    background: #4CAF50;
    cursor: pointer;
    border-radius: 50%;
    border: none;
}

.background-slider::-moz-range-thumb {
    width: 30px;
    height: 30px;
    background: #4CAF50;
    cursor: pointer;
    border-radius: 50%;
    border: none;
}

/* Add-to-cart popup */
.add-to-cart-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.7);
    color: #fff;
    padding: 20px;
    border-radius: 5px;
    z-index: 13000;
    text-align: center;
    min-width: 200px;
}
.add-to-cart-popup > div:first-child {
    margin-bottom: 10px;
}
.add-to-cart-popup > div:nth-child(2) {
    width: 100%;
    height: 20px;
    background: #555;
    border-radius: 3px;
    overflow: hidden;
}
.add-to-cart-popup > div:nth-child(2) > div {
    width: 0%;
    height: 100%;
    background: #4caf50;
    transition: width 0.1s linear;
}

/* Undo popup */
.undo-popup {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #333;
    color: #fff;
    padding: 10px 20px;
    border-radius: 5px;
    z-index: 1000;
}
.undo-popup a {
    color: #00f;
    text-decoration: underline;
}

/* View button highlight */
.edit-image.highlight-view-button {
    background-color: #4caf50 !important;
    color: #fff !important;
    animation: pulse 1.5s infinite;
    transition: background-color 0.3s, color 0.3s;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Cropper message */
.cropper-message {
    opacity: 1;
    transition: opacity 0.3s ease;
    border: 1px solid red; /* Temporary for debugging */
    display: block !important;
    visibility: visible !important;
}
.cropper-message.fadeOut {
    opacity: 0;
}

/* =========================
   Disabled product links (Cart + Checkout)
   - Keep <a> wrapper for layout/CSS, but remove hover/underline/click affordances.
========================= */
a.solfeno-no-product-link,
a.solfeno-no-product-link:hover,
a.solfeno-no-product-link:focus,
a.solfeno-no-product-link:active,
a.solfeno-no-product-link:visited {
    text-decoration: none !important;
    color: inherit !important;
    cursor: default !important;
}

/* Make it non-interactive */
a.solfeno-no-product-link {
    pointer-events: none;
}
