/* order.css - Modern Redesign */

/* 1. Main Process Container */
.order-process {
    max-width: 1100px;
    margin: 2rem auto;
    width: 100%;
    background-color: white;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.02);
}

/* 2. Step Indicator */
.steps-indicator {
    display: flex;
    justify-content: space-between;
    background-color: #ffffff;
    padding: 1.5rem 15%; /* Increased side padding for better centering */
    border-bottom: 1px solid rgba(0,0,0,0.04);
    position: relative;
}

.steps-indicator::before {
    content: '';
    position: absolute;
    top: 1.5rem;
    margin-top: 20px; /* Half of step-number height (40px) */
    left: 15%;
    right: 15%;
    height: 2px;
    background-color: #e5e7eb;
    z-index: 1;
    transform: translateY(-50%);
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    z-index: 2;
    color: var(--gray);
    min-width: 100px; /* Prevents title from wrapping too tightly */
}

.step-number {
    width: 40px; /* Larger, more prominent circle */
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    background-color: white;
    border: 2px solid #e5e7eb;
    color: #9ca3af;
    transition: var(--transition);
    margin-bottom: 0.5rem; /* More breathing room between number and text */
    z-index: 2;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.step-title {
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #9ca3af;
    transition: color 0.3s ease;
}

.step.active .step-number,
.step.completed .step-number {
    background-color: var(--primary);
    border-color: var(--primary);
    color: white;
    box-shadow: 0 4px 15px rgba(17, 24, 39, 0.3);
    transform: translateY(-2px);
}

.step.active .step-title {
    color: var(--primary);
    font-weight: 600;
}

.step.completed .step-number {
    background-color: var(--success);
    border-color: var(--success);
}

/* 3. Step Content */
.step-content {
    display: none;
    padding: 2rem;
}

.step-content.active {
    display: block;
}

.step-content h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--dark);
    text-align: center;
}

/* 4. Cart Layout (Step 1) */
.cart-layout {
    display: grid;
    grid-template-columns: 1.8fr 1fr;
    gap: 1.5rem;
    align-items: flex-start;
}

.cart-items {
    display: flex;
    flex-direction: column;
    gap: 0; /* Removing gap to use border separators */
}

.cart-summary {
    background-color: #f9fafb;
    padding: 1.5rem;
    border-radius: 20px;
    border: 1px solid rgba(0,0,0,0.03);
    box-shadow: 0 10px 30px rgba(0,0,0,0.03);
    position: sticky;
    top: 2rem;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    font-size: 1rem;
}

.summary-row.total {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--dark);
    border-top: 1px solid var(--light-gray);
    padding-top: 1rem;
    margin-top: 1rem;
}

.cart-summary .btn {
    width: 100%;
    margin-top: 1rem;
}

/* Styles for Individual Cart Items */
.cart-item {
    display: grid;
    grid-template-columns: 80px 1fr auto;
    align-items: center;
    gap: 1rem;
    padding: 1rem 0;
    border: none;
    border-bottom: 1px solid #f3f4f6;
    transition: transform 0.2s ease;
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item-image img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.cart-item-image-link {
    display: block; /* Ensures the link takes up the space */
}

.cart-item-info h4 a {
    text-decoration: none;
    color: inherit; /* Inherits the color from the h4 tag */
    transition: var(--transition);
}
.cart-item-info h4 a:hover {
    color: var(--primary);
}

.cart-item-info h4 {
    margin: 0 0 0.25rem;
    font-size: 1.1rem;
    /* Prevent long text (like links) from breaking the layout */
    overflow-wrap: break-word;
    word-break: break-word;
}

.cart-item-details {
    font-size: 0.9rem;
    color: var(--gray);
    margin-bottom: 0.5rem;
}

.cart-item-price {
    font-weight: 600;
}

.cart-item-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 1rem;
}

.quantity-control {
    display: flex;
    align-items: center;
    border: 1px solid #e5e7eb;
    background-color: white;
    border-radius: 50px; /* Pill shape */
    padding: 2px;
}

.quantity-control button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: var(--dark);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.quantity-control button:hover {
    background-color: #f3f4f6;
    color: black;
}

.quantity-control span {
    font-weight: 600;
    padding: 0 0.5rem;
}

.remove-item {
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    font-size: 1rem;
    padding: 8px;
    border-radius: 50%;
    transition: var(--transition);
}

.remove-item:hover {
    background-color: #fee2e2;
    color: #ef4444;
}

/* 5. Shipping Form (Step 2) */
.order-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-description {
    text-align: center;
    color: #6b7280;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    background: transparent;
    padding: 0;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

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

.form-group label {
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: #374151;
}

.form-group input,
.form-group select {
    padding: 0.6rem 0.8rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background-color: #ffffff;
    font-size: 0.95rem;
    font-family: inherit;
    color: #1f2937;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.1);
}

.form-group input::placeholder {
    color: #9ca3af;
}

.payment-notice {
    display: flex;
    align-items: center;
    gap: 1rem;
    background-color: #f9fafb;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.notice-icon {
    font-size: 1.5rem;
    color: var(--primary);
}

.notice-content h4 {
    margin: 0 0 0.25rem;
    color: var(--dark);
}

.notice-content p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--gray);
}

.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
}

.form-actions .btn {
    min-width: 200px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* 6. Confirmation (Step 3) */
.confirmation {
    text-align: center;
    padding: 1rem 0;
}

.confirmation-icon {
    font-size: 4rem;
    color: var(--success);
    margin-bottom: 0.5rem;
}

.confirmation h2 {
    margin-bottom: 0.5rem;
}

.confirmation p {
    color: var(--gray);
    margin-bottom: 1.5rem;
}

.order-details {
    background: var(--light);
    border-radius: 8px;
    padding: 1rem;
    text-align: left;
    margin-bottom: 1.5rem;
}

.confirmation-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
}
.confirmation-actions .btn.loading {
    cursor: not-allowed;
    background-color: var(--gray);
    border-color: var(--gray);
}

/* 7. Responsive Design */
@media (max-width: 768px) {
    .order-process {
        margin: 1rem 0.5rem;
        width: auto;
    }

    .cart-layout {
        grid-template-columns: 1fr;
    }
    .form-row {
        grid-template-columns: 1fr;
    }
    .step-content {
        padding: 1.5rem 1rem;
    }
    .steps-indicator {
        padding: 1.5rem 0.5rem;
    }
    .steps-indicator::before {
        left: 0.5rem;
        right: 0.5rem;
        margin-top: 16px; /* Half of step-number height (32px) */
    }
    .step-number {
        width: 32px; /* Make step numbers smaller */
        height: 32px;
        font-size: 1rem;
    }
    .step-title {
        font-size: 0.8rem; /* Make title font smaller */
        font-weight: 600;
    }

    /* Responsive styles for individual cart items on mobile */
    .cart-item {
        /* Switch to a more complex grid for better control on mobile */
        grid-template-columns: 80px 1fr; /* Image column, content column */
        grid-template-rows: auto auto;    /* Two rows for content */
        gap: 0.1rem 1rem; /* Reduce gap for mobile */
        padding: 1.5rem 0;
        border: none;
        border-bottom: 1px solid #f3f4f6;
    }

    .cart-item-image {
        /* Make the image span both rows vertically */
        grid-row: 1 / 3;
    }

    .cart-item-info {
        /* Ensure info stays in its designated area */
        grid-column: 2;
        grid-row: 1;
    }

    .cart-item-actions {
        grid-column: 2;
        grid-row: 2;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        width: 100%;
    }

    .cart-summary {
        position: static;
        margin-top: 1rem;
    }
}

@media (max-width: 640px) {
    .form-actions {
        gap: 1rem;
    }

    .form-actions .btn {
        min-width: 0;
        flex: 1;
    }
}