/**
 * RRT Webshop - Componentes UI
 * Botones, Cards, Formularios, etc.
 */

/* Botones */
.btn {
    display: inline-block;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all var(--transition-normal);
    font-family: var(--font-primary);
    line-height: 1.5;
}

.btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(39, 174, 96, 0.3);
}

.btn-primary {
    background-color: var(--primary-green);
    color: var(--white);
}

.btn-primary:hover {
    background-color: var(--dark-green);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    text-decoration: none;
}

.btn-secondary {
    background-color: var(--medium-gray);
    color: var(--white);
}

.btn-secondary:hover {
    background-color: var(--dark-gray);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    text-decoration: none;
}

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--primary-green);
    color: var(--primary-green);
}

.btn-outline:hover {
    background-color: var(--primary-green);
    color: var(--white);
    text-decoration: none;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 1.125rem;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.875rem;
}

.btn-block {
    display: block;
    width: 100%;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Cards */
.card {
    background-color: var(--white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: all var(--transition-normal);
    border: 1px solid var(--light-gray);
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.card-header {
    padding: var(--spacing-md);
    background-color: var(--lighter-gray);
    border-bottom: 1px solid var(--light-gray);
}

.card-body {
    padding: var(--spacing-md);
}

.card-footer {
    padding: var(--spacing-md);
    background-color: var(--lighter-gray);
    border-top: 1px solid var(--light-gray);
}

.card-img {
    width: 100%;
    height: auto;
    display: block;
}

.card-img-top {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

/* Product Card */
.product-card {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.product-card-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
    background-color: var(--light-gray);
}

.product-card-body {
    padding: var(--spacing-md);
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--dark-gray);
    margin-bottom: var(--spacing-xs);
    min-height: 3rem;
}

.product-card-description {
    color: var(--medium-gray);
    font-size: 0.875rem;
    margin-bottom: var(--spacing-sm);
    flex-grow: 1;
}

.product-card-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-green);
    margin-bottom: var(--spacing-sm);
}

.product-card-footer {
    padding: var(--spacing-md);
    border-top: 1px solid var(--light-gray);
}

/* Formularios */
.form-group {
    margin-bottom: var(--spacing-md);
}

.form-label {
    display: block;
    margin-bottom: var(--spacing-xs);
    font-weight: 600;
    color: var(--dark-gray);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    font-size: 1rem;
    font-family: var(--font-primary);
    color: var(--dark-gray);
    background-color: var(--white);
    border: 2px solid var(--light-gray);
    border-radius: var(--border-radius);
    transition: all var(--transition-fast);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-green);
    box-shadow: 0 0 0 3px rgba(39, 174, 96, 0.1);
}

.form-control::placeholder {
    color: var(--medium-gray);
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

select.form-control {
    cursor: pointer;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: var(--border-radius);
}

.badge-primary {
    background-color: var(--primary-green);
    color: var(--white);
}

.badge-secondary {
    background-color: var(--medium-gray);
    color: var(--white);
}

.badge-success {
    background-color: var(--success);
    color: var(--white);
}

.badge-warning {
    background-color: var(--warning);
    color: var(--white);
}

.badge-danger {
    background-color: var(--danger);
    color: var(--white);
}

/* Alerts */
.alert {
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    border: 1px solid transparent;
    border-radius: var(--border-radius);
}

.alert-success {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.alert-warning {
    background-color: #fff3cd;
    border-color: #ffeaa7;
    color: #856404;
}

.alert-danger {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.alert-info {
    background-color: #d1ecf1;
    border-color: #bee5eb;
    color: #0c5460;
}

/* Breadcrumbs */
.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    padding: var(--spacing-sm) 0;
    margin-bottom: var(--spacing-md);
    list-style: none;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "/";
    padding: 0 var(--spacing-xs);
    color: var(--medium-gray);
}

.breadcrumb-item a {
    color: var(--medium-gray);
}

.breadcrumb-item.active {
    color: var(--dark-gray);
}

/* Paginación */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--spacing-xs);
    margin: var(--spacing-lg) 0;
}

.pagination a,
.pagination span {
    display: inline-block;
    padding: 8px 12px;
    border: 1px solid var(--light-gray);
    border-radius: var(--border-radius);
    color: var(--dark-gray);
    text-decoration: none;
    transition: all var(--transition-fast);
}

.pagination a:hover {
    background-color: var(--primary-green);
    color: var(--white);
    border-color: var(--primary-green);
}

.pagination .active {
    background-color: var(--primary-green);
    color: var(--white);
    border-color: var(--primary-green);
}

/* Loading Spinner */
.spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid var(--light-gray);
    border-top-color: var(--primary-green);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    overflow: auto;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: var(--white);
    margin: auto;
    padding: var(--spacing-lg);
    border-radius: var(--border-radius-lg);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--light-gray);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--medium-gray);
    transition: color var(--transition-fast);
}

.modal-close:hover {
    color: var(--dark-gray);
}

