/* ============================================
   COMPONENTES DE UI - ESTILOS COMPARTIDOS
   ============================================ */

/* Loader/Spinner */
.loader-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    min-height: 200px;
}

.loader-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #2ba1d7;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loader-message {
    margin-top: 15px;
    color: #666;
    font-size: 14px;
}

/* Error Message */
.error-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    background-color: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    margin: 20px;
}

.error-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.error-text {
    color: #856404;
    font-size: 16px;
    margin-bottom: 15px;
    max-width: 500px;
}

.error-retry-btn {
    background-color: #2ba1d7;
    color: white;
    border: none;
    padding: 10px 25px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.error-retry-btn:hover {
    background-color: #2391c3;
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.6;
}

.empty-message {
    color: #666;
    font-size: 16px;
    max-width: 400px;
}

/* Toast Notifications */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 10000;
    transform: translateX(400px);
    transition: transform 0.3s ease;
    max-width: 350px;
}

.toast.toast-show {
    transform: translateX(0);
}

.toast-icon {
    font-size: 20px;
    font-weight: bold;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.toast-success .toast-icon {
    background-color: #5ecb8c;
    color: white;
}

.toast-error .toast-icon {
    background-color: #dc3545;
    color: white;
}

.toast-info .toast-icon {
    background-color: #2ba1d7;
    color: white;
}

.toast-message {
    color: #333;
    font-size: 14px;
    flex: 1;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.modal-show {
    opacity: 1;
}

.modal {
    background-color: white;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal-overlay.modal-show .modal {
    transform: scale(1);
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    margin: 0;
    font-size: 20px;
    color: #333;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.modal-close:hover {
    color: #333;
}

.modal-body {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-body p {
    margin: 0 0 15px 0;
    color: #666;
    line-height: 1.6;
}

.modal-buttons {
    padding: 15px 20px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.modal-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-btn-primary {
    background-color: #2ba1d7;
    color: white;
}

.modal-btn-primary:hover {
    background-color: #2391c3;
}

.modal-btn-secondary {
    background-color: #e0e0e0;
    color: #333;
}

.modal-btn-secondary:hover {
    background-color: #d0d0d0;
}

/* Coupon Card */
.cupon-card {
    background-color: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.cupon-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.cupon-image-container {
    position: relative;
    width: 100%;
    padding-top: 67.85%; /* 280/190 aspect ratio */
    overflow: hidden;
    background-color: #f5f5f5;
}

.cupon-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cupon-discount {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: #00674a;
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 14px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.cupon-info {
    padding: 15px;
}

.cupon-title {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
}

.cupon-empresa {
    margin: 0 0 8px 0;
    font-size: 14px;
    color: #2ba1d7;
    font-weight: 500;
}

.cupon-description {
    margin: 0 0 8px 0;
    font-size: 13px;
    color: #666;
    line-height: 1.4;
}

.cupon-expiry {
    margin: 0;
    font-size: 12px;
    color: #999;
}

/* Category Card */
.categoria-card {
    background-color: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.categoria-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.categoria-image-container {
    position: relative;
    width: 100%;
    padding-top: 67.85%;
    overflow: hidden;
    background-color: #f5f5f5;
}

.categoria-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.categoria-info {
    padding: 15px;
    background: linear-gradient(135deg, #2ba1d7 0%, #5ecb8c 100%);
}

.categoria-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: white;
    text-align: center;
}

/* Responsive Design */
@media (max-width: 768px) {
    .toast {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }

    .modal {
        width: 95%;
    }

    .modal-buttons {
        flex-direction: column;
    }

    .modal-btn {
        width: 100%;
    }
}
