/* Cerca Account & Reorder UI Styles */
.cerca-reorder-container {
    max-width: 860px;
    margin: 30px auto;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #1a1a1a;
}

/* Card Container */
.cerca-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.cerca-card-header {
    text-align: center;
    margin-bottom: 24px;
}

.cerca-card-header h2 {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 8px;
    color: #0f172a;
}

.cerca-card-header p {
    font-size: 14px;
    color: #64748b;
    margin: 0;
}

/* Forms & Inputs */
.cerca-form-group {
    margin-bottom: 20px;
}

.cerca-form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 6px;
}

.cerca-input {
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.cerca-input:focus {
    outline: none;
    border-color: #2d6a4f;
    box-shadow: 0 0 0 3px rgba(45, 106, 79, 0.15);
}

/* OTP Code Box */
.cerca-otp-inputs {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin: 20px 0;
}

.cerca-otp-digit {
    width: 48px;
    height: 56px;
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    border: 1.5px solid #cbd5e1;
    border-radius: 10px;
}

/* Buttons */
.cerca-btn {
    display: inline-block;
    width: 100%;
    padding: 13px 20px;
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    background-color: #2d6a4f;
    color: #ffffff;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.cerca-btn:hover {
    background-color: #1b4332;
}

.cerca-btn-secondary {
    background-color: #f1f5f9 !important;
    color: #475569 !important;
}

.cerca-btn-secondary:hover {
    background-color: #e2e8f0 !important;
    color: #0f172a !important;
}

.cerca-btn-sm {
    width: auto;
    padding: 8px 16px;
    font-size: 13px;
}

/* Orders List */
.cerca-orders-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e2e8f0;
}

.cerca-user-info {
    font-size: 14px;
    color: #64748b;
}

.cerca-user-email {
    font-weight: 600;
    color: #0f172a;
}

.cerca-order-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform, box-shadow;
}

.cerca-order-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 20px -8px rgba(0, 0, 0, 0.08);
    border-color: #cbd5e1;
}

.cerca-order-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px dashed #e2e8f0;
}

.cerca-order-header-info {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;
}

.cerca-order-header-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.cerca-order-number {
    font-weight: 700;
    font-size: 16px;
    color: #0f172a;
    text-decoration: underline;
}

.cerca-order-date {
    font-size: 13px;
    color: #64748b;
}

.cerca-order-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.cerca-line-item {
    display: flex;
    align-items: center;
    gap: 14px;
}

.cerca-item-img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 8px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.cerca-item-details {
    flex: 1;
}

.cerca-item-title {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
}

.cerca-item-meta {
    font-size: 12px;
    color: #64748b;
}

.cerca-item-price {
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
}

.cerca-order-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    border-top: 1px dashed #e2e8f0;
    margin-top: 16px;
    gap: 16px;
}

.cerca-order-summary {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cerca-order-item-count {
    font-size: 13px;
    color: #64748b;
}

.cerca-order-total {
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
}

.cerca-order-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

/* Modal Overlay & Dialog */
.cerca-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 99990;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: cerca-fade-in 0.2s ease-out forwards;
}

.cerca-modal-overlay.cerca-modal-closing {
    animation: cerca-fade-out 0.2s ease-in forwards;
}

.cerca-modal-content {
    background: #ffffff;
    border-radius: 18px;
    max-width: 520px;
    width: 100%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    animation: cerca-modal-slide-in 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.cerca-modal-overlay.cerca-modal-closing .cerca-modal-content {
    animation: cerca-modal-slide-out 0.2s ease-in forwards;
}

@keyframes cerca-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes cerca-fade-out {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes cerca-modal-slide-in {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes cerca-modal-slide-out {
    from {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
    to {
        opacity: 0;
        transform: scale(0.95) translateY(15px);
    }
}

.cerca-modal-close {
    position: absolute;
    top: 18px;
    right: 18px;
    background: #2d6a4f !important;
    color: #ffffff !important;
    border: none !important;
    width: 30px !important;
    height: 30px !important;
    border-radius: 50% !important;
    font-size: 20px !important;
    line-height: 1 !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s cubic-bezier(0.4, 0, 0.2, 1), transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 99995;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
    padding: 0 !important;
}

.cerca-modal-close:hover {
    background-color: #1b4332 !important;
    color: #ffffff !important;
    transform: scale(1.1);
}

.cerca-modal-body {
    overflow-y: auto;
    flex: 1;
    padding: 20px 24px;
}

.cerca-modal-footer {
    padding: 16px 24px 20px;
    border-top: 1px solid #f1f5f9;
    background: #ffffff;
    border-bottom-left-radius: 18px;
    border-bottom-right-radius: 18px;
}

.cerca-modal-wide {
    max-width: 680px;
}

.cerca-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 16px;
}

@media (max-width: 600px) {
    .cerca-detail-grid {
        grid-template-columns: 1fr;
    }
    .cerca-order-bottom {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
    }
    .cerca-order-summary {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    .cerca-order-actions {
        width: 100%;
        justify-content: space-between;
    }
}

@media (max-width: 480px) {
    .cerca-order-actions {
        width: 100%;
        justify-content: space-between;
        gap: 8px;
    }
    .cerca-order-actions button {
        flex: 1;
        text-align: center;
        padding: 10px 16px !important;
    }
}

.cerca-address-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 14px 16px;
    font-size: 13px;
    line-height: 1.5;
    color: #334155;
}

.cerca-address-card h4 {
    margin: 0 0 6px;
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
}

.cerca-summary-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 14px 16px;
    margin-top: 16px;
}

.cerca-summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: #475569;
    margin-bottom: 6px;
}

.cerca-summary-row.total {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    border-top: 1px solid #e2e8f0;
    padding-top: 8px;
    margin-bottom: 0;
}

.cerca-modal-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
    padding: 20px 48px 16px 24px;
    color: #0f172a;
    border-bottom: 1px solid #f1f5f9;
}

.cerca-status-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
}

.cerca-status-available {
    background: #dcfce7;
    color: #166534;
}

.cerca-status-out-of-stock {
    background: #fef3c7;
    color: #92400e;
}

.cerca-status-unavailable {
    background: #fee2e2;
    color: #991b1b;
}

.cerca-status-fulfilled, .cerca-status-shipped {
    background: #e0f2fe;
    color: #0369a1;
}

.cerca-status-unfulfilled {
    background: #f1f5f9;
    color: #475569;
}

.cerca-status-partial {
    background: #fef3c7;
    color: #92400e;
}

.cerca-status-restocked {
    background: #e0e7ff;
    color: #4338ca;
}

.cerca-alert {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 16px;
}

.cerca-alert-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.cerca-alert-info {
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

.cerca-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e2e8f0;
    border-top-color: #2d6a4f;
    border-radius: 50%;
    animation: cerca-spin 0.8s linear infinite;
    margin: 20px auto;
}

@keyframes cerca-spin {
    to { transform: rotate(360deg); }
}

/* Preview Cart Tabs */
.cerca-preview-tabs {
    display: flex;
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 16px;
}

.cerca-tab-btn {
    flex: 1;
    padding: 12px 8px;
    background: none !important;
    border: none !important;
    border-bottom: 2px solid transparent !important;
    margin-bottom: -2px;
    font-weight: 600;
    color: #64748b !important;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    border-radius: 0 !important;
    box-shadow: none !important;
}

.cerca-tab-btn.active {
    border-bottom-color: #2d6a4f !important;
    color: #2d6a4f !important;
    font-weight: 700;
}

.cerca-tab-btn:hover:not(.active) {
    color: #334155 !important;
}

body.cerca-modal-open {
    overflow: hidden !important;
}

/* Numeric Pagination styling */
.cerca-pagination-numbers {
    display: flex;
    gap: 6px;
    align-items: center;
}

.cerca-page-num {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 36px !important;
    height: 36px !important;
    border-radius: 50% !important;
    background: #f1f5f9 !important;
    color: #475569 !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    border: none !important;
    cursor: pointer !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: none !important;
    padding: 0 !important;
}

.cerca-page-num:hover:not(.active) {
    background: #e2e8f0 !important;
    color: #0f172a !important;
}

.cerca-page-num.active {
    background: #2d6a4f !important;
    color: #ffffff !important;
    font-weight: 700 !important;
}
