/* Luminal Park RMA - Custom Styles */
:root {
    --lp-primary: #CC4D00;
    --lp-primary-hover: #A33D00;
    --lp-primary-light: rgba(204, 77, 0, 0.1);
    --lp-dark: #443C3C;
    --lp-text: #252525;
    --lp-text-muted: #717171;
    --lp-bg-light: #F8F9FA;
    --lp-border: #E5E5E5;
    --lp-border-hover: #CCCCCC;
    --lp-success: #198754;
    --lp-danger: #DC3545;
    --lp-warning: #FFC107;
    --lp-focus-ring: 0 0 0 3px rgba(204, 77, 0, 0.25);
    --lp-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --lp-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --lp-shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --lp-transition: 0.2s ease;
}

html {
    font-size: 14px;
    position: relative;
    min-height: 100%;
    scroll-behavior: smooth;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--lp-text);
    background-color: var(--lp-bg-light);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Focus visible for accessibility */
:focus-visible {
    outline: 2px solid var(--lp-primary);
    outline-offset: 2px;
}

/* Remove default focus for mouse users */
:focus:not(:focus-visible) {
    outline: none;
}

/* Header */
.lp-header {
    background-color: #fff;
    border-bottom: 1px solid var(--lp-border);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.lp-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.lp-header .lp-logo img {
    max-width: 200px;
    height: auto;
    transition: opacity 0.2s;
}

@media (max-width: 767.98px) {
    .lp-header .lp-logo img {
        max-width: 140px;
    }
}

.lp-header .lp-logo:hover img {
    opacity: 0.8;
}

.lp-title {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: none;
}

.lp-title h1,
.lp-title-mobile h1 {
    color: var(--lp-dark);
    font-weight: 600;
}

.lp-title-mobile {
    border-top: 1px solid var(--lp-border);
    padding-top: 0.75rem;
}

/* Main Content */
.lp-main {
    flex: 1;
}

/* Footer */
.lp-footer {
    background-color: var(--lp-dark);
    color: #fff;
    margin-top: auto;
}

.lp-footer a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color var(--lp-transition);
    padding: 0.5rem 0; /* Better touch target */
    display: inline-block;
}

.lp-footer a:hover {
    color: #fff;
}

@media (max-width: 767.98px) {
    .lp-footer .text-md-end {
        margin-top: 1rem;
    }

    .lp-footer a {
        display: block;
        padding: 0.75rem 0;
    }

    .lp-footer a + a {
        margin-left: 0 !important;
    }
}

/* Cards */
.lp-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: var(--lp-shadow);
    border: 1px solid var(--lp-border);
    transition: box-shadow var(--lp-transition);
}

.lp-card:hover {
    box-shadow: var(--lp-shadow-lg);
}

.lp-card-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--lp-border);
}

.lp-card-body {
    padding: 1.5rem;
}

/* Buttons */
.btn-lp-primary {
    background-color: var(--lp-primary);
    border-color: var(--lp-primary);
    color: #fff;
    font-weight: 500;
    padding: 0.75rem 1.5rem;
    min-height: 48px; /* Touch target */
    border-radius: 8px;
    transition: all var(--lp-transition);
    position: relative;
    overflow: hidden;
}

.btn-lp-primary:hover {
    background-color: var(--lp-primary-hover);
    border-color: var(--lp-primary-hover);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(204, 77, 0, 0.3);
}

.btn-lp-primary:focus-visible {
    box-shadow: var(--lp-focus-ring);
}

.btn-lp-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(204, 77, 0, 0.2);
}

.btn-lp-primary:disabled,
.btn-lp-primary.disabled {
    background-color: #CCCCCC;
    border-color: #CCCCCC;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-lp-primary.loading {
    color: transparent;
    pointer-events: none;
}

.btn-lp-primary.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: lp-spin 0.8s linear infinite;
}

.btn-lp-secondary {
    background-color: #fff;
    border: 2px solid var(--lp-border);
    color: var(--lp-text);
    font-weight: 500;
    padding: 0.75rem 1.5rem;
    min-height: 48px; /* Touch target */
    border-radius: 8px;
    transition: all var(--lp-transition);
}

.btn-lp-secondary:hover {
    background-color: var(--lp-bg-light);
    border-color: var(--lp-border-hover);
    color: var(--lp-text);
}

.btn-lp-secondary:focus-visible {
    box-shadow: var(--lp-focus-ring);
}

.btn-lp-secondary:active {
    background-color: var(--lp-border);
}

.btn-lp-secondary:disabled,
.btn-lp-secondary.disabled {
    background-color: var(--lp-bg-light);
    border-color: var(--lp-border);
    color: var(--lp-text-muted);
    cursor: not-allowed;
}

/* Forms */
.form-control,
.form-select {
    border-radius: 8px;
    border: 1px solid var(--lp-border);
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control::placeholder,
.form-select::placeholder {
    color: var(--lp-text-muted);
    opacity: 0.6;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--lp-primary);
    box-shadow: 0 0 0 3px rgba(204, 77, 0, 0.15);
}

.form-control.is-invalid,
.form-select.is-invalid {
    border-color: var(--lp-danger);
}

.form-control.is-invalid:focus,
.form-select.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.15);
}

.form-label {
    font-weight: 500;
    color: var(--lp-text);
    margin-bottom: 0.5rem;
}

.form-text {
    color: var(--lp-text-muted);
    font-size: 0.875rem;
}

.invalid-feedback {
    font-size: 0.875rem;
}

/* Disable green validation marks - only show red for errors */
.form-control.is-valid,
.was-validated .form-control:valid {
    border-color: var(--lp-border);
    background-image: none;
}

.form-control.is-valid:focus,
.was-validated .form-control:valid:focus {
    border-color: var(--lp-primary);
    box-shadow: var(--lp-focus-ring);
}

/* Wizard Steps */
.lp-wizard-steps {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 2rem;
    padding: 0;
    list-style: none;
}

.lp-wizard-step {
    display: flex;
    align-items: center;
    color: var(--lp-text-muted);
}

.lp-wizard-step-number {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--lp-border);
    color: var(--lp-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin-right: 0.5rem;
    transition: all 0.3s;
}

.lp-wizard-step.active .lp-wizard-step-number {
    background-color: var(--lp-primary);
    color: #fff;
}

.lp-wizard-step.completed .lp-wizard-step-number {
    background-color: var(--lp-success);
    color: #fff;
}

.lp-wizard-step-label {
    font-weight: 500;
    display: none;
}

@media (min-width: 768px) {
    .lp-wizard-step-label {
        display: block;
    }
}

.lp-wizard-step.active .lp-wizard-step-label {
    color: var(--lp-primary);
}

.lp-wizard-step.completed .lp-wizard-step-label {
    color: var(--lp-success);
}

.lp-wizard-step-divider {
    width: 40px;
    height: 2px;
    background-color: var(--lp-border);
    margin: 0 1rem;
}

.lp-wizard-step.completed + .lp-wizard-step-divider,
.lp-wizard-step-divider.completed {
    background-color: var(--lp-success);
}

/* Order Cards */
.lp-order-card {
    background: #fff;
    border: 2px solid var(--lp-border);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.lp-order-card:hover {
    border-color: var(--lp-primary);
    box-shadow: 0 4px 12px rgba(204, 77, 0, 0.1);
}

.lp-order-card.selected {
    border-color: var(--lp-primary);
    background-color: rgba(204, 77, 0, 0.03);
}

.lp-order-card.disabled {
    opacity: 0.55;
    cursor: not-allowed;
    pointer-events: none;
    background-color: #f8f9fa;
}

.lp-order-card .order-number {
    font-weight: 600;
    color: var(--lp-primary);
}

.lp-order-card .order-date {
    color: var(--lp-text-muted);
    font-size: 0.875rem;
}

.lp-order-card .order-total {
    font-weight: 600;
    font-size: 1.125rem;
}

/* Item Cards */
.lp-item-card {
    background: #fff;
    border: 1px solid var(--lp-border);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.75rem;
}

.lp-item-card.selected {
    border-color: var(--lp-primary);
    background-color: rgba(204, 77, 0, 0.02);
}

.lp-item-card.disabled {
    background-color: var(--lp-bg-light);
    cursor: default;
}

.lp-item-image {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border-radius: 4px;
    background: var(--lp-bg-light);
}

.lp-item-code {
    font-size: 0.75rem;
    color: var(--lp-text-muted);
    font-family: monospace;
}

/* Return Type Selection */
.lp-return-type {
    background: #fff;
    border: 2px solid var(--lp-border);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.2s;
}

.lp-return-type:hover {
    border-color: var(--lp-primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.lp-return-type-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--lp-primary);
}

.lp-return-type-title {
    font-weight: 600;
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
}

.lp-return-type-desc {
    color: var(--lp-text-muted);
    font-size: 0.875rem;
}

/* Alerts */
.lp-alert {
    border-radius: 8px;
    padding: 1rem 1.25rem;
    border: none;
}

.lp-alert-success {
    background-color: rgba(25, 135, 84, 0.1);
    color: var(--lp-success);
}

.lp-alert-danger {
    background-color: rgba(220, 53, 69, 0.1);
    color: var(--lp-danger);
}

.lp-alert-warning {
    background-color: rgba(255, 193, 7, 0.15);
    color: #856404;
}

.lp-alert-info {
    background-color: rgba(13, 202, 240, 0.1);
    color: #055160;
}

/* Summary Table */
.lp-summary-table {
    width: 100%;
}

.lp-summary-table th,
.lp-summary-table td {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--lp-border);
}

.lp-summary-table th {
    font-weight: 500;
    color: var(--lp-text-muted);
    text-align: left;
}

.lp-summary-table td {
    text-align: right;
}

.lp-summary-table tr:last-child th,
.lp-summary-table tr:last-child td {
    border-bottom: none;
}

/* Loading Spinner */
.lp-spinner {
    display: inline-block;
    width: 1.5rem;
    height: 1.5rem;
    border: 2px solid var(--lp-border);
    border-top-color: var(--lp-primary);
    border-radius: 50%;
    animation: lp-spin 0.8s linear infinite;
}

@keyframes lp-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Confirmation Page */
.lp-confirmation-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-color: rgba(25, 135, 84, 0.1);
    color: var(--lp-success);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    margin: 0 auto 1.5rem;
}

/* Quantity Input */
.lp-qty-input {
    display: flex;
    align-items: center;
}

.lp-qty-input .btn {
    width: 44px;
    height: 44px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 1.25rem;
    transition: all var(--lp-transition);
}

.lp-qty-input .btn:active {
    transform: scale(0.95);
}

.lp-qty-input input {
    width: 60px;
    height: 44px;
    text-align: center;
    margin: 0 0.5rem;
    border-radius: 8px;
    font-weight: 600;
}

/* Responsive */
@media (max-width: 575.98px) {
    .lp-card-header,
    .lp-card-body {
        padding: 1rem;
    }

    .lp-wizard-step-divider {
        width: 20px;
        margin: 0 0.5rem;
    }

    /* Navigation buttons on mobile */
    .d-flex.justify-content-between:has(.btn-lp-primary):has(.btn-lp-secondary) {
        flex-direction: column-reverse;
        gap: 0.75rem;
    }

    .d-flex.justify-content-between:has(.btn-lp-primary):has(.btn-lp-secondary) .btn-lp-primary,
    .d-flex.justify-content-between:has(.btn-lp-primary):has(.btn-lp-secondary) .btn-lp-secondary {
        width: 100%;
        margin: 0;
    }
}

/* Sticky Buttons */
.lp-sticky-buttons {
    position: sticky;
    bottom: 0;
    background: #fff;
    padding: 1.25rem 1.5rem;
    margin: 0 -1.5rem -1.5rem -1.5rem;
    border-top: 1px solid var(--lp-border);
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.08);
    border-radius: 0 0 12px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    z-index: 100;
}

/* When buttons need to be fixed at bottom of viewport */
.lp-sticky-buttons.is-fixed {
    position: fixed;
    bottom: 0;
    /* width and left are set dynamically by JavaScript based on card width */
    margin: 0;
    border-radius: 0;
    padding: 1rem 1.5rem;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.12);
    z-index: 1000;
}

.lp-sticky-buttons .btn {
    min-width: 140px;
    padding: 0.75rem 1.5rem;
}

@media (max-width: 575.98px) {
    .lp-sticky-buttons {
        flex-direction: column-reverse;
        gap: 0.75rem;
        padding: 1rem;
        margin: 0 -1rem -1rem -1rem;
    }

    .lp-sticky-buttons .btn-lp-primary,
    .lp-sticky-buttons .btn-lp-secondary {
        width: 100%;
        margin: 0;
    }
}

/* Mobile responsive for fixed buttons */
@media (max-width: 575.98px) {
    .lp-sticky-buttons.is-fixed {
        flex-direction: column-reverse;
        gap: 0.75rem;
        padding: 1rem;
    }

    .lp-sticky-buttons.is-fixed .btn-lp-primary,
    .lp-sticky-buttons.is-fixed .btn-lp-secondary {
        width: 100%;
        margin: 0;
    }
}
