/**
 * Riverside Pharmacy Ordering - Frontend Styles
 * 
 * Uses CSS variables from the Riverside Farm theme
 */

/* ==========================================================================
   CSS Variables (fallbacks if theme vars not available)
   ========================================================================== */

:root {
    /* Brand accent color (gold/olive) */
    --rpo-accent: #A69B73;
    --rpo-accent-dark: #8f8461;
    --rpo-accent-light: #bdb19b;
    
    /* Blue for links/actions */
    --rpo-primary: var(--color-primary, #2288c9);
    --rpo-primary-dark: var(--color-primary-dark, #105a88);
    
    /* Green for success states */
    --rpo-secondary: var(--color-secondary, #166734);
    --rpo-secondary-dark: var(--color-secondary-dark, #0f4a25);
    
    /* Text colors */
    --rpo-text: var(--color-text-body, #595954);
    --rpo-text-heading: var(--color-text-heading, #2d2d2a);
    --rpo-text-light: var(--color-text-light, #7a7a73);
    --rpo-text-primary: #28333A;
    --rpo-text-secondary: #666666;
    
    /* Backgrounds */
    --rpo-bg-white: var(--color-bg-white, #ffffff);
    --rpo-bg-light: var(--color-bg-light, #f8f9fa);
    --rpo-bg-warm: #F3F3F1;
    
    /* UI */
    --rpo-radius: var(--radius-md, 8px);
    --rpo-radius-lg: var(--radius-lg, 12px);
    --rpo-shadow: var(--shadow-md, 0 4px 6px -1px rgba(0, 0, 0, 0.1));
    --rpo-shadow-lg: var(--shadow-lg, 0 10px 15px -3px rgba(0, 0, 0, 0.1));
    --rpo-transition: var(--transition-base, 250ms ease);
    --rpo-font-body: var(--font-body, 'Poppins', sans-serif);
    
    /* Status colors */
    --rpo-success: #10b981;
    --rpo-warning: #f59e0b;
    --rpo-error: #ef4444;
    --rpo-info: #3b82f6;
}

/* ==========================================================================
   Base Layout
   ========================================================================== */

.rpo-order-form,
.rpo-order-summary,
.rpo-confirmation,
.rpo-order-history,
.rpo-order-detail-public {
    font-family: var(--rpo-font-body);
    color: var(--rpo-text);
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    padding-top: 70px;
    padding-bottom: 70px;
}
.rpo-order-form input[type="text"], .rpo-order-form input[type="email"], .rpo-order-form input[type="tel"], .rpo-order-form input[type="password"], .rpo-order-form input[type="search"], .rpo-order-form input[type="url"], .rpo-order-form input[type="number"], .rpo-order-form textarea, .rpo-order-form select{
    padding: 10px;
    font-size: 15px;
}
/* ==========================================================================
   Header
   ========================================================================== */

.rpo-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.rpo-header h1 {
    margin: 0 0 0.25rem;
    font-size: 1.75rem;
    color: var(--rpo-text-heading);
}

.rpo-welcome-text {
    margin: 0;
    color: var(--rpo-text-light);
    font-size: 0.95rem;
}

.rpo-header__actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.rpo-back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--rpo-primary);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    text-decoration: none;
}

.rpo-back-link:hover {
    color: var(--rpo-primary-dark);
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.rpo-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: var(--rpo-font-body);
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.75rem 1.25rem;
    border-radius: var(--rpo-radius);
    border: 2px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--rpo-transition);
    white-space: nowrap;
}

.rpo-btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

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

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

.rpo-btn--primary:disabled,
.rpo-btn--primary.rpo-btn--disabled {
    background-color: #cbd5e1;
    border-color: #cbd5e1;
    color: #94a3b8;
    cursor: not-allowed;
    opacity: 0.6;
}

.rpo-btn--primary:disabled:hover,
.rpo-btn--primary.rpo-btn--disabled:hover {
    transform: none;
    box-shadow: none;
}

.rpo-btn--secondary {
    background-color: var(--rpo-secondary);
    color: white;
    border-color: var(--rpo-secondary);
}

.rpo-btn--secondary:hover {
    background-color: var(--rpo-secondary-dark);
    border-color: var(--rpo-secondary-dark);
    color: white;
}

.rpo-btn--outline {
    background-color: transparent;
    color: var(--rpo-primary);
    border-color: var(--rpo-primary);
}

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

.rpo-btn--text {
    background: transparent;
    color: var(--rpo-text-light);
    border-color: transparent;
    padding: 0.5rem 0.75rem;
}

.rpo-btn--text:hover {
    color: var(--rpo-text-heading);
    text-decoration: none;
}

.rpo-btn--large {
    font-size: 1rem;
    padding: 1rem 2rem;
}

.rpo-btn--small {
    font-size: 0.8125rem;
    padding: 0.5rem 1rem;
}

/* ==========================================================================
   Notices
   ========================================================================== */

.rpo-notices {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.rpo-notice {
    display: flex;
    gap: 1rem;
    padding: 1.25rem;
    border-radius: var(--rpo-radius);
    background: white;
    border: 1px solid #e5e7eb;
}

.rpo-notice--info {
    background: #eff6ff;
    border-color: #bfdbfe;
}

.rpo-notice--info .rpo-notice__icon {
    color: var(--rpo-info);
}

.rpo-notice--success {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.rpo-notice--success .rpo-notice__icon {
    color: var(--rpo-success);
}

.rpo-notice--warning {
    background: #fffbeb;
    border-color: #fde68a;
}

.rpo-notice--warning .rpo-notice__icon {
    color: var(--rpo-warning);
}

.rpo-notice--error {
    background: #fef2f2;
    border-color: #fecaca;
}

.rpo-notice--error .rpo-notice__icon {
    color: var(--rpo-error);
}

.rpo-notice__icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
}

.rpo-notice__content strong {
    display: block;
    color: var(--rpo-text-heading);
    margin-bottom: 0.25rem;
}

.rpo-notice__content p {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.5;
}

/* ==========================================================================
   Category Navigation
   ========================================================================== */

.rpo-category-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--rpo-bg-light);
    border-radius: var(--rpo-radius);
}

.rpo-category-btn {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 9999px;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--rpo-text);
    cursor: pointer;
    transition: all var(--rpo-transition);
}

.rpo-category-btn:hover {
    border-color: var(--rpo-primary);
    color: var(--rpo-primary);
}

.rpo-category-btn.active {
    background: var(--rpo-primary);
    border-color: var(--rpo-primary);
    color: white;
}

/* ==========================================================================
   Selected Counter
   ========================================================================== */

.rpo-selected-counter {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: var(--rpo-radius);
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
}

.rpo-selected-counter__count {
    font-weight: 700;
    color: var(--rpo-secondary);
}

/* ==========================================================================
   Category Sections
   ========================================================================== */

.rpo-category-section {
    margin-bottom: 2.5rem;
}

.rpo-category-section.rpo-category-hidden {
    display: none;
}

.rpo-category-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--rpo-text-heading);
    margin: 0 0 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--rpo-accent);
}

/* Exclusive Products Section Styling */
.rpo-category-title--exclusive {
    display: flex;
    align-items: center;
}

.rpo-category-title--exclusive svg {
    color: var(--rpo-accent);
    margin-right: 0.5rem;
}

.rpo-exclusive-badge {
    margin-left: auto;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--rpo-text-light);
    background: var(--rpo-bg-light);
    padding: 0.375rem 0.75rem;
    border-radius: 50px;
}

.rpo-category-btn--exclusive svg {
    vertical-align: middle;
}

/* ==========================================================================
   Product Table
   ========================================================================== */

.rpo-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.rpo-product-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: var(--rpo-radius);
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.rpo-product-table thead {
    background: var(--rpo-bg-light);
}

.rpo-product-table th {
    padding: 0.875rem 1rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--rpo-text-light);
    border-bottom: 1px solid #e5e7eb;
    white-space: nowrap;
}

.rpo-product-table th[data-sort] {
    cursor: pointer;
    user-select: none;
}

.rpo-product-table th[data-sort]:hover {
    color: var(--rpo-primary);
}

.rpo-product-table th[data-sort]::after {
    content: ' ↕';
    opacity: 0.3;
}

.rpo-product-table th[data-sort].sort-asc::after {
    content: ' ↑';
    opacity: 1;
}

.rpo-product-table th[data-sort].sort-desc::after {
    content: ' ↓';
    opacity: 1;
}

.rpo-product-table td {
    padding: 0.4rem 1rem;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
}

.rpo-product-table tbody tr:last-child td {
    border-bottom: none;
}

.rpo-product-table tbody tr:hover {
    background: #fafafa;
}

/* Column Widths */
.rpo-col-qty {
    width: 100px;
    text-align: center;
}

.rpo-col-image {
    width: 70px;
}

.rpo-col-name {
    min-width: 200px;
}

.rpo-col-stock {
    width: 110px;
}

.rpo-col-size {
    width: 100px;
    text-align: center;
}

.rpo-col-sku {
    width: 120px;
}

.rpo-col-assets {
    width: 60px;
    text-align: center;
}

/* ==========================================================================
   Product Row States
   ========================================================================== */

.rpo-product-row--selected {
    background: rgba(166, 155, 115, 0.08) !important;
}

.rpo-product-row--selected td {
    border-bottom-color: rgba(166, 155, 115, 0.25);
}

.rpo-product-row--disabled {
    opacity: 0.5;
}

.rpo-product-row--disabled td {
    background: #f9fafb;
}

.rpo-product-row--limit-reached {
    opacity: 0.4;
}

.rpo-product-row--limit-reached td {
    background: #fef3c7;
}

.rpo-product-row--limit-reached .rpo-qty-input {
    cursor: not-allowed;
}

/* ==========================================================================
   Quantity Input
   ========================================================================== */

.rpo-qty-input {
    width: 70px;
    padding: 0.625rem 0.5rem;
    border: 2px solid #d1d5db;
    border-radius: var(--rpo-radius);
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    transition: all var(--rpo-transition);
    -moz-appearance: textfield;
    appearance: textfield;
}

/* Hide spinner buttons for cleaner look */
.rpo-qty-input::-webkit-outer-spin-button,
.rpo-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.rpo-qty-input:focus {
    outline: none;
    border-color: var(--rpo-accent);
    box-shadow: 0 0 0 3px rgba(166, 155, 115, 0.2);
}

.rpo-qty-input:disabled {
    background: #f3f4f6;
    cursor: not-allowed;
}

.rpo-product-row--selected .rpo-qty-input {
    border: var(--rpo-accent) solid 3px;
    background: white;
}

/* ==========================================================================
   Product Image
   ========================================================================== */

.rpo-product-image-link {
    display: block;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.rpo-product-image-link:hover {
    opacity: 0.85;
    transform: scale(1.05);
}

.rpo-product-image {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 6px;
    background: #f3f4f6;
    display: block;
}

.rpo-product-image--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #d1d5db;
}

/* Product Name Link */
.rpo-product-name-link {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.rpo-product-name-link:hover {
    color: var(--rpo-primary);
    text-decoration: underline;
}

.rpo-product-name-link strong {
    font-weight: 600;
}

/* ==========================================================================
   Stock Status
   ========================================================================== */

.rpo-stock {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    font-size: 0.6875rem;
    font-weight: 600;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    white-space: nowrap;
}

.rpo-stock--instock {
    background: #d1fae5;
    color: #065f46;
}

.rpo-stock--backorder {
    background: #fef3c7;
    color: #92400e;
}

.rpo-stock--outofstock {
    background: #fee2e2;
    color: #991b1b;
}

/* ==========================================================================
   Notes Section
   ========================================================================== */

.rpo-notes-section {
    margin-top: 2rem;
    margin-bottom: 2rem;
}

.rpo-notes-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--rpo-text-heading);
    margin-bottom: 0.75rem;
}

.rpo-notes-label svg {
    color: var(--rpo-text-light);
}

.rpo-notes-textarea {
    width: 100%;
    padding: 1rem;
    border: 1px solid #d1d5db;
    border-radius: var(--rpo-radius);
    font-family: var(--rpo-font-body);
    font-size: 0.9375rem;
    line-height: 1.6;
    resize: vertical;
    min-height: 100px;
    transition: border-color var(--rpo-transition), box-shadow var(--rpo-transition);
}

.rpo-notes-textarea:focus {
    outline: none;
    border-color: var(--rpo-primary);
    box-shadow: 0 0 0 3px rgba(34, 136, 201, 0.15);
}

/* ==========================================================================
   Form Actions (Sticky Footer)
   ========================================================================== */

.rpo-form-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    border-top: 1px solid #e5e7eb;
    background: white;
    transition: all 0.3s ease;
}

/* Sticky state */
.rpo-form-actions--sticky {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    border-top: 1px solid #e5e7eb;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    animation: rpo-slide-up 0.3s ease;
}

@keyframes rpo-slide-up {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Placeholder to prevent content jump when sticky is active */
.rpo-form-actions-placeholder {
    height: 0;
    transition: height 0.3s ease;
}

.rpo-form-actions-placeholder--active {
    height: 85px; /* Approximate height of the sticky bar */
}

/* ==========================================================================
   Progress Steps
   ========================================================================== */

.rpo-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2.5rem;
    padding: 0 1rem;
}

.rpo-progress__step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.rpo-progress__number {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #e5e7eb;
    color: var(--rpo-text-light);
    font-weight: 600;
    font-size: 0.875rem;
}

.rpo-progress__label {
    font-size: 0.8125rem;
    color: var(--rpo-text-light);
    text-align: center;
}

.rpo-progress__step--active .rpo-progress__number {
    background: var(--rpo-primary);
    color: white;
}

.rpo-progress__step--active .rpo-progress__label {
    color: var(--rpo-text-heading);
    font-weight: 600;
}

.rpo-progress__step--completed .rpo-progress__number {
    background: #9ca3af;
    color: white;
}

.rpo-progress__step--completed .rpo-progress__label {
    color: #6b7280;
}

.rpo-progress__line {
    flex: 1;
    max-width: 100px;
    height: 2px;
    background: #e5e7eb;
    margin: 0 1rem;
    margin-bottom: 1.5rem;
}

.rpo-progress__line--completed {
    background: #9ca3af;
}

/* ==========================================================================
   Summary Grid
   ========================================================================== */

.rpo-summary-grid {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (max-width: 900px) {
    .rpo-summary-grid {
        grid-template-columns: 1fr;
    }
}

.rpo-summary-main {
    min-width: 0;
}

.rpo-summary-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* ==========================================================================
   Cards
   ========================================================================== */

.rpo-card {
    background: white;
    border-radius: var(--rpo-radius-lg);
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    margin-bottom: 20px;
}

.rpo-card h2 {
    margin: 0 0 1.25rem;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--rpo-text-heading);
}

.rpo-card h3 {
    margin: 0 0 1rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--rpo-text-heading);
}

.rpo-card--highlight {
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
    border-color: #bbf7d0;
}

/* ==========================================================================
   Summary Table
   ========================================================================== */

.rpo-summary-table {
    width: 100%;
    border-collapse: collapse;
}

.rpo-summary-table thead {
    background: var(--rpo-bg-light);
}

.rpo-summary-table th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--rpo-text-light);
    border-bottom: 1px solid #e5e7eb;
}

.rpo-summary-table td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
}

.rpo-summary-table tfoot td {
    border-top: 2px solid #e5e7eb;
    border-bottom: none;
    font-weight: 600;
}

.rpo-summary-total-label {
    text-align: right !important;
}

.rpo-summary-notes {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e5e7eb;
}

.rpo-summary-notes h3 {
    margin: 0 0 0.5rem;
}

.rpo-summary-notes p {
    margin: 0;
    color: var(--rpo-text);
    line-height: 1.6;
}

/* ==========================================================================
   Shipping Details
   ========================================================================== */

.rpo-shipping-details p {
    margin: 0 0 0.5rem;
    font-size: 0.9375rem;
    line-height: 1.5;
}

.rpo-shipping-details p:last-child {
    margin-bottom: 0;
}

/* ==========================================================================
   Order Totals
   ========================================================================== */

.rpo-order-totals {
    margin-bottom: 1rem;
}

.rpo-order-total-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.rpo-order-total-row:last-child {
    border-bottom: none;
}

.rpo-pricing-note {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--rpo-secondary-dark);
    font-style: italic;
}

/* ==========================================================================
   Summary Actions
   ========================================================================== */

.rpo-summary-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e5e7eb;
}

.rpo-place-order-form {
    display: inline;
}

/* ==========================================================================
   Confirmation
   ========================================================================== */

.rpo-confirmation-header {
    text-align: center;
    padding: 2rem 0 2.5rem;
}

.rpo-confirmation-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #dbeafe;
    border-radius: 50%;
    color: var(--rpo-primary);
}

.rpo-confirmation-header h1 {
    margin: 0 0 0.75rem;
    font-size: 1.75rem;
    color: var(--rpo-text-heading);
}

.rpo-confirmation-subtitle {
    margin: 0;
    font-size: 1.0625rem;
    color: var(--rpo-text);
}

.rpo-confirmation-email-notice {
    margin: 1rem 0 0;
    font-size: 0.9375rem;
    color: var(--rpo-text-light);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.rpo-confirmation-email-notice::before {
    content: '✉';
    font-size: 1.125rem;
}

.rpo-next-steps {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.rpo-next-step {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.rpo-next-step__icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--rpo-primary);
    color: white;
    border-radius: 50%;
    font-weight: 600;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.rpo-next-step__content strong {
    display: block;
    margin-bottom: 0.25rem;
    color: var(--rpo-text-heading);
}

.rpo-next-step__content p {
    margin: 0;
    font-size: 0.875rem;
    color: var(--rpo-text-light);
    line-height: 1.5;
}

.rpo-confirmation-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
}

/* ==========================================================================
   Order History
   ========================================================================== */

.rpo-empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--rpo-bg-light);
    border-radius: var(--rpo-radius-lg);
}

.rpo-empty-state svg {
    color: #d1d5db;
    margin-bottom: 1rem;
}

.rpo-empty-state h2 {
    margin: 0 0 0.5rem;
    font-size: 1.25rem;
    color: var(--rpo-text-heading);
}

.rpo-empty-state p {
    margin: 0 0 1.5rem;
    color: var(--rpo-text-light);
}

.rpo-orders-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.rpo-order-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: var(--rpo-radius-lg);
    overflow: hidden;
    transition: box-shadow var(--rpo-transition);
}

.rpo-order-card:hover {
    box-shadow: var(--rpo-shadow);
}

.rpo-order-card__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    background: var(--rpo-bg-light);
    border-bottom: 1px solid #e5e7eb;
}

.rpo-order-card__label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--rpo-text-light);
    margin-bottom: 0.125rem;
}

.rpo-order-card__number strong {
    font-size: 1rem;
    color: var(--rpo-text-heading);
}

.rpo-order-card__body {
    padding: 1rem 1.25rem;
}

.rpo-order-card__meta {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.rpo-order-card__date,
.rpo-order-card__items {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.875rem;
    color: var(--rpo-text-light);
}

.rpo-order-card__date svg,
.rpo-order-card__items svg {
    width: 16px;
    height: 16px;
}

.rpo-order-card__footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-top: 1px solid #f3f4f6;
    gap: 1rem;
}

.rpo-order-card__actions {
    display: flex;
    gap: 0.75rem;
}

.rpo-order-card__actions-right {
    display: flex;
    gap: 0.75rem;
    margin-left: auto;
}

/* ==========================================================================
   Status Badge
   ========================================================================== */

.rpo-status {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.rpo-status--large {
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
}

/* WordPress statuses */
.rpo-status--placed {
    background: #d1fae5;
    color: #065f46;
}

.rpo-status--failed_sync {
    background: #fee2e2;
    color: #991b1b;
}

/* Legacy MJ statuses */
.rpo-status--pending {
    background: #fef3c7;
    color: #92400e;
}

.rpo-status--confirmed {
    background: #dbeafe;
    color: #1e40af;
}

.rpo-status--shipped {
    background: #e0e7ff;
    color: #3730a3;
}

.rpo-status--completed {
    background: #d1fae5;
    color: #065f46;
}

.rpo-status--cancelled {
    background: #fee2e2;
    color: #991b1b;
}

.rpo-status--manual-processing,
.rpo-status--manual_processing {
    background: #fef3c7;
    color: #92400e;
}

/* ==========================================================================
   Order Status Bar
   ========================================================================== */

.rpo-order-status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: var(--rpo-radius-lg);
    margin-bottom: 1.5rem;
}

.rpo-order-status-bar__info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.rpo-order-date {
    font-size: 0.875rem;
    color: var(--rpo-text-light);
}

.rpo-status-note {
    margin: 0;
    font-size: 0.875rem;
    color: var(--rpo-text-light);
    font-style: italic;
}

/* ==========================================================================
   Order Notes
   ========================================================================== */

.rpo-order-notes {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e5e7eb;
}

.rpo-order-notes h3 {
    margin: 0 0 0.5rem;
    font-size: 0.9375rem;
}

.rpo-order-notes p {
    margin: 0;
    line-height: 1.6;
}

/* ==========================================================================
   Pagination
   ========================================================================== */

.rpo-pagination {
    display: flex;
    justify-content: center;
    gap: 0.25rem;
    margin-top: 2rem;
}

.rpo-pagination a,
.rpo-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: var(--rpo-radius);
    font-size: 0.875rem;
    color: var(--rpo-text);
    text-decoration: none;
    transition: all var(--rpo-transition);
}

.rpo-pagination a:hover {
    background: var(--rpo-bg-light);
    border-color: var(--rpo-primary);
    color: var(--rpo-primary);
}

.rpo-pagination .current {
    background: var(--rpo-primary);
    border-color: var(--rpo-primary);
    color: white;
}

/* ==========================================================================
   Message Box (Login Required / Access Denied)
   ========================================================================== */

.rpo-message {
    display: flex;
    gap: 1.5rem;
    padding: 2rem;
    border-radius: var(--rpo-radius-lg);
    max-width: 500px;
    margin: 3rem auto;
}

.rpo-message--info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
}

.rpo-message--error {
    background: #fef2f2;
    border: 1px solid #fecaca;
}

.rpo-message__icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.8);
}

.rpo-message--info .rpo-message__icon {
    color: var(--rpo-info);
}

.rpo-message--error .rpo-message__icon {
    color: var(--rpo-error);
}

.rpo-message__content h3 {
    margin: 0 0 0.5rem;
    font-size: 1.125rem;
    color: var(--rpo-text-heading);
}

.rpo-message__content p {
    margin: 0 0 1.25rem;
    font-size: 0.9375rem;
    line-height: 1.6;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 768px) {
    .rpo-order-form,
    .rpo-order-summary,
    .rpo-confirmation,
    .rpo-order-history,
    .rpo-order-detail-public {
        padding: 1.5rem 1rem;
    }
    
    .rpo-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .rpo-header__actions {
        justify-content: flex-start;
    }
    
    .rpo-notices {
        grid-template-columns: 1fr;
    }
    
    .rpo-category-nav {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        padding: 0.75rem;
        gap: 0.375rem;
    }
    
    .rpo-category-btn {
        flex-shrink: 0;
        font-size: 0.8125rem;
    }
    
    .rpo-progress {
        padding: 0;
    }
    
    .rpo-progress__label {
        display: none;
    }
    
    .rpo-progress__line {
        margin-bottom: 0;
        max-width: 50px;
    }
    
    .rpo-summary-actions,
    .rpo-confirmation-actions {
        flex-direction: column;
    }
    
    .rpo-btn--large {
        width: 100%;
    }
    
    .rpo-order-card__footer {
        flex-direction: column;
        align-items: stretch;
    }
    
    .rpo-order-card__actions,
    .rpo-order-card__actions-right {
        flex-direction: column;
    }
    
    .rpo-order-card__actions .rpo-btn,
    .rpo-order-card__actions-right .rpo-btn {
        width: 100%;
    }
    
    /* Make quantity input wider on mobile */
    .rpo-qty-input {
        width: 80px;
        min-width: 80px;
    }
    
    .rpo-col-qty {
        width: 90px;
        min-width: 90px;
    }
    
    /* Sticky actions on mobile */
    .rpo-form-actions {
        flex-direction: column;
        padding: 1rem;
    }
    
    .rpo-form-actions .rpo-btn {
        width: 100%;
    }
    
    .rpo-form-actions-placeholder--active {
        height: 120px; /* Taller on mobile due to stacked buttons */
    }
}

@media (max-width: 480px) {
    .rpo-col-category,
    .rpo-col-size,
    .rpo-col-sku,
    .rpo-col-assets {
        display: none;
    }
    
    .rpo-product-table th,
    .rpo-product-table td,
    .rpo-summary-table th,
    .rpo-summary-table td {
        padding: 0.625rem 0.5rem;
    }
    
    .rpo-qty-input {
        width: 50px;
        padding: 0.375rem;
    }
    
    .rpo-product-image {
        width: 40px;
        height: 40px;
    }
}

/* ==========================================================================
   Loading Overlay & Spinner
   ========================================================================== */

.rpo-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.rpo-loading-overlay--visible {
    opacity: 1;
}

.rpo-loading-content {
    background: white;
    padding: 2.5rem 3rem;
    border-radius: var(--rpo-radius-lg);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    text-align: center;
    min-width: 300px;
    max-width: 90%;
}

.rpo-overlay-spinner {
    width: 60px;
    height: 60px;
    margin: 0 auto 1.5rem;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--rpo-accent);
    border-radius: 50%;
    animation: rpo-spin 1s linear infinite;
}

@keyframes rpo-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.rpo-overlay-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    line-height: 1;
}

.rpo-overlay-icon--success {
    color: var(--rpo-success);
}

.rpo-loading-message {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 500;
    color: var(--rpo-text);
}

/* Inline spinner for buttons */
.rpo-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: rpo-spin 0.8s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}

/* ============================================================================
   Automation Progress Modal
   ========================================================================= */

.rpo-automation-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease, background 0.3s ease;
    pointer-events: none;
}

.rpo-automation-modal--visible {
    opacity: 1;
    background: rgba(0, 0, 0, 0.7);
    pointer-events: auto;
}

.rpo-automation-content {
    background: white;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.rpo-automation-modal--visible .rpo-automation-content {
    transform: scale(1);
}

.rpo-automation-header {
    padding: 2rem 2rem 1rem;
    text-align: center;
    border-bottom: 1px solid #e5e7eb;
}

.rpo-automation-header h3 {
    margin: 0 0 0.5rem;
    font-size: 1.5rem;
    color: var(--rpo-primary);
}

.rpo-automation-header p {
    margin: 0;
    color: #6b7280;
    font-size: 0.875rem;
}

.rpo-automation-body {
    padding: 2rem;
}

.rpo-progress-bar {
    height: 24px;
    background: #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.rpo-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--rpo-accent), var(--rpo-primary));
    border-radius: 12px;
    transition: width 0.5s ease;
    position: relative;
    overflow: hidden;
}

.rpo-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, 
        transparent 0%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 100%
    );
    animation: rpo-shimmer 2s infinite;
}

@keyframes rpo-shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.rpo-progress-text {
    margin: 0 0 0.5rem;
    font-size: 1rem;
    font-weight: 500;
    color: var(--rpo-text);
    text-align: center;
}

.rpo-progress-detail {
    margin: 0;
    font-size: 0.875rem;
    color: #6b7280;
    text-align: center;
}

.rpo-automation-footer {
    padding: 1rem 2rem 2rem;
    text-align: center;
}

.rpo-automation-note {
    margin: 0;
    font-size: 0.8125rem;
    color: #9ca3af;
    font-style: italic;
}

.rpo-automation-footer .rpo-btn {
    margin-top: 1rem;
}

/* ==========================================================================
   Breadcrumb Navigation
   ========================================================================== */

.rpo-breadcrumb {
    margin-bottom: 1.5rem;
    padding: 0.75rem 0;
    font-size: 0.875rem;
    color: var(--rpo-text-light);
    line-height: 1.5;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.rpo-breadcrumb .breadcrumb-icon {
    width: 16px;
    height: 16px;
    margin-right: 0.5rem;
    color: var(--rpo-text-light);
    flex-shrink: 0;
    opacity: 0.7;
}

.rpo-breadcrumb a {
    color: var(--rpo-text-light);
    text-decoration: none;
    transition: color var(--rpo-transition);
}

.rpo-breadcrumb a:hover {
    color: var(--rpo-accent);
    text-decoration: none;
}

.rpo-breadcrumb .breadcrumb-separator {
    margin: 0 0.5rem;
    color: var(--rpo-text-light);
    opacity: 0.6;
}

.rpo-breadcrumb .breadcrumb-current {
    color: var(--rpo-text);
    font-weight: 500;
}

/* Match WooCommerce breadcrumb styling if present on site */
.woocommerce-breadcrumb {
    margin-bottom: 1.5rem;
}

/* Responsive */
@media (max-width: 768px) {
    .rpo-breadcrumb {
        font-size: 0.8125rem;
        margin-bottom: 1rem;
    }
    
    .rpo-breadcrumb .breadcrumb-icon {
        width: 14px;
        height: 14px;
        margin-right: 0.35rem;
    }
    
    .rpo-breadcrumb .breadcrumb-separator {
        margin: 0 0.35rem;
    }
}

/* ================================
   Discount Summary Widget
   ================================ */

.rpo-discount-summary {
    background: #F3F3EE;
    border: 2px solid #D4D4C8;
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1.5rem 0 1rem 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.rpo-discount-summary__header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-size: 1rem;
    font-weight: 600;
    color: #4A4A3A;
}

.rpo-discount-summary__header svg {
    color: #A69B73;
}

.rpo-discount-summary__body {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.rpo-discount-summary__row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9375rem;
}

.rpo-discount-summary__label {
    color: #4A4A3A;
    font-weight: 500;
}

.rpo-discount-summary__subtotal-amount,
.rpo-discount-summary__total-amount {
    color: #4A4A3A;
    font-weight: 600;
}

.rpo-discount-summary__discount-row {
    color: #A69B73;
    border-top: 1px solid #D4D4C8;
    border-bottom: 1px solid #D4D4C8;
    padding: 0.75rem 0;
}

.rpo-discount-summary__discount-label {
    color: #A69B73;
}

.rpo-discount-summary__discount-amount {
    color: #A69B73;
    font-weight: 700;
    font-size: 1rem;
}

.rpo-discount-summary__total-row {
    font-size: 1.125rem;
    padding-top: 0.5rem;
    border-top: 2px solid #D4D4C8;
}

.rpo-discount-summary__progress {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px dashed #D4D4C8;
    text-align: center;
}

.rpo-discount-progress-bar {
    width: 100%;
    height: 8px;
    background: #E8E8DE;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.rpo-discount-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #A69B73 0%, #BFB491 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.rpo-discount-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.rpo-discount-badge--success {
    background: #A69B73;
    color: white;
}

.rpo-discount-next {
    display: block;
    font-size: 0.875rem;
    color: #4A4A3A;
    font-weight: 500;
}

.rpo-discount-max {
    display: block;
    font-size: 0.875rem;
    color: #4A4A3A;
    font-weight: 500;
    font-style: italic;
}

/* Discount Notification (next to submit button) */
.rpo-discount-notification {
    margin-left: 1rem;
    padding: 0.75rem 1rem;
    background: #f0fdf4;
    border: 1px solid #86efac;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    white-space: nowrap;
}

.rpo-discount-notification__active {
    color: #166534;
    font-weight: 600;
}

.rpo-discount-notification__next {
    color: #15803d;
    font-weight: 500;
}

.rpo-form-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* Original Price Strikethrough */
.rpo-original-price {
    text-decoration: line-through;
    color: #9ca3af;
    font-size: 0.875rem;
    display: block;
    margin-bottom: 0.125rem;
}

.rpo-discounted-price {
    color: #16a34a;
    font-weight: 600;
    display: block;
}

/* Responsive adjustments for discount summary */
@media (max-width: 768px) {
    .rpo-discount-summary {
        padding: 1rem;
        margin: 1rem 0;
    }
    
    .rpo-discount-summary__header {
        font-size: 0.9375rem;
    }
    
    .rpo-discount-summary__row {
        font-size: 0.875rem;
    }
    
    .rpo-discount-summary__total-row {
        font-size: 1rem;
    }
    
    .rpo-discount-badge {
        font-size: 0.8125rem;
        padding: 0.2rem 0.6rem;
    }
    
    .rpo-discount-next,
    .rpo-discount-max {
        font-size: 0.8125rem;
    }
    
    .rpo-discount-notification {
        margin-left: 0;
        margin-top: 0.75rem;
        width: 100%;
        text-align: center;
    }
    
    .rpo-form-actions {
        flex-direction: column;
    }
}

