/* ===== Variables ===== */
:root {
    --color-black: #000000;
    --color-white: #ffffff;
    --color-gray-light: #f5f5f7;
    --color-gray-medium: #86868b;
    --color-gray-dark: #1d1d1f;
    --color-success: #10b981;
    --color-warning: #f59e0b;
    --color-error: #ef4444;
    --color-info: #3b82f6;
    --transition-smooth: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== Reset ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
    background: var(--color-white);
    color: var(--color-black);
    line-height: 1.6;
    font-size: 16px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===== Header (DEPRECATED - Using shared navigation from styles.css) ===== */
/* These styles are kept for backward compatibility but are no longer used */
/* The page now uses .nav structure from styles.css instead of .header */
.header {
    background: var(--color-white);
    border-bottom: 1px solid #e5e5e7;
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(20px);
    background: rgba(255, 255, 255, 0.9);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo img {
    height: 40px;
    width: auto;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.new-search-btn {
    padding: 10px 24px;
    background: var(--color-black);
    color: var(--color-white);
    border: none;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.new-search-btn:hover {
    background: var(--color-gray-dark);
    transform: translateY(-1px);
}

.back-link {
    color: var(--color-gray-medium);
    text-decoration: none;
    font-size: 14px;
    transition: var(--transition-smooth);
    white-space: nowrap;
}

.back-link:hover {
    color: var(--color-black);
}

/* ===== Main ===== */
.main {
    flex: 1;
    padding: 60px 0;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 40px;
}

/* ===== Search Section ===== */
.search-section {
    text-align: center;
    padding: 40px 0;
}

.main-title {
    font-size: clamp(36px, 5vw, 56px);
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: 16px;
}

.main-subtitle {
    font-size: 20px;
    color: var(--color-gray-medium);
    margin-bottom: 48px;
}

.search-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    max-width: 600px;
    margin: 0 auto 16px;
}

.search-input {
    width: 100%;
    padding: 18px 32px;
    border: 2px solid var(--color-gray-medium);
    border-radius: 50px;
    font-size: 20px;
    font-weight: 500;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 3px;
    transition: var(--transition-smooth);
    outline: none;
}

.search-input:focus {
    border-color: var(--color-black);
    box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.05);
}

.btn-search {
    padding: 18px 48px;
    background: var(--color-black);
    color: var(--color-white);
    border: none;
    border-radius: 50px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-search:hover {
    background: var(--color-gray-dark);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.btn-search:active {
    transform: translateY(0);
}

.help-text {
    font-size: 14px;
    color: var(--color-gray-medium);
}

/* ===== Loading State ===== */
.loading-state {
    text-align: center;
    padding: 80px 20px;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--color-gray-light);
    border-top: 4px solid var(--color-black);
    border-radius: 50%;
    margin: 0 auto 24px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-state p {
    font-size: 18px;
    color: var(--color-gray-medium);
}

/* ===== Error State ===== */
.error-state {
    text-align: center;
    padding: 80px 40px;
}

.error-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--color-error);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    font-weight: 700;
    margin: 0 auto 24px;
}

.error-title {
    font-size: 32px;
    font-weight: 600;
    margin-bottom: 16px;
}

.error-message {
    font-size: 18px;
    color: var(--color-gray-medium);
    margin-bottom: 32px;
}

.btn-retry {
    padding: 16px 40px;
    background: transparent;
    color: var(--color-black);
    border: 2px solid var(--color-black);
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-retry:hover {
    background: var(--color-black);
    color: var(--color-white);
}

/* ===== Results Section ===== */
.results-section {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== Order Header ===== */
.order-header {
    text-align: center;
    padding: 40px 20px;
    margin-bottom: 60px;
}

.greeting-title {
    font-size: clamp(36px, 6vw, 56px);
    font-weight: 700;
    color: var(--color-black);
    margin-bottom: 20px;
    letter-spacing: -0.02em;
}

.delivery-info {
    font-size: 20px;
    color: var(--color-gray-dark);
    line-height: 1.6;
}

.delivery-info strong {
    color: var(--color-black);
    font-weight: 700;
}

/* ===== Progress Timeline ===== */
.progress-section {
    margin-bottom: 60px;
    padding: 40px 0;
}

.timeline-progress {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    position: relative;
    max-width: 100%;
    margin: 0 auto;
    padding: 0 100px;
    gap: 70px;
}

/* Línea horizontal conectora en desktop - centrada al círculo */
.timeline-step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 40px;
    left: calc(50% + 40px);
    width: 70px;
    height: 3px;
    background: #e5e7eb;
    z-index: 0;
}

.timeline-step.completed:not(:last-child)::after {
    background: var(--color-success);
}

/* Asegurar que no haya líneas verticales en desktop */
.timeline-step::before {
    display: none;
}

.timeline-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    position: relative;
    z-index: 1;
    flex-shrink: 0;
}

.timeline-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid var(--color-black);
    background: var(--color-white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 700;
    color: var(--color-black);
    transition: var(--transition-smooth);
}

.timeline-step.completed .timeline-circle {
    border-color: var(--color-success);
    color: var(--color-success);
    background: var(--color-white);
}

.timeline-label {
    font-size: 16px;
    font-weight: 600;
    color: var(--color-black);
    text-align: center;
    max-width: 120px;
}

.timeline-step.pending .timeline-label {
    color: var(--color-gray-medium);
}

.timeline-step.completed .timeline-label {
    color: var(--color-success);
}

/* ===== Details Grid ===== */
.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 48px;
}

.detail-card {
    background: var(--color-gray-light);
    padding: 28px;
    border-radius: 16px;
    transition: var(--transition-smooth);
}

.detail-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.detail-content {
    width: 100%;
}

.detail-label {
    font-size: 13px;
    color: var(--color-gray-medium);
    margin-bottom: 4px;
    font-weight: 500;
}

.detail-value {
    font-size: 18px;
    font-weight: 600;
    color: var(--color-black);
}

/* ===== Timeline ===== */
.timeline-section,
.items-section {
    margin-bottom: 48px;
}

.section-title {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 32px;
    letter-spacing: -0.01em;
}

.timeline {
    position: relative;
    display: flex;
    justify-content: space-between;
    padding: 40px 0;
}

.timeline-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    flex: 1;
    position: relative;
}


.step-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-weight: 700;
    font-size: 20px;
    position: relative;
    z-index: 1;
    transition: var(--transition-smooth);
    margin-bottom: 16px;
}

.timeline-step.completed .step-icon {
    background: var(--color-success);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.timeline-step.current .step-icon {
    background: var(--color-info);
    color: white;
    box-shadow: 0 0 0 8px rgba(59, 130, 246, 0.15);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 8px rgba(59, 130, 246, 0.15);
    }
    50% {
        box-shadow: 0 0 0 12px rgba(59, 130, 246, 0.1);
    }
}

.timeline-step.pending .step-icon {
    background: #e5e7eb;
    color: #6b7280;
}

.step-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.step-label {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
}

.timeline-step.pending .step-label {
    color: #6b7280;
}

.step-description {
    font-size: 13px;
    color: var(--color-gray-medium);
    line-height: 1.4;
    max-width: 120px;
}

/* ===== Items List ===== */
.items-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.item-card {
    background: var(--color-gray-light);
    padding: 32px;
    border-radius: 16px;
    transition: var(--transition-smooth);
}

.item-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 16px;
}

.item-title {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 8px;
}

.item-details {
    font-size: 15px;
    color: var(--color-gray-medium);
}

.item-price {
    font-size: 24px;
    font-weight: 700;
    color: var(--color-black);
}

.item-service {
    font-size: 15px;
    color: var(--color-gray-medium);
    font-style: italic;
    margin-top: 12px;
}

/* Order Summary */
.order-summary {
    margin-top: 32px;
    padding: 24px 0;
    border-top: 2px solid var(--color-gray-light);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
}

.summary-row.total {
    font-size: 22px;
    font-weight: 700;
}

.summary-item {
    display: flex;
    gap: 12px;
    align-items: center;
}

.summary-label {
    color: var(--color-gray-dark);
    font-weight: 600;
}

.summary-value {
    font-weight: 700;
    color: var(--color-black);
}

.photos-wrapper {
    margin-top: 20px;
}

.item-photos {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}

.show-more-photos-btn {
    width: 100%;
    padding: 12px 24px;
    background: transparent;
    color: var(--color-black);
    border: 2px solid var(--color-gray-medium);
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.show-more-photos-btn:hover {
    border-color: var(--color-black);
    background: var(--color-gray-light);
}

.photo-link {
    aspect-ratio: 1;
    border-radius: 12px;
    overflow: hidden;
    display: block;
    transition: var(--transition-smooth);
}

.photo-link:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.photo-link img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ===== Actions ===== */
.actions-section {
    display: flex;
    gap: 16px;
    justify-content: center;
    padding-top: 24px;
}

.btn-refresh,
.btn-share {
    padding: 16px 32px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-refresh {
    background: var(--color-black);
    color: var(--color-white);
    border: none;
}

.btn-refresh:hover {
    background: var(--color-gray-dark);
    transform: translateY(-2px);
}

.btn-share {
    background: transparent;
    color: var(--color-black);
    border: 2px solid var(--color-black);
}

.btn-share:hover {
    background: var(--color-black);
    color: var(--color-white);
}

/* ===== Footer ===== */
.footer {
    background: var(--color-gray-light);
    padding: 40px 0;
    text-align: center;
    margin-top: 80px;
}

.footer p {
    font-size: 14px;
    color: var(--color-gray-medium);
}

/* ===== Image Modal ===== */
.image-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
}

.modal-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-close {
    position: absolute;
    top: -50px;
    right: 0;
    background: transparent;
    color: white;
    border: none;
    font-size: 48px;
    cursor: pointer;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
    z-index: 1002;
}

.modal-close:hover {
    transform: scale(1.1);
    color: var(--color-gray-light);
}

.modal-navigation {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    pointer-events: none;
    padding: 0 20px;
}

.modal-nav-btn {
    pointer-events: all;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    font-size: 36px;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-nav-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.1);
}

.modal-nav-btn:active {
    transform: scale(0.95);
}

.modal-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.modal-nav-btn:disabled:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: none;
}

/* ===== Utilities ===== */
.hidden {
    display: none !important;
}

/* Mobile/Desktop visibility */
.mobile-only {
    display: none !important;
}

.desktop-only {
    display: flex !important;
}

/* Hamburger Menu (hidden by default, shown in mobile) */
.hamburger-menu {
    flex-direction: column;
    gap: 5px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
}

.hamburger-menu span {
    width: 25px;
    height: 2px;
    background: var(--color-black);
    transition: var(--transition-smooth);
}

.hamburger-menu.active span:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
}

.hamburger-menu.active span:nth-child(2) {
    opacity: 0;
}

.hamburger-menu.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Mobile Menu */
.mobile-menu {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-white);
    border-top: 1px solid #e5e5e7;
    padding: 0;
    gap: 0;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease-out;
    opacity: 0;
}

.mobile-menu.active {
    max-height: 450px;
    padding: 20px 24px;
    gap: 12px;
    opacity: 1;
}

.mobile-menu .menu-link {
    color: var(--color-black);
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    padding: 12px 0;
    border-bottom: 1px solid #e5e5e7;
    transition: var(--transition-smooth);
}

.mobile-menu .menu-link:hover {
    color: var(--color-gray-medium);
}

.new-search-btn-mobile {
    padding: 12px 24px;
    background: var(--color-black);
    color: var(--color-white);
    border: none;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
    width: 100%;
    margin-top: 8px;
}

.new-search-btn-mobile:hover {
    background: var(--color-gray-dark);
}

/* ===== Desktop Timeline Centering ===== */
@media (min-width: 720px) {
    /* Centrar líneas horizontales en desktop */
    .timeline-step:not(:last-child)::after {
        top: 40%;
        transform: translateY(-10%);
    }
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    /* Show/Hide elements */
    .mobile-only {
        display: flex !important;
    }

    .desktop-only {
        display: none !important;
    }

    .mobile-menu {
        display: flex;
    }

    .header {
        position: relative;
    }

    .container {
        padding: 0 24px;
    }

    .header-container {
        padding: 0 24px;
    }

    .header-actions {
        gap: 12px;
    }

    .new-search-btn {
        padding: 8px 16px;
        font-size: 13px;
    }

    .back-link {
        font-size: 13px;
    }

    .main {
        padding: 40px 0;
    }

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

    .search-input {
        font-size: 18px;
        padding: 16px 24px;
    }

    .btn-search {
        font-size: 16px;
        padding: 16px 32px;
    }

    .order-header {
        padding: 28px;
        flex-direction: column;
        text-align: center;
    }

    .order-ticket {
        font-size: 32px;
    }

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

    /* Timeline mobile - stack vertically on small screens */
    .timeline {
        flex-direction: column;
        padding: 20px 0;
    }

    .timeline-step {
        flex-direction: row;
        text-align: left;
        gap: 16px;
        padding: 20px 0;
    }


    .step-icon {
        width: 40px;
        height: 40px;
        font-size: 16px;
        margin-bottom: 0;
    }

    .step-content {
        align-items: flex-start;
        flex: 1;
        padding-top: 8px;
    }

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

    .step-description {
        max-width: none;
        text-align: left;
        font-size: 14px;
    }

    .item-card {
        padding: 24px;
    }

    .item-photos {
        grid-template-columns: repeat(4, 1fr);
        gap: 12px;
    }

    .actions-section {
        flex-direction: column;
    }

    .btn-refresh,
    .btn-share {
        width: 100%;
        justify-content: center;
    }

    /* Modal responsive */
    .modal-close {
        top: 20px;
        right: 20px;
        font-size: 36px;
        width: 40px;
        height: 40px;
    }

    .modal-nav-btn {
        width: 50px;
        height: 50px;
        font-size: 28px;
    }

    .modal-navigation {
        padding: 0 10px;
    }

    /* New greeting header mobile */
    .greeting-title {
        font-size: clamp(28px, 8vw, 42px);
    }

    .delivery-info {
        font-size: 16px;
    }

    /* Timeline Progress mobile */
    .timeline-progress {
        flex-direction: column;
        gap: 0;
        padding: 0 20px;
        align-items: center;
        max-width: 100%;
        width: 100%;
    }

    .timeline-progress::before {
        display: none;
    }

    .timeline-step:not(:last-child)::after {
        display: block;
    }

    .timeline-step {
        position: relative;
        padding-bottom: 12px;
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: center;
        gap: 20px;
        width: 100%;
        max-width: 350px;
    }

    /* Línea horizontal conectora en mobile - centrada al círculo */
    .timeline-step:not(:last-child)::after {
        content: '';
        position: absolute;
        left: 30px;
        top: 30px;
        width: 3px;
        height: calc(130% - 30px);
        background: #e5e7eb;
        z-index: 0;
    }

    .timeline-step.completed:not(:last-child)::after {
        background: var(--color-success);
    }

    .timeline-step:not(:last-child)::before {
        display: none;
    }

    .timeline-circle {
        width: 60px;
        height: 60px;
        min-width: 60px;
        font-size: 22px;
        border-width: 4px;
        border-color: #e5e7eb;
        color: var(--color-gray-medium);
        position: relative;
        z-index: 1;
    }

    .timeline-step.completed .timeline-circle {
        border-color: var(--color-success);
        color: var(--color-success);
    }

    .timeline-step.current .timeline-circle {
        border-color: var(--color-info);
        color: var(--color-info);
    }

    .timeline-label {
        font-size: 15px;
        max-width: none;
        flex: 1;
        text-align: left;
        line-height: 1.3;
    }

    .timeline-step.pending .timeline-label {
        color: var(--color-gray-medium);
    }

    .timeline-step.completed .timeline-label {
        color: var(--color-success);
    }

    .timeline-step.current .timeline-label {
        color: var(--color-info);
        font-weight: 700;
    }

    /* Order summary mobile */
    .summary-row {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

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

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