/**
 * Mundo Dependencia Rental Manager - Frontend Styles
 */

/* ===== Variables ===== */
:root {
    --md-rental-primary: #2563eb;
    --md-rental-primary-hover: #1d4ed8;
    --md-rental-secondary: #64748b;
    --md-rental-success: #10b981;
    --md-rental-warning: #f59e0b;
    --md-rental-error: #ef4444;
    --md-rental-border: #e2e8f0;
    --md-rental-bg: #f8fafc;
    --md-rental-text: #1e293b;
    --md-rental-text-light: #64748b;
    --md-rental-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    --md-rental-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* ===== Product Widget ===== */
.md-rental-product-widget {
    margin: 2rem 0;
}

.md-rental-product-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: var(--md-rental-shadow-lg);
    overflow: hidden;
    transition: transform 0.3s ease;
}

.md-rental-product-card:hover {
    transform: translateY(-4px);
}

.md-rental-product-image {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    /* 16:9 */
    overflow: hidden;
    background: var(--md-rental-bg);
}

.md-rental-product-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.md-rental-product-content {
    padding: 2rem;
}

.md-rental-product-title {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--md-rental-text);
    margin: 0 0 0.5rem 0;
}

.md-rental-product-code {
    color: var(--md-rental-text-light);
    font-size: 0.875rem;
    margin: 0 0 1rem 0;
}

.md-rental-product-description {
    color: var(--md-rental-text);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.md-rental-product-pricing {
    background: var(--md-rental-bg);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.md-rental-price-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
}

.md-rental-price-label {
    color: var(--md-rental-text-light);
    font-size: 0.875rem;
}

.md-rental-price-value {
    color: var(--md-rental-primary);
    font-size: 1.25rem;
    font-weight: 700;
}

/* ===== Category Grid ===== */
.md-rental-category-widget {
    margin: 2rem 0;
}

.md-rental-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.md-rental-filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.md-rental-filter-group label {
    font-weight: 600;
    color: var(--md-rental-text);
}

.md-rental-filter-group select {
    padding: 0.5rem 1rem;
    border: 1px solid var(--md-rental-border);
    border-radius: 6px;
    font-size: 0.875rem;
}

.md-rental-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.md-rental-product-item {
    background: #fff;
    border-radius: 12px;
    box-shadow: var(--md-rental-shadow);
    overflow: hidden;
    transition: all 0.3s ease;
}

.md-rental-product-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--md-rental-shadow-lg);
}

.md-rental-product-item .md-rental-product-image {
    padding-top: 75%;
    /* 4:3 */
}

.md-rental-badge {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
}

.md-rental-badge-small {
    background: var(--md-rental-success);
}

.md-rental-badge-large {
    background: var(--md-rental-warning);
}

.md-rental-product-info {
    padding: 1.25rem;
}

.md-rental-product-name {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--md-rental-text);
    margin: 0 0 0.25rem 0;
}

.md-rental-product-ref {
    color: var(--md-rental-text-light);
    font-size: 0.75rem;
    margin: 0 0 0.75rem 0;
}

.md-rental-product-desc {
    color: var(--md-rental-text);
    font-size: 0.875rem;
    line-height: 1.5;
    margin: 0 0 1rem 0;
}

.md-rental-product-price {
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
    margin-bottom: 0.5rem;
}

.md-rental-price-amount {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--md-rental-primary);
}

.md-rental-price-period {
    color: var(--md-rental-text-light);
    font-size: 0.875rem;
}

.md-rental-product-other-rates {
    display: flex;
    gap: 0.75rem;
    font-size: 0.75rem;
    color: var(--md-rental-text-light);
    margin-bottom: 1rem;
}

/* ===== Buttons ===== */
.md-rental-btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.md-rental-btn-primary {
    background: var(--md-rental-primary);
    color: #fff;
    width: 100%;
}

.md-rental-btn-primary:hover {
    background: var(--md-rental-primary-hover);
}

.md-rental-btn-secondary {
    background: var(--md-rental-secondary);
    color: #fff;
}

.md-rental-btn-secondary:hover {
    background: #475569;
}

.md-rental-btn-large {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

.md-rental-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ===== Modal ===== */
body.md-rental-modal-open {
    overflow: hidden;
}

.md-rental-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
}

.md-rental-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
}

.md-rental-modal-content {
    position: relative;
    max-width: 800px;
    max-height: 90vh;
    margin: 5vh auto;
    background: #fff;
    border-radius: 16px;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.md-rental-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    font-size: 2rem;
    line-height: 1;
    color: var(--md-rental-text-light);
    cursor: pointer;
    z-index: 10;
}

.md-rental-modal-close:hover {
    color: var(--md-rental-text);
}

/* ===== Checkout Form ===== */
.md-rental-checkout-container {
    padding: 2rem;
}

.md-rental-checkout-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--md-rental-text);
    margin: 0 0 2rem 0;
}

.md-rental-form-section {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--md-rental-border);
}

.md-rental-form-section:last-of-type {
    border-bottom: none;
}

.md-rental-form-section h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--md-rental-text);
    margin: 0 0 1rem 0;
}

.md-rental-form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.md-rental-form-group {
    display: flex;
    flex-direction: column;
}

.md-rental-form-full {
    grid-column: 1 / -1;
}

.md-rental-form-group label {
    font-weight: 600;
    color: var(--md-rental-text);
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.md-rental-form-group input[type="text"],
.md-rental-form-group input[type="tel"],
.md-rental-form-group input[type="email"],
.md-rental-form-group input[type="date"],
.md-rental-form-group select,
.md-rental-form-group textarea {
    padding: 0.75rem;
    border: 1px solid var(--md-rental-border);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

.md-rental-form-group input:focus,
.md-rental-form-group select:focus,
.md-rental-form-group textarea:focus {
    outline: none;
    border-color: var(--md-rental-primary);
}

.md-rental-form-group small {
    color: var(--md-rental-text-light);
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

.md-rental-selected-product-info {
    background: var(--md-rental-bg);
    padding: 1rem;
    border-radius: 8px;
}

.md-rental-selected-product-name {
    font-weight: 700;
    color: var(--md-rental-text);
    margin: 0 0 0.25rem 0;
}

.md-rental-selected-product-code {
    color: var(--md-rental-text-light);
    font-size: 0.875rem;
    margin: 0;
}

.md-rental-shipping-result {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--md-rental-bg);
    border-radius: 8px;
}

.md-rental-shipping-details p {
    margin: 0.5rem 0;
}

.md-rental-upload-preview {
    margin-top: 0.5rem;
    font-size: 0.875rem;
}

.md-rental-uploading {
    color: var(--md-rental-text-light);
}

.md-rental-upload-success {
    color: var(--md-rental-success);
    font-weight: 600;
}

.md-rental-upload-error {
    color: var(--md-rental-error);
}

.md-rental-guarantee-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.md-rental-radio-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    border: 2px solid var(--md-rental-border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.md-rental-radio-option:hover {
    border-color: var(--md-rental-primary);
}

.md-rental-radio-option input[type="radio"] {
    width: 20px;
    height: 20px;
}

.md-rental-radio-option input[type="radio"]:checked+span {
    font-weight: 600;
}

.md-rental-deposit-amount {
    color: var(--md-rental-text-light);
    font-size: 0.875rem;
}

.md-rental-card-section {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--md-rental-bg);
    border-radius: 8px;
}

/* ===== Price Summary ===== */
.md-rental-price-summary {
    background: var(--md-rental-bg);
    padding: 1.5rem !important;
    border-radius: 12px;
}

.md-rental-summary-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--md-rental-border);
}

.md-rental-summary-line:last-child {
    border-bottom: none;
}

.md-rental-summary-total {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--md-rental-primary);
    padding-top: 1rem;
    margin-top: 0.5rem;
    border-top: 2px solid var(--md-rental-border);
}

/* ===== Alerts ===== */
.md-rental-alert {
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
}

.md-rental-alert-info {
    background: #dbeafe;
    color: #1e40af;
    border-left: 4px solid var(--md-rental-primary);
}

.md-rental-alert-warning {
    background: #fef3c7;
    color: #92400e;
    border-left: 4px solid var(--md-rental-warning);
}

.md-rental-alert-error {
    background: #fee2e2;
    color: #991b1b;
    border-left: 4px solid var(--md-rental-error);
}

.md-rental-alert-success {
    background: #d1fae5;
    color: #065f46;
    border-left: 4px solid var(--md-rental-success);
}

/* ===== Success Page ===== */
.md-rental-success {
    text-align: center;
    padding: 3rem 1rem;
}

.md-rental-success-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    background: var(--md-rental-success);
    color: #fff;
    font-size: 3rem;
    line-height: 80px;
    border-radius: 50%;
}

.md-rental-success h2 {
    font-size: 2rem;
    color: var(--md-rental-text);
    margin: 0 0 1rem 0;
}

.md-rental-success p {
    font-size: 1.125rem;
    color: var(--md-rental-text);
    margin: 1rem 0;
}

/* ===== Utility ===== */
.md-rental-info-text {
    color: var(--md-rental-text-light);
    font-size: 0.875rem;
    margin: 0 0 1rem 0;
}

.md-rental-error {
    color: var(--md-rental-error);
}

.md-rental-info {
    color: var(--md-rental-text-light);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .md-rental-modal-content {
        max-width: 95%;
        margin: 2.5vh auto;
        max-height: 95vh;
    }

    .md-rental-checkout-container {
        padding: 1.5rem;
    }

    .md-rental-products-grid {
        grid-template-columns: 1fr;
    }

    .md-rental-form-row {
        grid-template-columns: 1fr;
    }
}