/* ============================================
   CART & CHECKOUT STYLES
   ============================================ */

/* Cart Section */
.cart-section,
.checkout-section {
    padding: var(--space-4xl) var(--space-xl);
    min-height: 60vh;
}

.cart-container,
.checkout-container {
    max-width: 1200px;
    margin: 0 auto;
}

.cart-header,
.checkout-header {
    margin-bottom: var(--space-2xl);
}

.cart-title {
    font-family: var(--font-display);
    font-size: var(--text-4xl);
    font-weight: 600;
    color: var(--color-text-primary);
    margin-top: var(--space-md);
}

/* Empty Cart State */
.cart-empty,
.checkout-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--space-4xl);
    background: var(--color-surface);
    border-radius: 16px;
    border: 1px solid var(--color-border);
}

.cart-empty-icon {
    color: var(--color-text-tertiary);
    margin-bottom: var(--space-xl);
}

.cart-empty h2,
.checkout-empty h2 {
    font-family: var(--font-display);
    font-size: var(--text-2xl);
    margin-bottom: var(--space-sm);
}

.cart-empty p,
.checkout-empty p {
    color: var(--color-text-secondary);
    margin-bottom: var(--space-xl);
    max-width: 400px;
}

/* Cart Content Layout */
.cart-content {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: var(--space-2xl);
    align-items: start;
}

/* Cart Items */
.cart-items {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-xl);
    background: var(--color-surface);
    border-radius: 12px;
    border: 1px solid var(--color-border);
    transition: all 0.3s ease;
}

.cart-item:hover {
    border-color: var(--color-brand-blue);
    box-shadow: 0 4px 20px rgba(0, 13, 175, 0.1);
}

.cart-item-info {
    flex: 1;
}

.cart-item-category {
    display: inline-block;
    font-size: var(--text-xs);
    color: var(--color-brand-blue);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--space-xs);
}

.cart-item-title {
    font-family: var(--font-display);
    font-size: var(--text-lg);
    font-weight: 500;
    margin-bottom: var(--space-xs);
}

.cart-item-desc {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    margin-bottom: var(--space-sm);
}

.cart-item-badge {
    display: inline-block;
    font-size: var(--text-xs);
    color: white;
    background: var(--color-brand-blue);
    padding: 2px 8px;
    border-radius: 4px;
}

.cart-item-actions {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}

/* Quantity Control */
.quantity-control {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    background: var(--color-bg);
    border-radius: 8px;
    padding: 4px;
}

.qty-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: var(--color-surface);
    border-radius: 6px;
    cursor: pointer;
    font-size: var(--text-lg);
    color: var(--color-text-secondary);
    transition: all 0.2s ease;
}

.qty-btn:hover {
    background: var(--color-brand-blue);
    color: white;
}

.qty-value {
    min-width: 24px;
    text-align: center;
    font-weight: 500;
}

.cart-item-price {
    font-family: var(--font-display);
    font-size: var(--text-xl);
    font-weight: 600;
    color: var(--color-text-primary);
    min-width: 80px;
    text-align: right;
}

.remove-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--color-text-tertiary);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.remove-btn:hover {
    background: rgba(178, 0, 0, 0.1);
    color: var(--color-brand-red);
}

/* Cart Sidebar */
.cart-sidebar {
    position: sticky;
    top: 100px;
}

.cart-summary,
.order-summary-card {
    background: var(--color-surface);
    border-radius: 16px;
    border: 1px solid var(--color-border);
    padding: var(--space-xl);
}

.cart-summary h3,
.order-summary-card h3 {
    font-family: var(--font-display);
    font-size: var(--text-lg);
    font-weight: 600;
    margin-bottom: var(--space-lg);
}

.summary-rows {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
}

.summary-divider {
    height: 1px;
    background: var(--color-border);
    margin: var(--space-lg) 0;
}

.summary-total {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-display);
    font-size: var(--text-xl);
    font-weight: 600;
}

.recurring-note {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: var(--text-sm);
    color: var(--color-brand-blue);
    margin-top: var(--space-md);
    padding: var(--space-sm) var(--space-md);
    background: rgba(0, 13, 175, 0.05);
    border-radius: 8px;
}

.btn-checkout {
    width: 100%;
    margin-top: var(--space-xl);
    justify-content: center;
}

.cart-guarantees {
    margin-top: var(--space-xl);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.guarantee-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
}

.guarantee-item svg {
    color: var(--color-brand-green);
    flex-shrink: 0;
}

/* ============================================
   CHECKOUT STYLES
   ============================================ */

.checkout-content {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: var(--space-2xl);
    align-items: start;
}

/* Checkout Steps */
.checkout-steps {
    display: flex;
    align-items: center;
    margin-bottom: var(--space-2xl);
    padding: var(--space-lg) var(--space-xl);
    background: var(--color-surface);
    border-radius: 12px;
    border: 1px solid var(--color-border);
}

.step {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.step-number {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-bg);
    border: 2px solid var(--color-border);
    border-radius: 50%;
    font-weight: 600;
    font-size: var(--text-sm);
    color: var(--color-text-tertiary);
    transition: all 0.3s ease;
}

.step-label {
    font-size: var(--text-sm);
    color: var(--color-text-tertiary);
    transition: all 0.3s ease;
}

.step.active .step-number {
    background: var(--color-brand-blue);
    border-color: var(--color-brand-blue);
    color: white;
}

.step.active .step-label {
    color: var(--color-brand-blue);
    font-weight: 500;
}

.step.completed .step-number {
    background: var(--color-brand-green);
    border-color: var(--color-brand-green);
    color: white;
}

.step.completed .step-label {
    color: var(--color-brand-green);
}

.step-line {
    flex: 1;
    height: 2px;
    background: var(--color-border);
    margin: 0 var(--space-md);
}

/* Checkout Form Section */
.checkout-form-section {
    background: var(--color-surface);
    border-radius: 16px;
    border: 1px solid var(--color-border);
    padding: var(--space-2xl);
}

.checkout-step-content h2 {
    font-family: var(--font-display);
    font-size: var(--text-2xl);
    font-weight: 600;
    margin-bottom: var(--space-xs);
}

.step-subtitle {
    color: var(--color-text-secondary);
    margin-bottom: var(--space-xl);
}

/* Checkout Form */
.checkout-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-lg);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.form-group label {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--color-text-secondary);
}

.form-group input,
.form-group textarea,
.form-group select {
    padding: var(--space-md);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: var(--text-base);
    background: var(--color-bg);
    transition: all 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--color-brand-blue);
    box-shadow: 0 0 0 3px rgba(0, 13, 175, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-group select {
    cursor: pointer;
}

/* Delivery Speed Options */
.delivery-options {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.delivery-option {
    display: flex;
    align-items: center;
    padding: var(--space-md) var(--space-lg);
    background: var(--color-bg);
    border: 2px solid var(--color-border);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.delivery-option:hover {
    border-color: var(--color-brand-blue);
}

.delivery-option.selected {
    border-color: var(--color-brand-blue);
    background: rgba(0, 13, 175, 0.03);
}

.delivery-option input[type="radio"] {
    display: none;
}

.delivery-option-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.delivery-option-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.delivery-name {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-weight: 600;
    color: var(--color-text-primary);
}

.delivery-name svg {
    color: var(--color-text-tertiary);
}

.delivery-option.selected .delivery-name svg {
    color: var(--color-brand-blue);
}

.delivery-desc {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
}

.delivery-price {
    font-weight: 600;
    font-size: var(--text-sm);
    padding: 4px 10px;
    border-radius: 6px;
}

.delivery-price.rush {
    background: rgba(234, 179, 8, 0.1);
    color: #ca8a04;
}

.delivery-price.standard {
    background: rgba(107, 114, 128, 0.1);
    color: var(--color-text-secondary);
}

.delivery-price.discount {
    background: rgba(34, 197, 94, 0.1);
    color: #16a34a;
}

/* Price adjustment colors in summary */
.rush-price {
    color: #ca8a04;
}

.discount-price {
    color: #16a34a;
}

/* Review badges */
.rush-badge {
    display: inline-block;
    background: rgba(234, 179, 8, 0.1);
    color: #ca8a04;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: var(--text-xs);
    font-weight: 600;
}

.discount-badge {
    display: inline-block;
    background: rgba(34, 197, 94, 0.1);
    color: #16a34a;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: var(--text-xs);
    font-weight: 600;
}

.form-buttons {
    display: flex;
    gap: var(--space-md);
    margin-top: var(--space-lg);
}

.btn-back {
    flex-shrink: 0;
}

.btn-next,
.btn-submit {
    flex: 1;
    justify-content: center;
}

/* Order Review */
.order-review {
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
}

.review-section {
    position: relative;
    padding: var(--space-lg);
    background: var(--color-bg);
    border-radius: 12px;
}

.review-section h3 {
    font-family: var(--font-display);
    font-size: var(--text-base);
    font-weight: 600;
    margin-bottom: var(--space-md);
    color: var(--color-text-primary);
}

.review-details p,
.review-requirements p {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    margin-bottom: var(--space-xs);
}

.review-details strong,
.review-requirements strong {
    color: var(--color-text-primary);
}

.review-services ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.review-services li {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    padding: var(--space-xs) 0;
    border-bottom: 1px solid var(--color-border);
}

.review-services li:last-child {
    border-bottom: none;
}

.edit-link {
    position: absolute;
    top: var(--space-lg);
    right: var(--space-lg);
    background: none;
    border: none;
    color: var(--color-brand-blue);
    font-size: var(--text-sm);
    cursor: pointer;
    text-decoration: underline;
}

.edit-link:hover {
    color: var(--color-brand-blue-dark);
}

/* Payment Notice */
.payment-notice {
    display: flex;
    gap: var(--space-md);
    padding: var(--space-lg);
    background: rgba(0, 13, 175, 0.05);
    border: 1px solid rgba(0, 13, 175, 0.1);
    border-radius: 12px;
    margin-top: var(--space-lg);
}

.payment-notice svg {
    flex-shrink: 0;
    color: var(--color-brand-blue);
}

.payment-notice strong {
    display: block;
    margin-bottom: var(--space-xs);
    color: var(--color-text-primary);
}

.payment-notice p {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    margin: 0;
}

/* Checkout Sidebar */
.checkout-sidebar {
    position: sticky;
    top: 100px;
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

/* Summary Items */
.summary-items {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--space-md);
}

.summary-item-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.summary-item-title {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--color-text-primary);
}

.summary-item-qty {
    font-size: var(--text-xs);
    color: var(--color-text-tertiary);
}

.summary-item-price {
    font-weight: 600;
    color: var(--color-text-primary);
    white-space: nowrap;
}

/* ============================================
   CHAT WIDGET STYLES (Fiverr-like)
   ============================================ */

.chat-widget {
    display: flex;
    flex-direction: column;
    background: var(--color-surface);
    border-radius: 16px;
    border: 1px solid var(--color-border);
    overflow: hidden;
    height: 450px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.chat-header {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    background: var(--color-brand-blue);
    color: white;
}

.chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.chat-avatar img {
    width: 28px;
    height: auto;
}

.chat-header-info h4 {
    font-size: var(--text-sm);
    font-weight: 600;
    margin: 0;
}

.chat-status {
    font-size: var(--text-xs);
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 4px;
}

.chat-status.online::before {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--color-brand-green);
    border-radius: 50%;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-lg);
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    background: var(--color-bg);
}

.chat-message {
    max-width: 85%;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.chat-message.support {
    align-self: flex-start;
}

.chat-message.user {
    align-self: flex-end;
}

.message-content {
    padding: var(--space-sm) var(--space-md);
    border-radius: 12px;
    font-size: var(--text-sm);
    line-height: 1.5;
}

.chat-message.support .message-content {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-bottom-left-radius: 4px;
}

.chat-message.user .message-content {
    background: var(--color-brand-blue);
    color: white;
    border-bottom-right-radius: 4px;
}

.message-time {
    font-size: var(--text-xs);
    color: var(--color-text-tertiary);
    padding: 0 var(--space-xs);
}

.chat-message.user .message-time {
    text-align: right;
}

.chat-input-area {
    display: flex;
    gap: var(--space-sm);
    padding: var(--space-md);
    border-top: 1px solid var(--color-border);
    background: var(--color-surface);
}

.chat-input-area textarea {
    flex: 1;
    padding: var(--space-sm) var(--space-md);
    border: 1px solid var(--color-border);
    border-radius: 20px;
    font-family: var(--font-body);
    font-size: var(--text-sm);
    resize: none;
    max-height: 100px;
    line-height: 1.4;
}

.chat-input-area textarea:focus {
    outline: none;
    border-color: var(--color-brand-blue);
}

.chat-send {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-brand-blue);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.chat-send:hover {
    background: var(--color-brand-blue-dark);
    transform: scale(1.05);
}

/* ============================================
   SUCCESS MODAL
   ============================================ */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: var(--space-xl);
}

.modal-content {
    background: var(--color-surface);
    border-radius: 20px;
    padding: var(--space-3xl);
    max-width: 480px;
    width: 100%;
    text-align: center;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.success-modal .success-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto var(--space-xl);
    background: rgba(25, 164, 99, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-brand-green);
}

.success-modal h2 {
    font-family: var(--font-display);
    font-size: var(--text-2xl);
    margin-bottom: var(--space-md);
}

.success-modal p {
    color: var(--color-text-secondary);
    margin-bottom: var(--space-xl);
}

.order-number {
    font-family: var(--font-mono);
    font-size: var(--text-lg);
    color: var(--color-brand-blue);
    background: rgba(0, 13, 175, 0.05);
    padding: var(--space-md) var(--space-xl);
    border-radius: 8px;
    margin-bottom: var(--space-xl);
}

.success-modal .btn-primary {
    width: 100%;
    justify-content: center;
}

/* ============================================
   RESPONSIVE STYLES
   ============================================ */

@media (max-width: 1024px) {
    .cart-content,
    .checkout-content {
        grid-template-columns: 1fr;
    }

    .cart-sidebar,
    .checkout-sidebar {
        position: static;
        order: -1;
    }

    .checkout-steps {
        overflow-x: auto;
    }
}

/* Cart Chat Section */
.cart-chat-section {
    margin-top: var(--space-3xl);
    padding: var(--space-2xl);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    text-align: center;
}

.chat-section-title {
    font-family: var(--font-display);
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: var(--space-lg);
}

/* Checkout Chat Card */
.checkout-chat-card {
    margin-top: var(--space-lg);
    padding: var(--space-lg);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 16px;
}

.checkout-chat-card h3 {
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: var(--space-md);
}

.checkout-chat-card .chatwoot-iframe-container {
    height: 400px;
}

.checkout-chat-card .chatwoot-iframe-container iframe {
    height: 400px;
}

@media (max-width: 768px) {
    .cart-section,
    .checkout-section {
        padding: var(--space-2xl) var(--space-md);
    }

    .cart-chat-section {
        margin-top: var(--space-2xl);
        padding: var(--space-lg);
    }

    .cart-item {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-lg);
    }

    .cart-item-actions {
        width: 100%;
        justify-content: space-between;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .checkout-form-section {
        padding: var(--space-lg);
    }

    .form-buttons {
        flex-direction: column;
    }

    .btn-back {
        order: 1;
    }

    .chat-widget {
        height: 400px;
    }
}

@media (max-width: 480px) {
    .checkout-steps {
        gap: var(--space-xs);
        padding: var(--space-md);
    }

    .step-label {
        display: none;
    }

    .step-line {
        margin: 0 var(--space-sm);
    }
}

/* ============================================
   ORDER DETAIL PAGE MOBILE OPTIMIZATION
   ============================================ */

@media (max-width: 768px) {
    /* Order detail container adjustments */
    .order-detail-container {
        padding: var(--space-md);
        gap: var(--space-md);
    }

    /* Order detail layout - stack vertically on mobile */
    .order-chat-panel {
        order: 1;
        width: 100%;
    }

    .order-details-sidebar {
        order: 0;
        width: 100%;
        position: static !important;
    }

    /* Chat panel adjustments */
    .chat-panel-card {
        height: auto;
        min-height: 600px;
        border-radius: 12px;
    }

    .chat-panel-header {
        padding: var(--space-md);
    }

    .chat-panel-avatar {
        width: 36px;
        height: 36px;
    }

    .chat-panel-avatar img {
        width: 24px;
        height: auto;
    }

    .chat-panel-info h3 {
        font-size: var(--text-base);
    }

    .chat-status {
        font-size: var(--text-xs);
    }

    /* Chat messages - ensure proper scrolling and spacing */
    .chat-panel-body {
        min-height: 400px;
    }

    .chat-messages {
        padding: var(--space-md);
        gap: var(--space-md);
    }

    .chat-message {
        max-width: 90%;
    }

    .chat-message-avatar {
        width: 28px;
        height: 28px;
        font-size: var(--text-xs);
    }

    .chat-message-content p {
        padding: var(--space-sm);
        font-size: var(--text-sm);
        line-height: 1.4;
    }

    .chat-message-time {
        font-size: 10px;
    }

    /* Chat input form - make touch-friendly */
    .chat-input-form {
        padding: var(--space-md);
    }

    .chat-input-wrapper {
        gap: var(--space-sm);
    }

    .chat-input-wrapper textarea {
        font-size: 16px; /* Prevent auto-zoom on iOS */
        padding: var(--space-sm) var(--space-md);
        min-height: 44px;
    }

    .chat-attach-btn {
        width: 44px;
        height: 44px;
        min-width: 44px;
    }

    .chat-send-btn {
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
    }

    .chat-send-btn svg {
        width: 20px;
        height: 20px;
    }

    .chat-attach-btn svg {
        width: 20px;
        height: 20px;
    }

    /* Attachments preview */
    .chat-attachments-preview {
        padding: var(--space-sm);
        gap: var(--space-xs);
    }

    .attachment-preview-item {
        padding: var(--space-xs) var(--space-sm);
        font-size: var(--text-xs);
    }

    .attachment-preview-name {
        max-width: 120px;
    }

    .attachment-preview-remove {
        min-width: 24px;
        min-height: 24px;
        padding: 0 4px;
        font-size: 18px;
    }

    /* Order detail header */
    .order-detail-header {
        padding: var(--space-lg);
    }

    .order-header-top {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-sm);
    }

    .order-header-top h1 {
        font-size: var(--text-xl);
        line-height: 1.2;
    }

    .order-status {
        align-self: flex-start;
    }

    .order-meta {
        flex-direction: column;
        gap: var(--space-sm);
    }

    .order-meta span {
        font-size: var(--text-sm);
    }

    /* Order services list */
    .order-services-list {
        padding: var(--space-lg);
    }

    .order-services-list h3 {
        font-size: var(--text-base);
    }

    .service-line-item {
        padding: var(--space-sm) 0;
        font-size: var(--text-sm);
    }

    .service-line-name {
        font-size: var(--text-sm);
    }

    .service-line-price {
        font-size: var(--text-base);
    }

    .order-total-line {
        font-size: var(--text-base);
        padding-top: var(--space-md);
        margin-top: var(--space-md);
    }

    /* Project info */
    .order-project-info {
        padding: var(--space-lg);
    }

    .order-project-info h3 {
        font-size: var(--text-base);
    }

    .project-field {
        padding: var(--space-sm) 0;
    }

    .project-field label {
        font-size: var(--text-xs);
    }

    .project-field p {
        font-size: var(--text-sm);
    }

    /* Milestones */
    .order-milestones {
        padding: var(--space-lg);
    }

    .order-milestones h3 {
        font-size: var(--text-base);
    }

    .milestones-list {
        gap: var(--space-sm);
    }

    .milestone-item {
        padding: var(--space-sm) 0;
        font-size: var(--text-sm);
    }

    /* Deliverables */
    .order-deliverables {
        padding: var(--space-lg);
    }

    .order-deliverables h3 {
        font-size: var(--text-base);
    }

    .deliverable-item {
        padding: var(--space-sm) var(--space-md);
        font-size: var(--text-sm);
    }

    /* Back to orders link */
    .order-back-link {
        display: inline-flex;
        align-items: center;
        gap: var(--space-xs);
        margin-bottom: var(--space-md);
        font-size: var(--text-sm);
        padding: var(--space-sm) var(--space-md);
    }

    /* Archived notice */
    .chat-archived-notice {
        padding: var(--space-xl);
    }

    .chat-archived-notice svg {
        width: 48px;
        height: 48px;
        margin-bottom: var(--space-md);
    }

    .chat-archived-notice p {
        font-size: var(--text-sm);
    }

    /* Modal overlay */
    .modal-overlay {
        padding: var(--space-md);
    }

    .modal-content {
        max-width: 340px;
        padding: var(--space-xl);
    }

    .modal-content h2 {
        font-size: var(--text-lg);
    }

    /* Login prompt */
    .orders-login-prompt {
        padding: var(--space-2xl);
    }

    .orders-login-prompt svg {
        width: 48px;
        height: 48px;
    }

    .orders-login-prompt h2 {
        font-size: var(--text-lg);
    }

    .orders-login-prompt p {
        font-size: var(--text-sm);
    }

    /* Ensure all buttons and inputs are touch-friendly (44x44 minimum) */
    button,
    .btn {
        min-height: 44px;
        min-width: 44px;
        padding: var(--space-md) var(--space-lg);
    }

    /* Message attachments on mobile */
    .message-attachments {
        gap: var(--space-xs);
    }

    .message-attachment {
        padding: var(--space-xs) var(--space-sm);
        font-size: var(--text-xs);
    }

    .message-attachment svg {
        width: 14px;
        height: 14px;
    }

    .attachment-name {
        max-width: 100px;
    }

    /* Loading state */
    .order-detail-section {
        padding: var(--space-md);
    }

    .loading-spinner {
        width: 32px;
        height: 32px;
        border-width: 3px;
    }

    /* Prevent text overflow */
    .chat-message p,
    .chat-message span,
    .service-line-item,
    .deliverable-item {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    /* Ensure proper spacing for touch interaction */
    .chat-input-wrapper textarea:focus {
        border-width: 2px;
    }
}

/* Extra small screens (phones, <480px) */
@media (max-width: 480px) {
    /* Reduce padding for smaller screens */
    .order-detail-container {
        padding: var(--space-sm);
        gap: var(--space-sm);
    }

    .chat-panel-card {
        min-height: 500px;
    }

    .chat-panel-header {
        padding: var(--space-sm);
    }

    .chat-panel-avatar {
        width: 32px;
        height: 32px;
    }

    .chat-panel-info h3 {
        font-size: var(--text-sm);
    }

    /* Chat messages */
    .chat-messages {
        padding: var(--space-sm);
        gap: var(--space-sm);
    }

    .chat-message {
        max-width: 95%;
    }

    .chat-message-avatar {
        width: 24px;
        height: 24px;
    }

    .chat-message-content p {
        font-size: var(--text-sm);
        padding: var(--space-xs) var(--space-sm);
    }

    /* Chat input */
    .chat-input-form {
        padding: var(--space-sm);
    }

    .chat-input-wrapper textarea {
        font-size: 16px;
        padding: var(--space-sm);
    }

    .chat-attach-btn {
        width: 40px;
        height: 40px;
    }

    .chat-send-btn {
        width: 40px;
        height: 40px;
    }

    /* Order details sections */
    .order-detail-header,
    .order-services-list,
    .order-project-info,
    .order-milestones,
    .order-deliverables {
        padding: var(--space-md);
    }

    .order-header-top h1 {
        font-size: var(--text-lg);
    }

    .order-services-list h3,
    .order-project-info h3,
    .order-milestones h3,
    .order-deliverables h3 {
        font-size: var(--text-sm);
    }

    /* Adjust text sizes */
    h1 { font-size: var(--text-xl); }
    h2 { font-size: var(--text-lg); }
    h3 { font-size: var(--text-base); }

    /* Milestone and deliverable items */
    .milestone-item {
        font-size: var(--text-xs);
    }

    .deliverable-item {
        font-size: var(--text-xs);
        padding: var(--space-xs) var(--space-sm);
    }

    /* Modal */
    .modal-content {
        padding: var(--space-lg);
        max-width: 300px;
    }

    .modal-content h2 {
        font-size: var(--text-base);
    }

    /* Login prompt */
    .orders-login-prompt {
        padding: var(--space-xl);
    }

    .orders-login-prompt h2 {
        font-size: var(--text-base);
    }

    /* Attachments */
    .attachment-preview-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }

    .attachment-preview-name {
        max-width: 100%;
    }

    /* Archived notice */
    .chat-archived-notice {
        padding: var(--space-lg);
    }

    .chat-archived-notice svg {
        width: 40px;
        height: 40px;
    }
}

/* ============================================
   ACTIVITY TIMELINE STYLES
   ============================================ */

.order-activity-timeline {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: var(--space-xl);
    margin-top: var(--space-lg);
}

.order-activity-timeline h3 {
    font-family: var(--font-display);
    font-size: var(--text-base);
    font-weight: 600;
    margin-bottom: var(--space-md);
    color: var(--color-text-primary);
}

/* Loading state */
.timeline-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-2xl);
    color: var(--color-text-tertiary);
    text-align: center;
}

.timeline-loading-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid var(--color-border);
    border-top-color: var(--color-brand-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: var(--space-sm);
}

/* Empty state */
.timeline-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-2xl);
    color: var(--color-text-tertiary);
    text-align: center;
}

.timeline-empty svg {
    width: 48px;
    height: 48px;
    margin-bottom: var(--space-md);
    opacity: 0.5;
}

.timeline-empty p {
    font-size: var(--text-sm);
    margin: 0;
}

/* Error state */
.timeline-error {
    color: var(--color-brand-red, #dc2626);
    text-align: center;
    padding: var(--space-xl);
    margin: 0;
}

/* Timeline items */
.timeline-items {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.timeline-item {
    display: flex;
    gap: var(--space-md);
    position: relative;
}

/* Vertical line connecting items */
.timeline-item::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 36px;
    bottom: calc(-1 * var(--space-md));
    width: 2px;
    background: var(--color-border);
}

.timeline-item:last-child::before {
    display: none;
}

/* Icon */
.timeline-icon {
    width: 40px;
    height: 40px;
    min-width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-bg);
    border: 2px solid var(--color-border);
    border-radius: 50%;
    color: var(--color-brand-blue);
    flex-shrink: 0;
    z-index: 1;
}

.timeline-icon svg {
    width: 20px;
    height: 20px;
}

/* Content */
.timeline-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-top: 4px;
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--space-md);
}

.timeline-title {
    font-weight: 500;
    font-size: var(--text-sm);
    color: var(--color-text-primary);
}

.timeline-time {
    font-size: var(--text-xs);
    color: var(--color-text-tertiary);
    white-space: nowrap;
}

.timeline-description {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    margin: 0;
    line-height: 1.4;
}

.timeline-actor {
    font-size: var(--text-xs);
    color: var(--color-brand-blue);
    font-weight: 500;
}

/* Responsive design - timeline adjusts on mobile */
@media (max-width: 768px) {
    .order-activity-timeline {
        padding: var(--space-lg);
    }

    .order-activity-timeline h3 {
        font-size: var(--text-sm);
    }

    .timeline-icon {
        width: 36px;
        height: 36px;
        min-width: 36px;
    }

    .timeline-icon svg {
        width: 18px;
        height: 18px;
    }

    .timeline-item::before {
        left: 18px;
        top: 32px;
    }

    .timeline-header {
        flex-direction: column;
        gap: 4px;
    }

    .timeline-title {
        font-size: var(--text-sm);
    }

    .timeline-description {
        font-size: var(--text-sm);
    }

    .timeline-time {
        font-size: 11px;
    }

    .timeline-actor {
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .order-activity-timeline {
        padding: var(--space-md);
    }

    .timeline-items {
        gap: var(--space-sm);
    }

    .timeline-icon {
        width: 32px;
        height: 32px;
        min-width: 32px;
    }

    .timeline-icon svg {
        width: 16px;
        height: 16px;
    }

    .timeline-item::before {
        left: 16px;
        top: 28px;
    }

    .timeline-title,
    .timeline-description {
        font-size: var(--text-sm);
    }

    .timeline-empty svg {
        width: 40px;
        height: 40px;
    }
}

