/* ==================================================
   WOALY Orders List Component - Modern Card Layout
   ================================================== */

/* Orders Container */
.woocommerce-orders-list.account-orders-list {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 600px;
    overflow: auto;
    gap: 20px;
    margin: 0;
    padding: 0;
}

/* Order Card */
.order-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 214px;
    background: #ffffff;
    border: 1px solid #EBEBEB;
    border-radius: 24px;
    padding: 20px;
    transition: all 0.3s ease;
    position: relative;
}

a.order-card-link {
  text-decoration: none !important;
}

/* Product Images Section */
.order-images {
    display: flex;
    gap: 10px;
    margin-right: 20px;
    flex-shrink: 0;
}

.order-image {
    width: 70px;
    height: 70px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
}

.order-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.order-image:hover img {
    transform: scale(1.05);
}

/* Placeholder for orders without images */
.order-image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    color: #6b7280;
}

.placeholder-icon {
    font-size: 24px;
}

/* More products indicator */
.order-image-more {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #EAEFF0;
    color: black;
    font-weight: 600;
}

.more-count {
    font-size: 12px;
    font-weight: 600;
}

/* Order Details Section */
.order-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-right: 20px;
}

.order-header {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.order-status {
    border-radius: 42.32px;
    border-width: 1px;
    opacity: 1;
    font-family: Rethink sans-serif;
    font-weight: 400;
    font-size: 12px;
    line-height: 9px;
    text-align: center;
    width: fit-content;
    padding: 10px 14px;
    height: 29px;
    /* Default pending style */
    background: #FE9A001A;
    border: 1px solid #FE9A0066;
    color: #BB4D00;
}

.order-left-info {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  text-align: start;
  gap: 20px;
}

.order-num-date {
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Status-specific colors */
.order-status-pending .order-status {
    background: #FE9A001A;
    border: 1px solid #FE9A0026;
    color: #BB4D00;
}

.order-status-processing .order-status {
    background: #00BCFF1A;
    border: 1px solid #00BCFF26;
    color: #0069A8;
}

.order-status-on-hold .order-status {
    background: #00BCFF1A;
    border: 1px solid #00BCFF26;
    color: #0069A8;
}

.order-status-completed .order-status {
    background: #7BF1A81A;
    border: 1px solid #00C95026;
    color: #008236;
}

.order-status-cancelled .order-status {
    background: #A1A1A11A;
    border: 1px solid #A1A1A126;
    color: #3F3F46;
}

.order-status-refunded .order-status {
    background: #A1A1A11A;
    border: 1px solid #A1A1A126;
    color: #3F3F46;
}

.order-status-failed .order-status {
    background: #A1A1A11A;
    border: 1px solid #A1A1A126;
    color: #3F3F46;
}

.order-number {
    color: #242638;
    line-height: 11px;
    font-family: Rethink Sans;
    font-weight: 500;
    font-size: 16px;
}


.order-number a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.order-number a:hover {
    color: #007D48;
}

.order-date {
  font-family: Rethink Sans;
  font-weight: 400;
  font-size: 12px;
  line-height: 8px;
  color: #24263885;
}

/* Status Badge */
.order-status-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    width: fit-content;
}

/* Status Colors */
.order-status-badge.status-pending {
    background: #fef3c7;
    color: #92400e;
}

.order-status-badge.status-processing {
    background: #dbeafe;
    color: #1e40af;
}

.order-status-badge.status-on-hold {
    background: #f3e8ff;
    color: #7c2d12;
}

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

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

.order-status-badge.status-refunded {
    background: #f1f5f9;
    color: #475569;
}

.order-status-badge.status-failed {
    background: #fecaca;
    color: #dc2626;
}

/* Order Actions */
.order-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.order-action-btn {
    padding: 8px 16px;
    font-size: 14px;
    border-radius: 6px;
    background: #f3f4f6;
    color: #374151;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 1px solid #d1d5db;
}

.order-action-btn:hover {
    background: #007D48;
    color: white;
    border-color: #007D48;
    transform: translateY(-1px);
}

.order-action-btn.view {
    background: #007D48;
    color: white;
    border-color: #007D48;
}

.order-action-btn.view:hover {
    background: #065f46;
    border-color: #065f46;
}

/* Order Total Section */
.order-total {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: space-between;
    height: 100%;
    text-align: right;
    flex-shrink: 0;
}

.order-price {
    font-size: 16px;
    font-weight: 600;
    color: #242638;
    font-family: Rethink Sans;
    line-height: 11px;
    margin: 60px 0 0 0;
}

.order-item-count {
    font-size: 14px;
    color: #6b7280;
    font-weight: 400;
}

a.woocommerce-button.button.pay.order-pay-button {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 120px;
    height: 42px;
    font-family: Rethink Sans;
    font-weight: 500;
    font-size: 14px;
    line-height: 10px;
    text-align: center;
    border-radius: 100px;
    opacity: 1;
}

/* Responsive Design */
@media (max-width: 768px) {
    .order-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        padding: 16px;
    }

    .order-images {
        margin-right: 0;
        width: 100%;
        justify-content: flex-start;
    }

    .order-image {
        width: 60px;
        height: 60px;
    }

    .order-details {
        margin-right: 0;
        width: 100%;
    }

    .order-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .order-number {
        font-size: 16px;
    }

    .order-date {
        font-size: 13px;
    }

    .order-actions {
        justify-content: flex-start;
    }

    .order-action-btn {
        padding: 6px 12px;
        font-size: 13px;
    }

    .order-total {
        align-items: flex-start;
        text-align: left;
        width: 100%;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        border-top: 1px solid #e5e7eb;
        padding-top: 16px;
    }

    .order-price {
        font-size: 20px;
        margin-bottom: 0;
    }

    .order-item-count {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .order-card {
        padding: 12px;
    }

    .order-images {
        gap: 6px;
    }

    .order-image {
        width: 50px;
        height: 50px;
    }

    .order-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }

    .order-number {
        font-size: 15px;
    }

    .order-price {
        font-size: 18px;
    }

    .order-actions {
        gap: 6px;
    }

    .order-action-btn {
        padding: 5px 10px;
        font-size: 12px;
    }
}

/* Loading States */
.order-image img[loading="lazy"] {
    background: #f3f4f6;
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .order-card,
    .order-image img,
    .order-action-btn {
        transition: none;
    }

    .order-card:hover {
        transform: none;
    }
}

/* Focus States */
.order-number a:focus,
.order-action-btn:focus {
    outline: 2px solid #007D48;
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .order-card {
        box-shadow: none;
        border: 1px solid #000;
        break-inside: avoid;
        margin-bottom: 20px;
    }

    .order-action-btn {
        display: none;
    }
}
