/* ==========================================================================
   📱 FULL PROFILE PAGE CSS (WITH RIGHT SIDEBAR & MOBILE RESPONSIVENESS)
   ========================================================================== */

/* --- Page Layout --- */
.order-history-page {
  background-color: #f4f7f8;
  min-height: 100vh;
  padding: 40px 20px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #1a1a1a;
  box-sizing: border-box;
  width: 100%;
  overflow-x: hidden;
}

.profile-page-container {
    background-color: #f8f8f8;
    padding: 20px 40px;
    box-sizing: border-box;
}

.dashboard-layout {
    display: flex;
    flex-direction: row-reverse; /* Places sidebar on the right side */
    gap: 40px;
    margin-top: 30px;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0; /* Prevents flex items from overflowing */
}

/* --- Content Header & Sort --- */
.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.content-header h1{
    font-size: 24px;
}


.sort-select {
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    background: #fff;
    font-size: 14px;
    color: #374151;
    cursor: pointer;
}

/* --- Order Item Card --- */
.order-item-card {
    background: #fff;
    border-radius: 18px;
    padding: 20px;
    display: flex;
    gap: 20px;
    border: 1px solid #eff2f4;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02);
}

.product-visual img {
    width: 120px;
    height: 120px;
    border-radius: 12px;
    object-fit: cover;
}

.product-meta {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.meta-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.order-header-line {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 5px;
}

.order-id {
    font-weight: 700;
    color: #94a3b8;
    letter-spacing: 0.5px;
}

/* Status Pill Variations */
.status-pill {
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

/* Specific colors for each status */
.status-pill.placed { background-color: #fef3c7; color: #92400e; }
.status-pill.processing { background-color: #dbeafe; color: #1e40af; }
.status-pill.shipped { background-color: #e0f2fe; color: #0369a1; }
.status-pill.out-of-delivery { background-color: #fef9c3; color: #854d0e; }
.status-pill.delivered { background-color: #dcfce7; color: #166534; }
.status-pill.cancelled { background-color: #edb9b9; color: #ff0101; }
.status-pill.failed { background-color: #e78585; color: #ff1010; }

.product-title {
    margin: 5px 0;
    font-size: 16px;
    color: #111827;
}

.purchase-date {
    font-size: 13px;
    color: #6b7280;
}

.price-display {
    font-weight: 700;
    font-size: 18px;
    color: #111827;
}

/* --- Footer & Actions --- */
.separator {
    border: none;
    border-top: 1px solid #f3f4f6;
    margin: 15px 0;
}

.action-link {
    background-color: #c42e2e;
    border-radius: 24px;
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 600;
    color: #eff4ff;
    text-decoration: none;
    transition: background-color 0.2s;
    display: inline-block;
    text-align: center;
}

.action-link:hover {
    background-color: #e97e1b;
}

/* ==========================================================================
   RESPONSIVE MEDIA QUERIES (ALWAYS SIDE-BY-SIDE + COMPACT MOBILE STYLING)
   ========================================================================== */

@media screen and (max-width: 1024px) {
    .profile-wrapper {
        padding: 10px !important;
    }

    /* Force side-by-side row behavior across all device previews */
    .profile-layout {
        display: flex !important;
        flex-direction: row !important;
        gap: 12px !important;
    }

    

    .profile-sidebar {
        flex: 0 0 110px ;
        width: 180px !important;
        padding: 15px 8px ;
        position: sticky ;
        top: 10px ;
    }

    .profile-main {
        flex: 1 !important;
        max-width:100% !important;
        min-width: 0 !important;
    }

    .profile-card {
        padding: 15px;
        border-radius: 12px;
    }

    /* Keep inputs fully readable */
    .form-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .form-grid .input-group:nth-child(1),
    .form-grid .input-group:nth-child(2),
    .form-grid .input-group:nth-child(3),
    .form-grid .input-group:nth-child(4) {
        grid-column: span 1;
    }

    .form-footer {
        grid-column: span 1;
        flex-direction: column;
    }

    .form-footer .btn-outline {
        width: 50%;
        text-align: center;
        justify-content: center;
    }
}

/* ==========================================
   COMPACT FORM & SUMMARY STYLES FOR SMALLER SCREENS
   ========================================== */

@media screen and (max-width: 768px) {
    /* 1. Order Item Card Layout (Compact with Smaller Image) */
    .order-item-card {
        display: flex !important;
        flex-direction: row !important; /* Keeps image and info side-by-side, or change to column if preferred */
        align-items: center !important;
        padding: 10px !important;
        gap: 10px !important;
        border-radius: 6px !important;
    }

    .product-visual {
        flex-shrink: 0 !important;
    }

    .product-visual img {
        width: 70px !important;  /* Make the image smaller width */
        height: 70px !important; /* Make the image smaller height (square thumbnail) */
        object-fit: cover !important;
        border-radius: 6px !important;
    }

    .product-meta {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        gap: 4px !important;
    }

    .meta-top {
        display: flex !important;
        flex-wrap: wrap !important;
        align-items: flex-start !important;
        justify-content: space-between !important;
        gap: 4px !important;
        width: 100% !important;
    }

    .product-title {
        font-size: 12px !important;
        line-height: 1.2 !important;
        margin: 2px 0 !important;
    }

    .status-pill {
        padding: 2px 8px !important;
        border-radius: 12px !important;
        font-size: 9px !important;
        font-weight: 600 !important;
        text-transform: uppercase !important;
        margin-left: auto !important; /* Locked to the far right */
    }

    .price-display {
        font-size: 12px !important;
        font-weight: 700 !important;
        margin-top: 2px !important;
    }

    .order-id, 
    .purchase-date {
        font-size: 9px !important;
    }

    .action-link {
        font-size: 6px !important;
    }

    .content-header h1{
        font-size: 10px;
    }

    .form-footer {
        grid-column: span 1;
        flex-direction: column;
    }

    .form-footer .btn-outline {
        width: 50%;
        text-align: center;
        justify-content: center;
    }
}

/* ==========================================
   EXTRA TIGHT RULES FOR VERY SMALL SCREENS (UNDER 480px)
   ========================================== */

@media screen and (max-width: 480px) {
    .profile-card.profile-details,
    .profile-card.profile-info-summary {
        padding: 12px !important;
    }

    .input-group input, 
    .input-group select {
        padding: 8px 10px !important;
        font-size: 12px !important;
    }

    .content-header h2{
        font-size: 10px;
    }

    .summary-text h2 {
        font-size: 12px !important;
    }

    .user-email-label {
        font-size: 11px !important;
    }
}