/**
 * Order Tracking Page Styles
 */

/* Breadcrumb Navigation */
.breadcrumb-nav {
    background: #f8f9fa;
    padding: 15px 0;
    border-bottom: 1px solid #e9ecef;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #6c757d;
}

.breadcrumb-link {
    color: #6c757d;
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumb-link:hover {
    color: var(--primary-red);
}

.breadcrumb-separator {
    color: #adb5bd;
}

.breadcrumb-current {
    color: #212529;
    font-weight: 500;
}

/* Track Section */
.track-section {
    padding: 60px 0;
    min-height: 60vh;
}

/* Track Form Container */
.track-form-container {
    max-width: 800px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
}

.track-form-wrapper {
    background: white;
    border-radius: 15px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
}

.track-form-header {
    text-align: center;
    margin-bottom: 35px;
}

.track-form-header i {
    font-size: 48px;
    color: var(--primary-red);
    margin-bottom: 15px;
    display: block;
}

.track-form-header h3 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 10px;
}

.track-form-header p {
    color: #6c757d;
    font-size: 14px;
}

/* Alert Messages */
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 25px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert i {
    font-size: 18px;
}

/* Track Form */
.track-form {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-size: 14px;
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
}

.form-group input {
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: white;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-red);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.form-group small {
    font-size: 12px;
    color: #6c757d;
    margin-top: 5px;
}

.btn-track {
    width: 100%;
    padding: 14px;
    font-size: 16px;
}

/* Track Help */
.track-help {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 30px;
    border-left: 4px solid var(--primary-red);
}

.track-help h4 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 15px;
}

.track-help ul {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
}

.track-help ul li {
    padding: 8px 0;
    font-size: 14px;
    color: #495057;
    display: flex;
    align-items: center;
    gap: 10px;
}

.track-help ul li i {
    color: var(--primary-red);
    font-size: 16px;
}

.track-help p {
    font-size: 14px;
    color: #495057;
}

.track-help a {
    color: var(--primary-red);
    text-decoration: none;
    font-weight: 600;
}

.track-help a:hover {
    text-decoration: underline;
}

/* Order Tracking Results */
.order-tracking-results {
    max-width: 1200px;
    margin: 0 auto;
}

/* Order Header */
.order-header {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.order-header h3 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 5px;
    color: #212529;
}

.order-header p {
    color: #6c757d;
    font-size: 14px;
}

/* Order Status */
.order-status-container {
    display: flex;
    gap: 20px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.order-status-badge,
.payment-status-badge {
    padding: 15px 25px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.order-status-badge {
    background: #e3f2fd;
    color: #1976d2;
}

.order-status-badge.pending {
    background: #fff3e0;
    color: #f57c00;
}

.order-status-badge.processing {
    background: #e8f5e9;
    color: #388e3c;
}

.order-status-badge.shipped {
    background: #e1f5fe;
    color: #0277bd;
}

.order-status-badge.delivered {
    background: #e8f5e9;
    color: #2e7d32;
}

.order-status-badge.cancelled {
    background: #ffebee;
    color: #c62828;
}

.payment-status-badge.paid {
    background: #e8f5e9;
    color: #2e7d32;
}

.payment-status-badge.pending {
    background: #fff3e0;
    color: #f57c00;
}

/* Order Progress */
.order-progress {
    background: white;
    border-radius: 15px;
    padding: 40px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    margin-bottom: 30px;
    position: relative;
}

.progress-steps {
    display: flex;
    justify-content: space-between;
    position: relative;
    z-index: 2;
}

.progress-step {
    text-align: center;
    flex: 1;
}

.step-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
    font-size: 24px;
    color: #adb5bd;
    border: 3px solid #e9ecef;
    transition: all 0.3s ease;
}

.progress-step.completed .step-icon {
    background: var(--primary-red);
    color: white;
    border-color: var(--primary-red);
}

.step-label {
    font-size: 14px;
    color: #6c757d;
    font-weight: 500;
}

.progress-step.completed .step-label {
    color: #212529;
    font-weight: 600;
}

.progress-line {
    position: absolute;
    top: 30px;
    left: 60px;
    right: 60px;
    height: 3px;
    background: #e9ecef;
    z-index: 1;
}

.progress-fill {
    height: 100%;
    background: var(--primary-red);
    transition: width 0.5s ease;
}

/* Order Details Grid */
.order-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.order-details-card {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
}

.order-details-card h4 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #212529;
}

.order-details-card h4 i {
    color: var(--primary-red);
}

.details-content p {
    margin: 10px 0;
    font-size: 14px;
    color: #495057;
}

.details-content p strong {
    color: #212529;
}

/* Summary Rows */
.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 14px;
    color: #495057;
    border-bottom: 1px solid #f8f9fa;
}

.summary-row.discount span:last-child {
    color: #28a745;
}

.summary-row.total {
    border-bottom: none;
    border-top: 2px solid #e9ecef;
    margin-top: 10px;
    padding-top: 15px;
    font-size: 16px;
    color: #212529;
}

/* Order Items */
.order-items-container {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
}

.order-items-container h4 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.order-items-container h4 i {
    color: var(--primary-red);
}

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

.order-item {
    display: flex;
    gap: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    align-items: center;
}

.item-image {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
}

.item-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

.item-placeholder {
    width: 100%;
    height: 100%;
    background: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #adb5bd;
}

.item-details {
    flex: 1;
}

.item-details h5 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #212529;
}

.item-variation {
    font-size: 13px;
    color: #6c757d;
    margin: 4px 0;
}

.item-quantity {
    font-size: 14px;
    color: #495057;
    margin-top: 8px;
}

.item-price {
    text-align: right;
}

.item-price .price {
    font-size: 16px;
    font-weight: 600;
    color: #212529;
    margin-bottom: 5px;
}

.item-price .total {
    font-size: 14px;
    color: #6c757d;
}

/* Buttons */
.btn {
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

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

.btn-primary:hover {
    background: #991b1b;
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    color: var(--primary-red);
    border: 2px solid var(--primary-red);
}

.btn-outline:hover {
    background: var(--primary-red);
    color: white;
}

/* Responsive Design */
@media (max-width: 992px) {
    .track-form-container {
        grid-template-columns: 1fr;
        max-width: 600px;
    }

    .order-details-grid {
        grid-template-columns: 1fr;
    }

    .order-progress {
        padding: 30px 20px;
    }
}

@media (max-width: 768px) {
    /* Container and padding adjustments */
    .container {
        padding-left: 20px;
        padding-right: 20px;
    }

    .track-section {
        padding: 40px 0;
    }

    /* Breadcrumb */
    .breadcrumb-nav {
        padding: 12px 0;
    }

    .breadcrumb {
        font-size: 13px;
        gap: 8px;
    }

    /* Hero adjustments */
    .hero-title {
        font-size: 32px !important;
    }

    .hero-subtitle {
        font-size: 16px !important;
    }

    /* Track Form */
    .track-form-wrapper {
        padding: 25px 20px;
        border-radius: 12px;
    }

    .track-form-header h3 {
        font-size: 20px;
    }

    .track-form-header i {
        font-size: 40px;
    }

    .track-form-header p {
        font-size: 13px;
    }

    /* Form inputs - larger for mobile */
    .form-group input {
        padding: 14px 16px;
        font-size: 16px; /* Prevents zoom on iOS */
        border-radius: 10px;
    }

    .btn-track {
        padding: 16px;
        font-size: 16px;
        border-radius: 10px;
        min-height: 48px; /* Better touch target */
    }

    /* Track Help */
    .track-help {
        padding: 20px;
        border-radius: 12px;
    }

    .track-help h4 {
        font-size: 16px;
    }

    .track-help ul li {
        font-size: 13px;
    }

    /* Order Header */
    .order-header {
        flex-direction: column;
        gap: 20px;
        text-align: center;
        padding: 25px 20px;
        border-radius: 12px;
    }

    .order-header h3 {
        font-size: 20px;
    }

    .order-header p {
        font-size: 13px;
    }

    .order-header-right {
        width: 100%;
    }

    .order-header-right .btn {
        width: 100%;
        justify-content: center;
        min-height: 44px; /* Better touch target */
    }

    /* Order Status */
    .order-status-container {
        flex-direction: column;
        gap: 12px;
        margin-bottom: 25px;
    }

    .order-status-badge,
    .payment-status-badge {
        width: 100%;
        justify-content: center;
        padding: 14px 20px;
        font-size: 14px;
        flex-direction: column;
        text-align: center;
        gap: 5px;
    }

    .order-status-badge i,
    .payment-status-badge i {
        font-size: 24px;
    }

    /* Progress Steps - Vertical Mobile Layout */
    .order-progress {
        padding: 25px 15px;
        border-radius: 12px;
    }

    .progress-steps {
        flex-direction: column;
        gap: 20px;
        align-items: stretch;
    }

    .progress-step {
        display: flex;
        align-items: center;
        gap: 15px;
        text-align: left;
        position: relative;
        padding-left: 0;
    }

    .progress-step::after {
        content: '';
        position: absolute;
        left: 30px;
        top: 60px;
        width: 3px;
        height: calc(100% + 20px);
        background: #e9ecef;
    }

    .progress-step:last-child::after {
        display: none;
    }

    .progress-step.completed::after {
        background: var(--primary-red);
    }

    .step-icon {
        width: 60px;
        height: 60px;
        margin: 0;
        flex-shrink: 0;
    }

    .step-label {
        font-size: 15px;
        flex: 1;
    }

    .step-date {
        font-size: 12px !important;
        margin-top: 2px !important;
    }

    .progress-line {
        display: none;
    }

    /* Order Details Cards */
    .order-details-card {
        padding: 20px;
        border-radius: 12px;
    }

    .order-details-card h4 {
        font-size: 16px;
    }

    .details-content p {
        font-size: 13px;
        margin: 8px 0;
        word-wrap: break-word;
    }

    .summary-row {
        font-size: 13px;
        gap: 10px;
    }

    .summary-row.total {
        font-size: 15px;
    }

    /* Order Items */
    .order-items-container {
        padding: 20px;
        border-radius: 12px;
    }

    .order-items-container h4 {
        font-size: 16px;
        margin-bottom: 20px;
    }

    .order-item {
        flex-direction: row;
        flex-wrap: wrap;
        padding: 15px;
        gap: 15px;
        border-radius: 10px;
    }

    .item-image {
        width: 70px;
        height: 70px;
    }

    .item-details {
        flex: 1;
        min-width: 0; /* Allows text truncation */
    }

    .item-details h5 {
        font-size: 15px;
        margin-bottom: 8px;
        line-height: 1.3;
    }

    .item-variation {
        font-size: 12px;
    }

    .item-quantity {
        font-size: 13px;
    }

    .item-price {
        width: 100%;
        text-align: right;
        margin-top: 10px;
        padding-top: 10px;
        border-top: 1px solid #e9ecef;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .item-price .price {
        font-size: 15px;
    }

    .item-price .total {
        font-size: 13px;
    }

    /* Special status messages */
    .order-special-status,
    .tracking-info,
    .delivery-estimate {
        padding: 15px !important;
        border-radius: 10px !important;
        margin: 15px 0 !important;
    }

    .order-special-status h4,
    .tracking-info h4,
    .delivery-estimate h4 {
        font-size: 15px !important;
        margin-bottom: 8px !important;
    }

    .order-special-status p,
    .tracking-info p,
    .delivery-estimate p {
        font-size: 13px !important;
    }

    /* Buttons - better touch targets */
    .btn {
        padding: 12px 20px;
        font-size: 14px;
        border-radius: 8px;
        min-height: 44px;
    }

    .btn-sm {
        padding: 10px 16px;
        min-height: 40px;
    }
}

@media (max-width: 480px) {
    /* Extra small screens */
    .track-section {
        padding: 30px 0;
    }

    .container {
        padding-left: 15px;
        padding-right: 15px;
    }

    /* Hero */
    .hero {
        padding: 40px 0 !important;
    }

    .hero-title {
        font-size: 28px !important;
    }

    .hero-subtitle {
        font-size: 14px !important;
    }

    /* Form */
    .track-form-wrapper {
        padding: 20px 15px;
    }

    .track-form-header h3 {
        font-size: 18px;
    }

    .track-form-header i {
        font-size: 36px;
        margin-bottom: 10px;
    }

    .form-group {
        gap: 20px;
    }

    .form-group label {
        font-size: 13px;
    }

    .form-group input {
        padding: 12px 14px;
        font-size: 16px;
    }

    .form-group small {
        font-size: 11px;
    }

    .btn-track {
        padding: 15px;
        font-size: 15px;
    }

    /* Track Help */
    .track-help {
        padding: 15px;
    }

    .track-help h4 {
        font-size: 15px;
        margin-bottom: 12px;
    }

    .track-help ul li {
        font-size: 12px;
        padding: 6px 0;
    }

    .track-help p {
        font-size: 12px;
    }

    /* Order Header */
    .order-header {
        padding: 20px 15px;
    }

    .order-header h3 {
        font-size: 18px;
        word-break: break-word;
    }

    /* Status badges */
    .order-status-badge,
    .payment-status-badge {
        padding: 12px 15px;
        font-size: 13px;
    }

    /* Progress */
    .order-progress {
        padding: 20px 12px;
    }

    .step-icon {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }

    .progress-step {
        gap: 12px;
    }

    .progress-step::after {
        left: 25px;
    }

    .step-label {
        font-size: 14px;
    }

    /* Order Details */
    .order-details-card {
        padding: 15px;
    }

    .order-details-card h4 {
        font-size: 15px;
        margin-bottom: 15px;
    }

    .details-content p {
        font-size: 12px;
        margin: 6px 0;
    }

    .summary-row {
        font-size: 12px;
        padding: 6px 0;
    }

    .summary-row.total {
        font-size: 14px;
        padding-top: 12px;
    }

    /* Order Items */
    .order-items-container {
        padding: 15px;
    }

    .order-items-container h4 {
        font-size: 15px;
        margin-bottom: 15px;
    }

    .order-items-list {
        gap: 15px;
    }

    .order-item {
        padding: 12px;
        gap: 12px;
    }

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

    .item-details h5 {
        font-size: 14px;
        margin-bottom: 6px;
    }

    .item-details h5 span {
        display: block;
        margin-top: 5px;
        margin-left: 0 !important;
    }

    .item-variation {
        font-size: 11px;
        margin: 3px 0;
    }

    .item-quantity {
        font-size: 12px;
        margin-top: 6px;
    }

    .item-price {
        font-size: 12px;
        margin-top: 8px;
        padding-top: 8px;
    }

    .item-price .price {
        font-size: 14px;
    }

    .item-price .total {
        font-size: 12px;
    }

    /* Bundle product details */
    .item-details div[style*="background"] {
        padding: 8px !important;
        margin-top: 8px !important;
        font-size: 11px !important;
    }

    .item-details div[style*="background"] strong {
        font-size: 12px !important;
    }

    .item-details div[style*="background"] > div {
        margin-left: 8px !important;
        font-size: 11px !important;
        margin-top: 4px !important;
    }

    .item-details div[style*="background"] span[style*="background"] {
        font-size: 10px !important;
        padding: 2px 5px !important;
        margin-right: 3px !important;
    }

    /* Special boxes */
    .order-special-status,
    .tracking-info,
    .delivery-estimate {
        padding: 12px !important;
        margin: 12px 0 !important;
    }

    .order-special-status h4,
    .tracking-info h4,
    .delivery-estimate h4 {
        font-size: 14px !important;
        margin-bottom: 6px !important;
    }

    .order-special-status p,
    .tracking-info p,
    .delivery-estimate p {
        font-size: 12px !important;
        line-height: 1.5;
    }

    /* Alert messages */
    .alert {
        padding: 12px 15px;
        font-size: 13px;
        gap: 8px;
        border-radius: 8px;
    }

    .alert i {
        font-size: 16px;
    }
}

/* Landscape phones */
@media (max-width: 768px) and (orientation: landscape) {
    .hero {
        padding: 30px 0 !important;
    }

    .track-section {
        padding: 30px 0;
    }

    .progress-steps {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 15px;
    }

    .progress-step {
        flex-direction: column;
        text-align: center;
        flex: 1;
        min-width: 120px;
    }

    .progress-step::after {
        display: none;
    }

    .step-icon {
        margin: 0 auto 8px;
    }
}

/* Very small screens - enhance readability */
@media (max-width: 360px) {
    .hero-title {
        font-size: 24px !important;
    }

    .order-header h3 {
        font-size: 16px;
    }

    .track-form-header h3 {
        font-size: 16px;
    }

    .step-icon {
        width: 45px;
        height: 45px;
        font-size: 18px;
    }

    .step-label {
        font-size: 13px;
    }

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

/* Improve touch interactions */
@media (hover: none) and (pointer: coarse) {
    /* This targets touch devices */
    .btn,
    .track-help a,
    .breadcrumb-link {
        -webkit-tap-highlight-color: rgba(220, 38, 38, 0.2);
    }

    .form-group input {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}