/**
 * Order and Delivery Page Styles
 * 
 * This CSS file provides styles for the Order and Delivery page
 * and is designed to be fully independent of the theme's CSS.
 */

/* ========================================
   Order Delivery Page Container
======================================== */

.order-delivery-full-width {
    width: 100%;
    background: #fff;
}

.order-delivery-page {
    max-width: 70%;
    margin: 0 auto;
    padding: 2rem 1rem;
    font-family: var(--gbl-primary-font);
    color: #222;
    background: #fff;
}

/* ========================================
   Page Header
======================================== */

.order-delivery-page .page-header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem 0;
    background: #0faded; /* Sky blue */
    color: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(135, 206, 235, 0.15);
}

.order-delivery-page .page-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    color: white;
}

.order-delivery-page .page-subtitle {
    font-size: 1.1rem;
    margin: 0;
    opacity: 0.9;
    font-weight: 400;
}

/* ========================================
   Login Required Message
======================================== */

.order-delivery-page .login-required {
    text-align: center;
    padding: 3rem 2rem;
    background: #f8f9fa;
    border-radius: 12px;
    border: 2px dashed #dee2e6;
}

.order-delivery-page .login-required p {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    color: #6c757d;
}

.order-delivery-page .login-required .primary-btn {
    display: inline-block;
    padding: 12px 30px;
    background: var(--color-primary);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.order-delivery-page .login-required .primary-btn:hover {
    background: #63b8e9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(227, 48, 84, 0.3);
}

/* ========================================
   Filter Section
======================================== */

.order-filter-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e9ecef;
}

.order-filter-section h3 {
    margin: 0 0 1rem 0;
    font-size: 1.3rem;
    color: var(--color-secondary);
    font-weight: 600;
}

.filter-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-btn {
    display: inline-block;
    padding: 8px 16px;
    background: white;
    color: #6c757d;
    text-decoration: none;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.filter-btn:hover {
    background: #0faded; /* Sky blue */
    color: white;
    border-color: #87CEEB;
    transform: translateY(-1px);
}

.filter-btn.active {
    background: #0faded; /* Sky blue */
    color: white;
    border-color: #87CEEB;
    box-shadow: 0 2px 8px rgba(135, 206, 235, 0.2);
}

/* ========================================
   Orders Container
======================================== */

.orders-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* ========================================
   Order Card
======================================== */

.order-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.order-card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

/* Order Header */
.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid #dee2e6;
}

.order-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.order-icon {
    width: 50px;
    height: 50px;
    background: var(--color-primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
}

.order-details {
    display: flex;
    flex-direction: column;
}

.order-title {
    margin: 0;
    font-size: 1.5rem;
    color: var(--color-secondary);
    font-weight: 700;
}

.order-date {
    margin: 0.5rem 0 0 0;
    color: #6c757d;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.order-date i {
    color: var(--color-primary);
    font-size: 0.8rem;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 8px 16px;
    border-radius: 25px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.status-badge i {
    font-size: 0.6rem;
}

.status-processing {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.status-on-hold {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.status-shipped {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.status-completed,
.status-delivered {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* ========================================
   Tracking Section
======================================== */

.tracking-section {
    padding: 2rem;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.tracking-section h4 {
    margin: 0 0 1.5rem 0;
    color: var(--color-secondary);
    font-size: 1.2rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.tracking-section h4 i {
    color: var(--color-primary);
    font-size: 1rem;
}

.tracking-details {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1rem;
}

.tracking-number,
.carrier-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tracking-number strong,
.carrier-info strong {
    color: #495057;
    font-weight: 600;
    min-width: 120px;
}

.tracking-link {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    transition: all 0.3s ease;
}

.tracking-link:hover {
    color: #6ccde6;
    text-decoration: underline;
}

.tracking-icon {
    font-size: 0.8rem;
    opacity: 0.7;
}

.carrier-name {
    color: #495057;
    font-weight: 500;
}

.carrier-logo {
    height: 24px;
    width: auto;
    border-radius: 4px;
}

.carrier-logo-link {
    display: inline-block;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.carrier-logo-link:hover {
    opacity: 0.8;
}

.tracking-guidance {
    margin-top: 1rem;
    margin-left: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid var(--color-primary);
}

.tracking-guidance p {
    padding-left: 1rem;
    margin: 0;
    font-size: 0.9rem;
    color: #6c757d;
    line-height: 1.5;
}

/* ========================================
   Products Section
======================================== */

.products-section {
    padding: 2rem;
}

.products-section h4 {
    margin: 0 0 1.5rem 0;
    color: var(--color-secondary);
    font-size: 1.2rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.products-section h4 i {
    color: var(--color-primary);
    font-size: 1rem;
}

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

.product-item {
    display: grid;
    grid-template-columns: 80px 1fr auto;
    gap: 1.5rem;
    align-items: center;
    padding: 1.5rem;
    background: white;
    border-radius: 12px;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.product-item:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.product-image img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.product-details {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.product-name {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.product-name a {
    color: var(--color-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.product-name a:hover {
    color: var(--color-primary);
}

.product-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.9rem;
    color: #6c757d;
}

.product-quantity,
.product-price {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.product-total {
    text-align: right;
}

.total-amount {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-secondary);
}

/* ========================================
   Order Summary
======================================== */

.order-summary {
    padding: 2rem;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

.order-summary h4 {
    margin: 0 0 1.5rem 0;
    color: var(--color-secondary);
    font-size: 1.2rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.order-summary h4 i {
    color: var(--color-primary);
    font-size: 1rem;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #e9ecef;
}

.summary-row:last-child {
    border-bottom: none;
}

.summary-row.total {
    border-top: 2px solid #dee2e6;
    border-bottom: none;
    padding-top: 1rem;
    margin-top: 0.5rem;
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--color-secondary);
}

.summary-label {
    color: #6c757d;
    font-weight: 500;
}

.summary-value {
    color: #19325c;
    font-weight: 600;
}

/* ========================================
   Order Actions
======================================== */

.order-actions {
    padding: 2rem;
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    background: white;
    border-top: 1px solid #e9ecef;
}

.btn-view-order,
.btn-reorder {
    display: inline-block;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.btn-view-order {
    background: var(--color-secondary);
    color: white;
    border: 2px solid var(--color-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-view-order:hover {
    background: #142a4a;
    border-color: #142a4a;
    transform: translateY(-1px);
}

.btn-reorder {
    background: white;
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
}

.btn-reorder:hover {
    background: var(--color-primary);
    color: white;
    transform: translateY(-1px);
}

/* ========================================
   No Orders State
======================================== */

.no-orders {
    text-align: center;
    padding: 4rem 2rem;
}

.no-orders-content {
    max-width: 400px;
    margin: 0 auto;
}

.no-orders h3 {
    margin: 0 0 1rem 0;
    color: var(--color-secondary);
    font-size: 1.5rem;
    font-weight: 600;
}

.no-orders p {
    margin: 0 0 2rem 0;
    color: #6c757d;
    font-size: 1.1rem;
}

.no-orders .primary-btn {
    display: inline-block;
    padding: 12px 30px;
    background: var(--color-primary);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.no-orders .primary-btn:hover {
    background: #87d1ee;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(227, 48, 84, 0.3);
}

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

.order-notes-section {
    padding: 2rem;
    border-top: 1px solid #e9ecef;
}

.order-notes-section h4 {
    margin: 0 0 1.5rem 0;
    color: var(--color-secondary);
    font-size: 1.2rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.order-notes-section h4 i {
    color: var(--color-primary);
    font-size: 1rem;
}

.woocommerce-OrderUpdates {
    list-style: none;
    padding: 0;
    margin: 0;
}

.woocommerce-OrderUpdate {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    border-left: 4px solid var(--color-primary);
}

.woocommerce-OrderUpdate-meta {
    font-size: 0.9rem;
    color: #6c757d;
    margin: 0 0 0.5rem 0;
    font-weight: 500;
}

.woocommerce-OrderUpdate-description {
    color: #495057;
    line-height: 1.5;
}

.woocommerce-OrderUpdate-description p {
    margin: 0;
}

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

/* Desktop (1200px and above) */
@media (min-width: 1200px) {
    .order-delivery-page {
        max-width: 80%;
        padding: 0 24px;
    }
    
    .bs-account-main .order-delivery-page {
        max-width: 80%;
    }
}

/* Large Tablet (1024px - 1199px) */
@media (min-width: 1024px) and (max-width: 1199px) {
    .order-delivery-page {
        max-width: 100%;
        padding: 0 10px;
    }
    
    .bs-account-main .order-delivery-page {
        max-width: 100%;
    }
}

/* Tablet (768px - 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
    .order-delivery-page {
        max-width: 100%;
        padding: 0 6px;
    }
    
    .bs-account-main .order-delivery-page {
        max-width: 100%;
    }
    
    .order-delivery-page .page-title {
        font-size: 2.2rem;
    }
    
    .order-delivery-page .page-subtitle {
        font-size: 1.1rem;
    }
    
    .filter-buttons {
        justify-content: center;
        gap: 12px;
    }
    
    .filter-btn {
        flex: 1;
        text-align: center;
        min-width: 140px;
        padding: 12px 16px;
    }
    
    .order-header {
        padding: 2rem;
    }
    
    .order-info {
        flex-direction: row;
        gap: 1rem;
    }
    
    .order-icon {
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }
    
    .tracking-section,
    .products-section,
    .order-summary,
    .order-notes-section,
    .order-actions {
        padding: 2rem;
    }
    
    .product-item {
        grid-template-columns: 80px 1fr auto;
        gap: 1.5rem;
        padding: 1.5rem;
    }
    
    .product-image img {
        width: 80px;
        height: 80px;
    }
}

/* Mobile (up to 767px) */
@media (max-width: 767px) {
    .order-delivery-page {
        max-width: 100%;
        padding: 0 5px;
    }
    
    .order-delivery-page .page-title {
        font-size: 1.8rem;
    }
    
    .order-delivery-page .page-subtitle {
        font-size: 1rem;
    }
    
    .filter-buttons {
        justify-content: center;
        gap: 8px;
    }
    
    .filter-btn {
        flex: 1;
        text-align: center;
        min-width: 100px;
        padding: 10px 12px;
        font-size: 0.9rem;
    }
    
    .order-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
        padding: 1.5rem;
    }
    
    .order-info {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .order-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .tracking-details {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .tracking-number,
    .carrier-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
    
    .tracking-section,
    .products-section,
    .order-summary,
    .order-notes-section,
    .order-actions {
        padding: 1.5rem;
    }
    
    .tracking-section h4,
    .products-section h4,
    .order-summary h4,
    .order-notes-section h4 {
        font-size: 1.1rem;
    }
    
    .tracking-number strong,
    .carrier-info strong {
        min-width: auto;
    }
    
    .tracking-section {
        display: none !important;
    }

    .product-item {
        grid-template-columns: 60px 1fr;
        gap: 0.75rem;
        padding: 1rem;
    }
    
    .product-image img {
        width: 60px;
        height: 60px;
    }
    
    .product-total {
        grid-column: 1 / -1;
        text-align: left;
        padding-top: 0.5rem;
        border-top: 1px solid #e9ecef;
    }
    
    .order-actions {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .btn-view-order,
    .btn-reorder {
        text-align: center;
        width: 100%;
    }
}

/* Small Mobile (up to 480px) */
@media (max-width: 480px) {
    .order-delivery-page {
        padding: 0 8px;
    }
    
    .order-delivery-page .page-header {
        padding: 1.25rem 0.75rem;
        margin-bottom: 1.5rem;
    }
    
    .order-delivery-page .page-title {
        font-size: 1.6rem;
    }
    
    .order-delivery-page .page-subtitle {
        font-size: 0.9rem;
    }
    
    .order-filter-section {
        padding: 0.75rem;
        margin-bottom: 1.25rem;
    }
    
    .filter-buttons {
        flex-direction: column;
        gap: 6px;
    }
    
    .filter-btn {
        flex: none;
        padding: 8px 10px;
        font-size: 0.85rem;
    }
    
    .order-card {
        margin: 0;
        border-radius: 12px;
    }
    
    .order-header,
    .tracking-section,
    .products-section,
    .order-summary,
    .order-actions {
        padding: 1rem;
    }
    
    .order-header {
        padding: 1.25rem 1rem;
    }
    
    .order-icon {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }
    
    .order-title {
        font-size: 1.3rem;
    }
    
    .order-date {
        font-size: 0.85rem;
    }
    
    .status-badge {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
    
    .product-item {
        grid-template-columns: 50px 1fr;
        gap: 0.5rem;
        padding: 0.75rem;
    }
    
    .product-image img {
        width: 50px;
        height: 50px;
    }
    
    .product-name {
        font-size: 0.9rem;
    }
    
    .product-meta {
        flex-direction: column;
        gap: 0.25rem;
        font-size: 0.8rem;
    }
    
    .total-amount {
        font-size: 1rem;
    }
    
    .summary-row {
        padding: 0.4rem 0;
    }
    
    .summary-label,
    .summary-value {
        font-size: 0.9rem;
    }
    
    .btn-view-order,
    .btn-reorder {
        padding: 10px 16px;
        font-size: 0.9rem;
    }
}

/* ========================================
   Account Dashboard Integration
======================================== */

/* Ensure proper integration with account dashboard */
.bs-account-main .order-delivery-page {
    width: 100%;
    max-width: none;
}

.bs-account-main .order-delivery-page .page-header {
    margin-bottom: 2rem;
}

/* Hide page header when inside account dashboard on mobile */
@media (max-width: 768px) {
    .bs-account-main .order-delivery-page .page-header {
        display: none;
    }
    
    .bs-account-main .order-delivery-page {
        padding: 0;
    }
}

/* ========================================
   Accessibility Improvements
======================================== */

/* Focus states for better accessibility */
.filter-btn:focus,
.tracking-link:focus,
.product-name a:focus,
.btn-view-order:focus,
.btn-reorder:focus,
.primary-btn:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* Screen reader only text */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .order-card {
        border: 2px solid #000;
    }
    
    .status-badge {
        border: 2px solid currentColor;
    }
    
    .filter-btn {
        border: 2px solid #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .order-card,
    .filter-btn,
    .tracking-link,
    .btn-view-order,
    .btn-reorder,
    .primary-btn {
        transition: none;
    }
    
    .order-card:hover,
    .filter-btn:hover,
    .btn-view-order:hover,
    .btn-reorder:hover,
    .primary-btn:hover {
        transform: none;
    }
}

/* ========================================
   No Tracking Message
======================================== */

.no-tracking-message {
    padding: 1.5rem;
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border: 1px solid #ffeaa7;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(133, 100, 4, 0.1);
}

.no-tracking-message p {
    margin: 0.5rem 0;
    color: #856404;
    font-size: 0.95rem;
    line-height: 1.6;
}

.no-tracking-message p:first-child {
    font-weight: 600;
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

/* ========================================
   Order Links and Actions
======================================== */

.order-link {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.order-link:hover {
    color: var(--color-secondary);
    text-decoration: underline;
}

.shop_table .button {
    display: inline-block;
    padding: 8px 16px;
    background: var(--color-primary);
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.shop_table .button:hover {
    background: var(--color-secondary);
    transform: translateY(-1px);
}

.shop_table .button.view {
    background: var(--color-primary);
}

.shop_table .button.view:hover {
    background: var(--color-secondary);
} 