/* ========================================
   CHECKOUT PAGE STYLES - MOBILE FIRST
   ======================================== */

:root {
    --primary-color: #282056;
    --accent-color: #ef3093;
    --success-color: #4caf50;
    --error-color: #f44336;
    --border-color: #e0e0e0;
    --bg-light: #f8f9fa;
}

/* Checkout Page Container */
.checkout-page {
    background: var(--bg-light);
    padding: 20px 0 40px;
    min-height: 70vh;
}

/* ========================================
   CHECKOUT PROGRESS (HEADER)
   ======================================== */

.checkout-progress-header {
    display: none; /* Hidden on mobile */
    align-items: center;
    gap: 10px;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    opacity: 0.5;
    transition: opacity 0.3s;
}

.progress-step.active {
    opacity: 1;
}

.progress-step i {
    font-size: 20px;
    color: var(--primary-color);
}

.progress-step span {
    font-size: 12px;
    font-weight: 600;
    color: var(--primary-color);
}

.progress-line {
    width: 40px;
    height: 2px;
    background: var(--border-color);
}

.secure-badge {
    display: none; /* Hidden on mobile */
    align-items: center;
    gap: 8px;
    color: var(--success-color);
    font-size: 14px;
    font-weight: 600;
}

.secure-badge i {
    font-size: 16px;
}

/* ========================================
   MOBILE PROGRESS BAR
   ======================================== */

.mobile-progress {
    background: white;
    padding: 15px 20px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.progress-bar-container {
    width: 100%;
    height: 8px;
    background: var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    transition: width 0.3s ease;
    border-radius: 10px;
}

.progress-text {
    text-align: center;
    font-size: 14px;
    color: #666;
    margin: 0;
}

.progress-text span {
    font-weight: 700;
    color: var(--primary-color);
}

/* ========================================
   CHECKOUT LAYOUT
   ======================================== */

.checkout-content {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.checkout-main {
    flex: 1;
}

.checkout-sidebar {
    width: 100%;
}

/* ========================================
   CHECKOUT SECTIONS
   ======================================== */

.checkout-section {
    background: white;
    border-radius: 12px;
    padding: 25px 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    display: none;
}

.checkout-section.active {
    display: block;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
}

.section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.4rem;
    color: var(--primary-color);
    margin: 0;
}

.step-number {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    flex-shrink: 0;
}

.section-subtitle {
    color: #666;
    font-size: 14px;
    margin: 8px 0 0 44px;
}

.btn-edit {
    background: transparent;
    border: 2px solid var(--border-color);
    padding: 8px 16px;
    border-radius: 8px;
    color: var(--primary-color);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
}

.btn-edit:active {
    background: var(--bg-light);
}

/* ========================================
   FORMS
   ======================================== */

.checkout-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-row {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group.full-width {
    width: 100%;
}

.form-group label {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 14px;
}

.form-group input,
.form-group select {
    padding: 14px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent-color);
}

.form-hint {
    color: #999;
    font-size: 12px;
    margin-top: -4px;
}

/* Checkbox */
.form-checkbox {
    margin: 10px 0;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-size: 15px;
    user-select: none;
}

.checkbox-label input {
    position: absolute;
    opacity: 0;
}

.checkbox-label .checkmark {
    width: 22px;
    height: 22px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    flex-shrink: 0;
    transition: all 0.3s;
    position: relative;
}

.checkbox-label input:checked ~ .checkmark {
    background: var(--accent-color);
    border-color: var(--accent-color);
}

.checkbox-label .checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 6px;
    top: 2px;
    width: 6px;
    height: 11px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-label input:checked ~ .checkmark:after {
    display: block;
}

/* Form Actions */
.form-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
}

.btn-back,
.btn-next,
.btn-place-order {
    padding: 16px 24px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s;
}

.btn-back {
    background: white;
    color: var(--primary-color);
    border: 2px solid var(--border-color);
}

.btn-back:active {
    background: var(--bg-light);
}

.btn-next,
.btn-place-order {
    background: linear-gradient(135deg, var(--accent-color), var(--primary-color));
    color: white;
}

.btn-next:active,
.btn-place-order:active {
    transform: scale(0.98);
}

/* ========================================
   PAYMENT METHODS
   ======================================== */

.shipping-loading {
    text-align: center;
    padding: 40px 20px;
    display: none;
}

.shipping-loading.active {
    display: block;
}

.shipping-loading .spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.shipping-loading p {
    color: #666;
    font-size: 15px;
}

.shipping-methods {
    display: none;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 25px;
}

.shipping-methods.active {
    display: flex;
}

.shipping-method {
    cursor: pointer;
    user-select: none;
}

.shipping-method input {
    display: none;
}

.shipping-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 18px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    transition: all 0.3s;
}

.shipping-method input:checked + .shipping-option {
    border-color: var(--accent-color);
    background: rgba(239, 48, 147, 0.05);
}

.shipping-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.shipping-name {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 16px;
}

.shipping-time {
    color: #666;
    font-size: 13px;
}

.shipping-cost {
    font-size: 18px;
    font-weight: 700;
    color: var(--accent-color);
    flex-shrink: 0;
}

.shipping-cost.free {
    color: var(--success-color);
}

.payment-methods {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 25px;
}

.payment-method {
    cursor: pointer;
    user-select: none;
}

.payment-method input {
    display: none;
}

.payment-option {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 16px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    transition: all 0.3s;
}

.payment-method input:checked + .payment-option {
    border-color: var(--accent-color);
    background: rgba(239, 48, 147, 0.05);
}

.payment-icon {
    width: 45px;
    height: 45px;
    background: var(--bg-light);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--primary-color);
    flex-shrink: 0;
}

.payment-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.payment-details strong {
    color: var(--primary-color);
    font-size: 15px;
}

.payment-details small {
    color: #999;
    font-size: 13px;
}

/* ========================================
   ORDER SUMMARY
   ======================================== */

.order-summary {
    background: white;
    border-radius: 12px;
    padding: 25px 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 100px;
}

.summary-title {
    font-size: 1.3rem;
    color: var(--primary-color);
    margin: 0 0 20px 0;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
}

/* Summary Items */
.summary-items {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
    max-height: 300px;
    overflow-y: auto;
}

.summary-item {
    display: flex;
    gap: 15px;
}

.summary-item-image {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

.summary-item-details {
    flex: 1;
}

.summary-item-name {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 14px;
    margin-bottom: 5px;
}

.summary-item-specs {
    font-size: 12px;
    color: #999;
    margin-bottom: 5px;
}

.summary-item-price {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
}

.summary-item-quantity {
    color: #666;
}

.summary-item-total {
    font-weight: 700;
    color: var(--accent-color);
}

/* Coupon Section */
.coupon-section {
    margin: 20px 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    padding: 15px 0;
}

.coupon-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 15px;
}

.coupon-toggle i:first-child {
    color: var(--accent-color);
}

.coupon-toggle i:last-child {
    margin-left: auto;
    transition: transform 0.3s;
}

.coupon-toggle.active i:last-child {
    transform: rotate(180deg);
}

.coupon-form {
    display: none;
    margin-top: 15px;
    gap: 10px;
}

.coupon-form.active {
    display: flex;
}

.coupon-form input {
    flex: 1;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 15px;
}

.btn-apply-coupon {
    padding: 12px 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-apply-coupon:active {
    background: var(--accent-color);
}

/* Price Breakdown */
.summary-breakdown {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 20px 0;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 15px;
}

.summary-row span:first-child {
    color: #666;
}

.summary-row span:last-child {
    font-weight: 600;
    color: var(--primary-color);
}

.discount-row span:last-child {
    color: var(--success-color);
}

/* Total */
.summary-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-top: 2px solid var(--border-color);
    font-size: 1.3rem;
    font-weight: 700;
}

.summary-total span:first-child {
    color: var(--primary-color);
}

.summary-total span:last-child {
    color: var(--accent-color);
}

/* Trust Badges */
.trust-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.trust-badge {
    flex: 1;
    min-width: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 10px;
    background: var(--bg-light);
    border-radius: 8px;
}

.trust-badge i {
    font-size: 20px;
    color: var(--success-color);
}

.trust-badge span {
    font-size: 11px;
    text-align: center;
    color: #666;
    font-weight: 600;
}

/* ========================================
   CHECKOUT FOOTER
   ======================================== */

.checkout-footer {
    background: var(--primary-color);
    color: white;
    padding: 30px 0;
    margin-top: 40px;
}

.checkout-footer .footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    text-align: center;
}

.checkout-footer .footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
}

.checkout-footer .footer-links a {
    color: white;
    text-decoration: none;
    font-size: 14px;
    opacity: 0.8;
    transition: opacity 0.3s;
}

.checkout-footer .footer-links a:hover {
    opacity: 1;
}

/* ========================================
   RESPONSIVE - TABLET (768px+)
   ======================================== */

@media (min-width: 768px) {
    .checkout-page {
        padding: 40px 0 60px;
    }

    .mobile-progress {
        display: none;
    }

    .checkout-progress-header,
    .secure-badge {
        display: flex;
    }

    .checkout-section {
        padding: 35px 30px;
    }

    .section-title {
        font-size: 1.6rem;
    }

    .form-row {
        flex-direction: row;
    }

    .form-group {
        flex: 1;
    }

    .form-actions {
        flex-direction: row;
        justify-content: space-between;
    }

    .btn-back,
    .btn-next,
    .btn-place-order {
        flex: 1;
        max-width: 250px;
    }

    .btn-next,
    .btn-place-order {
        margin-left: auto;
    }

    .checkout-footer .footer-content {
        flex-direction: row;
        justify-content: space-between;
    }
}

/* ========================================
   RESPONSIVE - DESKTOP (1024px+)
   ======================================== */

@media (min-width: 1024px) {
    .checkout-content {
        flex-direction: row;
        align-items: flex-start;
    }

    .checkout-main {
        flex: 1;
        max-width: 700px;
    }

    .checkout-sidebar {
        width: 400px;
        flex-shrink: 0;
    }

    .trust-badges {
        flex-direction: column;
    }

    .trust-badge {
        flex-direction: row;
        justify-content: flex-start;
        text-align: left;
    }

    .trust-badge span {
        text-align: left;
    }
}

/* ========================================
   UTILITIES
   ======================================== */

.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}