/* Card actions styling */
.card-actions {
    position: absolute;
    bottom: 10px;
    right: 10px;
    display: flex;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 10;
}

.product-card:hover .card-actions {
    opacity: 1;
}

.action-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    color: white;
    transition: transform 0.2s ease, background-color 0.2s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.action-btn:hover {
    transform: scale(1.1);
}

.cart-btn {
    background-color: #28a745;
}

.cart-btn:hover {
    background-color: #218838;
}

.pdv-btn {
    background-color: #007bff;
}

.pdv-btn:hover {
    background-color: #0056b3;
}

.action-btn.share-btn,
button.action-btn.share-btn,
.card-actions .action-btn.share-btn {
    background-color: #fee300 !important; /* Vinyllia yellow with !important */
    color: #121212 !important; /* Dark text for contrast with !important */
}

.action-btn.share-btn:hover,
button.action-btn.share-btn:hover,
.card-actions .action-btn.share-btn:hover {
    background-color: #ffd700 !important; /* Slightly different yellow on hover with !important */
}

.edit-btn {
    background-color: #ffc107;
    color: #212529;
}

.edit-btn:hover {
    background-color: #e0a800;
}

.delete-btn {
    background-color: #dc3545;
}

.delete-btn:hover {
    background-color: #c82333;
}

/* Admin actions */
.admin-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 10;
}

.product-card:hover .admin-actions {
    opacity: 1;
}

/* Animation for button click */
.success-animation {
    animation: pulse 0.5s ease;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Variant badge */
.variant-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: #fee300;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    z-index: 5;
}

/* When admin actions are present, move variant badge */
.admin-actions + .variant-badge {
    top: 50px;
}

/* Share popup styling */
.share-popup {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: none !important; /* Hide by default with !important */
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
    z-index: 200; /* Higher z-index to ensure it appears above other elements */
    border-radius: 8px;
    pointer-events: none; /* Prevent interaction when hidden */
}

.share-popup.active {
    opacity: 1;
    visibility: visible;
    display: flex !important; /* Force display when active */
    pointer-events: auto; /* Allow interaction when visible */
}

.share-popup-content {
    background-color: #2a2a2a;
    border-radius: 8px;
    padding: 15px;
    width: 90%;
    max-width: 300px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    z-index: 201; /* Higher than the share-popup */
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.share-popup.active .share-popup-content {
    transform: scale(1);
}

.share-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
}

.share-popup-header h4 {
    margin: 0;
    color: #fee300;
    font-size: 1em;
}

.share-close-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    font-size: 1em;
    padding: 0;
}

.share-close-btn:hover {
    color: #fff;
}

.share-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 10px;
}

.share-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px;
    border-radius: 8px;
    color: white;
    text-decoration: none;
    transition: transform 0.2s ease;
    cursor: pointer;
    border: none;
    background-color: #333;
    font-size: 0.9em;
}

.share-option i {
    font-size: 1.5em;
    margin-bottom: 5px;
}

.share-option:hover {
    transform: translateY(-3px);
}

.share-option.facebook {
    background-color: #3b5998;
}

.share-option.twitter {
    background-color: #1da1f2;
}

.share-option.pinterest {
    background-color: #bd081c;
}

.share-option.whatsapp {
    background-color: #25d366;
}

.share-option.instagram {
    background-color: #C13584;
    background-image: linear-gradient(45deg, #C13584, #E1306C, #F56040, #FFDC80);
}

.share-option.copy-link {
    background-color: #555;
}

/* Variant selector styling */
.variant-selector {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
    z-index: 100;
    border-radius: 8px;
}

.variant-selector.active {
    opacity: 1;
    visibility: visible;
}

.variant-selector-content {
    background-color: #2a2a2a;
    border-radius: 8px;
    padding: 15px;
    width: 90%;
    max-width: 300px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.variant-selector-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
}

.variant-selector-header h4 {
    margin: 0;
    color: #fee300;
    font-size: 1em;
}

.variant-close-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    font-size: 1em;
    padding: 0;
}

.variant-close-btn:hover {
    color: #fff;
}

.variant-options {
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 15px;
}

.variant-option {
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.variant-option:last-child {
    border-bottom: none;
}

.variant-option label {
    display: flex;
    align-items: center;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.9);
}

.variant-option input {
    margin-right: 10px;
}

.variant-name {
    flex: 1;
}

.price-modifier {
    margin-left: 10px;
    color: #8bc34a;
}

.price-modifier:empty {
    display: none;
}

.stock-info {
    margin-left: 10px;
    font-size: 0.8em;
    color: rgba(255, 255, 255, 0.5);
}

.variant-actions {
    display: flex;
    justify-content: flex-end;
}

.variant-confirm-btn {
    background-color: #fee300;
    color: #000;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.variant-confirm-btn:hover {
    background-color: #ffcc00;
}

/* Mobile optimizations for variant selector */
@media (max-width: 480px) {
    .variant-selector-content,
    .share-popup-content {
        width: 95%;
        max-height: 80vh;
        overflow-y: auto;
    }
    
    .variant-options {
        max-height: 50vh;
    }
    
    .variant-option label {
        flex-wrap: wrap;
    }
    
    .stock-info {
        width: 100%;
        margin-left: 25px;
        margin-top: 5px;
    }
    
    .variant-confirm-btn {
        padding: 10px 20px;
        width: 100%;
        font-size: 16px;
    }
    
    .share-options {
        grid-template-columns: 1fr;
    }
}
