/**
 * ArturDevs - Comprar Page CSS
 * Estilos específicos para la página de checkout/comprar
 * @version 2.0.0
 */

/* ==========================================================================
   Checkout Section
   ========================================================================== */
.checkout-section {
    flex: 1;
    padding: 3rem 0;
}

.checkout-header {
    text-align: center;
    margin-bottom: 3rem;
}

.checkout-header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.checkout-header p {
    color: var(--text-secondary);
    font-size: 1.125rem;
}

/* ==========================================================================
   Steps
   ========================================================================== */
.checkout-steps {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.step {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    background: var(--card-bg);
    border-radius: 50px;
    border: 1px solid var(--border-color);
}

.step.active {
    border-color: var(--primary);
    background: var(--primary);
    color: white;
}

.step-number {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
}

.step.active .step-number {
    background: white;
    color: var(--primary);
}

.step-label {
    font-weight: 600;
    font-size: 0.9rem;
}

/* ==========================================================================
   Checkout Cards
   ========================================================================== */
.checkout-card {
    background: var(--card-bg);
    border-radius: 20px;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.checkout-card-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.checkout-card-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.checkout-card-header h2 i {
    color: var(--primary);
}

.checkout-card-body {
    padding: 1.5rem;
}

/* ==========================================================================
   Form Elements
   ========================================================================== */
.form-label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.form-control,
.form-select {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.form-control::placeholder {
    color: var(--text-muted);
}

/* ==========================================================================
   Product Selection - Option Style
   ========================================================================== */
.product-option {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 16px;
    padding: 1.25rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 1rem;
}

.product-option:hover {
    border-color: var(--primary-light);
}

.product-option.selected {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
}

.product-option input {
    display: none;
}

.product-option-header {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.product-option-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
    overflow: hidden;
}

.product-option-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-option-info {
    flex: 1;
}

.product-option-name {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.product-option-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.product-option-check {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: transparent;
    transition: all 0.3s ease;
}

.product-option.selected .product-option-check {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* ==========================================================================
   Product Selection - Grid Style
   ========================================================================== */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.25rem;
}

@media (max-width: 576px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}

.product-grid-item {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.product-grid-item:hover {
    border-color: var(--primary-light);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.15);
}

.product-grid-item.selected {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.08);
}

.product-grid-item input {
    display: none;
}

.product-grid-icon {
    width: 72px;
    height: 72px;
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
}

.product-grid-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-grid-icon i {
    font-size: 2rem;
    color: white;
}

.product-grid-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-primary);
    line-height: 1.3;
}

.product-grid-item .product-option-check {
    margin-top: auto;
}

.product-grid-item.selected .product-option-check {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* ==========================================================================
   Product Header (Pre-selected)
   ========================================================================== */
.product-header-checkout {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(14, 165, 233, 0.1) 100%);
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
}

.product-header-checkout::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--banner-url, none);
    background-size: cover;
    background-position: center;
    opacity: 0.15;
    z-index: 0;
}

.product-header-content {
    position: relative;
    z-index: 1;
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

@media (max-width: 576px) {
    .product-header-content {
        flex-direction: column;
        text-align: center;
    }
}

.product-header-icon {
    width: 100px;
    height: 100px;
    border-radius: 20px;
    overflow: hidden;
    flex-shrink: 0;
    background: white;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.product-header-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-header-icon i {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 2.5rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
}

.product-header-info h2 {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.product-header-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

@media (max-width: 576px) {
    .product-header-meta {
        justify-content: center;
    }
}

.product-header-meta-item {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.product-header-meta-item i {
    color: var(--primary);
}

.product-header-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.6;
}

/* ==========================================================================
   License Type Selection
   ========================================================================== */
.license-types {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

@media (max-width: 768px) {
    .license-types {
        grid-template-columns: 1fr;
    }
}

.license-type {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.license-type:hover {
    border-color: var(--primary-light);
}

.license-type.selected {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
}

.license-type.recommended::before {
    content: 'RECOMENDADO';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.65rem;
    font-weight: 700;
}

.license-type input {
    display: none;
}

.license-type-name {
    font-weight: 700;
    font-size: 1.125rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.license-type-sites {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.license-type-price {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
}

.license-type-price span {
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--text-muted);
}

/* ==========================================================================
   Duration Selection
   ========================================================================== */
.duration-options {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
}

@media (max-width: 576px) {
    .duration-options {
        grid-template-columns: repeat(2, 1fr);
    }
}

.duration-option {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.duration-option:hover {
    border-color: var(--primary-light);
}

.duration-option.selected {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
}

.duration-option input {
    display: none;
}

.duration-months {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.duration-discount {
    font-size: 0.75rem;
    color: var(--success);
    font-weight: 600;
}

/* ==========================================================================
   Order Summary
   ========================================================================== */
.order-summary {
    background: var(--bg-tertiary);
    border-radius: 16px;
    padding: 1.5rem;
}

.order-line {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px dashed var(--border-color);
}

.order-line:last-child {
    border-bottom: none;
}

.order-line .label {
    color: var(--text-secondary);
}

.order-line .value {
    font-weight: 600;
    color: var(--text-primary);
}

.order-total {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--primary);
}

/* ==========================================================================
   Checkout Button
   ========================================================================== */
.btn-checkout {
    width: 100%;
    padding: 1.25rem;
    font-size: 1.125rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border: none;
    border-radius: 16px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.btn-checkout:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px -10px rgba(99, 102, 241, 0.5);
}

.btn-checkout:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* ==========================================================================
   Secure & Stripe Badges
   ========================================================================== */
.secure-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.secure-badge i {
    font-size: 1.25rem;
}

.stripe-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
    padding: 1rem;
    background: var(--bg-tertiary);
    border-radius: 12px;
}

.stripe-badge img {
    height: 24px;
}

.stripe-badge span {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* ==========================================================================
   Subscription Toggle
   ========================================================================== */
.subscription-option {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 1.5rem;
}

.subscription-toggle {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    cursor: pointer;
    position: relative;
}

.subscription-toggle input {
    display: none;
}

.subscription-toggle-slider {
    width: 56px;
    height: 30px;
    background: var(--bg-tertiary);
    border-radius: 30px;
    position: relative;
    transition: all 0.3s ease;
    flex-shrink: 0;
    border: 2px solid var(--border-color);
}

.subscription-toggle-slider::after {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    background: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.subscription-toggle input:checked + .subscription-toggle-slider {
    background: var(--primary);
    border-color: var(--primary);
}

.subscription-toggle input:checked + .subscription-toggle-slider::after {
    left: calc(100% - 24px);
}

.subscription-toggle-content {
    flex: 1;
}

.subscription-toggle-title {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
}

.subscription-toggle-desc {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.subscription-benefits {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    background: rgba(99, 102, 241, 0.05);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 12px;
    padding: 1rem;
}

@media (max-width: 576px) {
    .subscription-benefits {
        grid-template-columns: 1fr;
    }
}

.benefit-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.benefit-item i {
    font-size: 1rem;
    color: var(--success);
}

.subscription-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 10px;
    margin-top: 1rem;
    font-size: 0.875rem;
}

.subscription-indicator i {
    color: var(--primary);
}

.subscription-indicator.hidden {
    display: none;
}

/* ==========================================================================
   Error Alert
   ========================================================================== */
.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--danger);
    color: var(--danger);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
