﻿/* Hover image */

.thumbnail-wrapper {
    position: relative;
    display: inline-block;
}

.thumbnail-img {
    cursor: zoom-in;
    transition: transform 0.2s;
}

    .thumbnail-img:hover {
        transform: scale(1.05);
    }

.zoom-viewer {
    position: fixed;
    width: 400px;
    height: 400px;
    left: 350px;
    top: 50%;
    transform: translateY(-50%);
    background: white;
    box-shadow: 0 0 25px rgba(0,0,0,0.3);
    z-index: 1000;
    display: none;
    overflow: hidden;
    border-radius: 5px;
    border: 1px solid #eee;
    padding: 10px;
    box-sizing: border-box;
    pointer-events: none; /* Prevents flickering */
}

    .zoom-viewer img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }


@media (max-width: 768px) {
    .zoom-viewer {
        width: 300px;
        height: 300px;
        right: 10px;
    }
}
/* Hover end */

.order-cardc {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    box-shadow: 0 2px 10px rgba(15,60,32,.05);
    overflow: hidden; /* clip the header's gradient to the card's rounded corners */
}

.order-card__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    padding: 22px 24px;
    background: linear-gradient(135deg,#f3f9f4 0%,#eaf4ec 100%);
    border-bottom: 1px solid #e3ede5;
}

.od-eyebrow {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: #0c6e30;
    margin: 0 0 4px;
}

.order-card__title {
    margin: 0;
    font-size: 22px;
    font-weight: 800;
    color: #0e1f14;
    letter-spacing: -.2px;
}

.order-card__meta {
    color: #64748b;
    font-size: 12px;
    margin-top: 8px
}

.od-date-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    font-weight: 600;
    color: #4b5a4f;
    background: #fff;
    border: 1px solid #e2e8e3;
    padding: 5px 11px;
    border-radius: 999px;
}
.od-date-chip i { font-size: 11px; color: #8a9890; }

.order-card__pill {
    font-family: inherit;
    background: #eef2ff;
    color: #3730a3;
    border: 1.5px solid #c7d2fe;
    border-radius: 999px;
    padding: 7px 16px;
    font-size: 12px;
    font-weight: 700;
    margin-right: 20px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: .15s;
    box-shadow: 0 1px 3px rgba(55,48,163,.08);
}

.order-card__pill:hover {
    background: #e0e7ff;
    border-color: #a5b4fc;
    color: #312e81;
}

.order-card__pill:active {
    transform: translateY(1px);
    box-shadow: none;
}

.table-wrap {
    padding: 12px 16px;
    overflow-x: auto; /* keep the wide 12-col table inside the modal */
    -webkit-overflow-scrolling: touch;
}

.od-table {
    width: 100%;
    min-width: 880px; /* don't crush columns; scroll instead of breaking out */
    border-collapse: separate;
    border-spacing: 0
}

    .od-table thead th {
        background: #f8fafc;
        color: #0f172a;
        font-weight: 700;
        border-top: 1px solid #e2e8f0;
        border-bottom: 1px solid #e2e8f0;
        padding: 8px 10px;
        font-size: 12.5px;
        white-space: nowrap
    }

    .od-table tbody td {
        border-bottom: 1px solid #f1f5f9;
        padding: 8px 10px;
        vertical-align: middle;
        font-size: 12.5px
    }

    .od-table tbody tr:hover {
        background: #fafafa
    }

.text-end {
    text-align: right
}

.img-td {
    display: flex;
    align-items: center;
    gap: 10px
}

    .img-td img {
        width: 48px;
        height: 48px;
        border-radius: 10px;
        object-fit: cover;
        border: 1px solid #e5e7eb
    }

.variant-name {
    font-weight: 600;
    color: #111827
}

.muted {
    color: #6b7280;
    font-size: 12px
}

.summary {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    padding: 12px 16px 18px
}

.summary__left {
    flex: 1 1 260px
}

.summary__right {
    flex: 1 1 320px;
    max-width: 480px;
    margin-left: auto
}

.summary-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0
}

    .summary-table td {
        padding: 8px 10px;
        border-bottom: 1px dashed #e5e7eb
    }

.summary-total td {
    font-weight: 800;
    border-bottom: 0;
    font-size: 16px;
    padding-top: 12px
}

@media (max-width:720px) {
    .od-table thead {
        display: none
    }

    .od-table tbody tr {
        display: block;
        padding: 10px 8px;
        border: 1px solid #eee;
        border-radius: 12px;
        margin-bottom: 10px
    }

    .od-table tbody td {
        display: flex;
        justify-content: space-between;
        border-bottom: 0
    }

        .od-table tbody td::before {
            content: attr(data-label);
            font-weight: 600;
            color: #334155
        }

    .img-td {
        justify-content: flex-start
    }
}
/* Modal Overlay */
.modal-overlay {
    display: none; /* hidden by default */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6); /* semi transparent */
    z-index: 9999; /* ensure it is always on top */
    overflow-y: auto; /* scroll if content is larger */
    padding: 40px 20px; /* spacing from top/bottom */
    box-sizing: border-box;
}

/* Modal Box */
.modal-box {
    background: #fff;
    width: 100%;
    max-width: 1080px;
    margin: auto;
    border-radius: 16px;
    position: relative;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    animation: fadeInUp 0.3s ease; /* smooth animation */
    overflow: hidden; /* clip children to rounded box, no breakout */
}

/* Close Button */
.modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    font-size: 28px;
    font-weight: bold;
    color: #444;
    cursor: pointer;
    transition: color 0.2s ease;
}

    .modal-close:hover {
        color: #000;
    }

/* Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile Responsive */
@media (max-width: 720px) {
    .modal-box {
        width: 95%;
        padding: 10px;
        border-radius: 12px;
    }
}

/* ========== Zepto-Style Shipment Tracking Timeline ========== */
#shipment-tracking-section {
    padding: 20px 24px 8px;
    border-bottom: 1px solid #f1f5f9;
}

.tracking-timeline {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    position: relative;
    padding: 0 8px;
}

/* Horizontal connector line behind circles.
   The 5 steps are equal flex columns inside an 8px-padded box, so a circle's
   centre sits at (2n-1)/10 of the CONTENT width. Anchoring the line to the first
   and last centres — calc(10% + 6.4px), i.e. 8px + (100% - 16px)/10 — keeps it
   from running past "Order Placed" and "Delivered". */
.tracking-timeline::before {
    content: '';
    position: absolute;
    top: 18px;
    left: calc(10% + 6.4px);
    right: calc(10% + 6.4px);
    height: 3px;
    background: #e5e7eb;
    z-index: 0;
}

.tracking-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
    flex: 1;
    min-width: 0;
}

.tracking-step__circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    background: #e5e7eb;
    color: #9ca3af;
    transition: all 0.3s ease;
    border: 3px solid #fff;
    box-shadow: 0 0 0 2px #e5e7eb;
}

.tracking-step.completed .tracking-step__circle {
    background: #16a34a;
    color: #fff;
    box-shadow: 0 0 0 2px #16a34a;
}

.tracking-step.active .tracking-step__circle {
    background: #16a34a;
    color: #fff;
    box-shadow: 0 0 0 2px #16a34a;
    animation: pulseStep 1.5s ease-in-out infinite;
}

.tracking-step.cancelled .tracking-step__circle {
    background: #dc2626;
    color: #fff;
    box-shadow: 0 0 0 2px #dc2626;
}

@keyframes pulseStep {
    0%, 100% { box-shadow: 0 0 0 2px #16a34a; }
    50% { box-shadow: 0 0 0 6px rgba(22,163,74,0.25); }
}

.tracking-step__label {
    margin-top: 8px;
    font-size: 11px;
    font-weight: 600;
    color: #9ca3af;
    text-align: center;
    line-height: 1.2;
    max-width: 80px;
    word-wrap: break-word;
}

.tracking-step.completed .tracking-step__label,
.tracking-step.active .tracking-step__label {
    color: #16a34a;
}

.tracking-step.cancelled .tracking-step__label {
    color: #dc2626;
}

.tracking-step__time {
    font-size: 10px;
    color: #9ca3af;
    margin-top: 2px;
    text-align: center;
}

/* Green filled connector between completed steps */
.tracking-step.completed + .tracking-step::before {
    /* Not used — we use the progress bar approach below */
}

/* Progress bar overlay on the connector line.
   Starts at the first circle's centre, same anchor as the grey line above; the
   width comes from renderTrackingTimeline() and is a fraction of the distance
   between the first and last centres, so a Delivered order stops exactly on the
   last circle instead of running to the edge of the box.
   `left` stays in CSS (not inline) so the mobile rule below can override it. */
.tracking-progress-bar {
    position: absolute;
    top: 18px;
    left: calc(10% + 6.4px);
    height: 3px;
    background: #16a34a;
    z-index: 0;
    transition: width 0.5s ease;
}

/* Delivery Partner Info */
.tracking-dp-info {
    margin-top: 12px;
    padding: 10px 16px;
    background: #f0fdf4;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: #166534;
}

.tracking-dp-info:empty {
    display: none;
}

.tracking-dp-info i {
    font-size: 18px;
}

.tracking-cancelled-banner {
    margin-top: 12px;
    padding: 10px 16px;
    background: #fef2f2;
    border-radius: 10px;
    color: #991b1b;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
}

/* Mobile responsive tracking */
@media (max-width: 576px) {
    .tracking-timeline {
        flex-direction: column;
        align-items: flex-start;
        padding: 0;
        gap: 0;
    }

    .tracking-timeline::before {
        top: 0;
        bottom: 0;
        left: 17px;
        right: auto;
        width: 3px;
        height: auto;
    }

    .tracking-progress-bar {
        top: 0;
        left: 17px;
        width: 3px !important;
        transition: height 0.5s ease;
    }

    .tracking-step {
        flex-direction: row;
        align-items: center;
        gap: 12px;
        padding: 8px 0;
    }

    .tracking-step__circle {
        flex-shrink: 0;
    }

    .tracking-step__label {
        margin-top: 0;
        text-align: left;
        max-width: none;
        font-size: 13px;
    }

    .tracking-step__time {
        text-align: left;
    }
}
/* ========== End Tracking Timeline ========== */

/* ========== Zepto/Blinkit-Style Rating Section ========== */
#rating-section {
    border-bottom: 1px solid #f1f5f9;
}

.rating-container {
    padding: 20px 24px;
}

.rating-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

.rating-header__icon {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #fff;
    flex-shrink: 0;
}

.rating-header__title {
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}

.rating-header__subtitle {
    font-size: 12px;
    color: #94a3b8;
    margin: 2px 0 0;
}

/* Star Rating */
.rating-stars {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 6px;
}

.rating-star {
    font-size: 32px;
    color: #e2e8f0;
    cursor: pointer;
    transition: color 0.2s, transform 0.2s;
}

.rating-star:hover,
.rating-star.hovered {
    color: #fbbf24;
    transform: scale(1.15);
}

.rating-star.selected {
    color: #f59e0b;
}

.rating-label {
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: #94a3b8;
    margin-bottom: 16px;
    min-height: 18px;
}

/* Quick Tags */
.rating-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
    justify-content: center;
}

.rating-tag {
    padding: 6px 14px;
    border: 1.5px solid #e2e8f0;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.rating-tag:hover {
    border-color: #16a34a;
    color: #16a34a;
}

.rating-tag.active {
    background: #f0fdf4;
    border-color: #16a34a;
    color: #16a34a;
    font-weight: 600;
}

/* Comment */
.rating-comment {
    width: 100%;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 13px;
    font-family: inherit;
    resize: none;
    outline: none;
    transition: border-color 0.2s;
    margin-bottom: 12px;
    color: #334155;
}

.rating-comment:focus {
    border-color: #16a34a;
}

.rating-comment::placeholder {
    color: #94a3b8;
}

/* Anonymous Toggle */
.rating-anonymous {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #64748b;
    cursor: pointer;
    margin-bottom: 16px;
    user-select: none;
}

.rating-anonymous input[type="checkbox"] {
    display: none;
}

.rating-anonymous__checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid #cbd5e1;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.rating-anonymous input[type="checkbox"]:checked + .rating-anonymous__checkmark {
    background: #16a34a;
    border-color: #16a34a;
}

.rating-anonymous input[type="checkbox"]:checked + .rating-anonymous__checkmark::after {
    content: '\2713';
    color: #fff;
    font-size: 12px;
    font-weight: bold;
}

/* Submit Button */
.rating-submit-btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #16a34a, #15803d);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.3px;
}

.rating-submit-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.3);
}

.rating-submit-btn:disabled {
    background: #cbd5e1;
    cursor: not-allowed;
}

.rating-submit-btn.loading {
    opacity: 0.7;
    pointer-events: none;
}

/* Success Message */
.rating-success {
    text-align: center;
    padding: 16px;
    background: #f0fdf4;
    border-radius: 10px;
    color: #16a34a;
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.rating-success i {
    font-size: 20px;
}

.rating-success.rating-error {
    background: #fef2f2;
    color: #dc2626;
}

.rating-success .text-danger {
    color: #dc2626 !important;
}

/* Mobile responsive rating */
@media (max-width: 576px) {
    .rating-container {
        padding: 16px;
    }

    .rating-star {
        font-size: 28px;
    }

    .rating-tags {
        gap: 6px;
    }

    .rating-tag {
        font-size: 11px;
        padding: 5px 10px;
    }
}
/* ========== End Rating Section ========== */
