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

:root {
    --primary-orange: #FF6B35;
    --saffron: #FF9933;
    --gold: #FFD700;
    --dark-orange: #E85A2A;
    --light-orange: #FFF5F0;
    --text-white: #FFFFFF;
    --text-dark: #1A1A1A;
    --text-gray: #6B7280;
    --text-light: #9CA3AF;
    --border-light: #E5E7EB;
    --bg-white: #FFFFFF;
    --bg-gray: #F9FAFB;
    --error-color: #EF4444;
    --success-color: #10B981;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #FFF5F0 0%, #FFE8E0 50%, #FFF5F0 100%);
    min-height: 100vh;
    color: var(--text-dark);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.checkout-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Top Header */
.top-header {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-light);
    padding: 16px 24px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.logo-mini {
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 1400px;
    margin: 0 auto;
}

.logo-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: var(--shadow-md);
}

.logo-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.logo-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
}

/* Main Container */
.checkout-container {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 24px;
    gap: 40px;
    align-items: start;
}

/* Product Section */
.product-section {
    position: sticky;
    top: 80px;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.product-image-wrapper {
    position: relative;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    background: var(--bg-white);
    padding: 8px;
}

.product-image {
    width: 100%;
    height: auto;
    border-radius: 20px;
    display: block;
    object-fit: cover;
}

.product-badge {
    position: absolute;
    top: 24px;
    right: 24px;
    background: linear-gradient(135deg, var(--primary-orange), var(--dark-orange));
    color: var(--text-white);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: var(--shadow-lg);
}

.product-info {
    background: var(--bg-white);
    padding: 32px;
    border-radius: 20px;
    box-shadow: var(--shadow-md);
}

.product-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 12px;
    line-height: 1.2;
}

.product-subtitle {
    font-size: 16px;
    color: var(--text-gray);
    margin-bottom: 24px;
    line-height: 1.6;
}

.product-features {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 15px;
    color: var(--text-dark);
}

.feature-icon {
    font-size: 20px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--light-orange);
    border-radius: 10px;
}

/* Checkout Section */
.checkout-section {
    display: flex;
    flex-direction: column;
}

.checkout-card {
    background: var(--bg-white);
    border-radius: 24px;
    padding: 40px;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-light);
}

.card-header {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-light);
}

.checkout-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.checkout-subtitle {
    font-size: 15px;
    color: var(--text-gray);
}

/* Form Styles */
.checkout-form {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.form-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.section-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

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

.form-group label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-dark);
}

.required {
    color: var(--error-color);
    margin-left: 2px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border-light);
    border-radius: 12px;
    font-size: 15px;
    font-family: inherit;
    background: var(--bg-white);
    color: var(--text-dark);
    transition: all 0.2s ease;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

.form-group select {
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%236B7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
    cursor: pointer;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-orange);
    box-shadow: 0 0 0 4px rgba(255, 107, 53, 0.1);
    background: var(--bg-white);
}

.form-group select:focus {
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%23FF6B35' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-light);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
}

/* Quantity Section */
.quantity-section {
    background: var(--bg-gray);
    padding: 24px;
    border-radius: 16px;
    border: 2px solid var(--border-light);
}

.quantity-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: start;
}

/* Product Image in Quantity Section */
.quantity-product-image-mobile {
    display: block;
}

.product-image-mobile {
    width: 100%;
    height: auto;
    border-radius: 12px;
    object-fit: cover;
    object-position: top;
    max-height: 100px;
}

.quantity-controls-wrapper {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 0;
    background: var(--bg-white);
    border: 2px solid var(--border-light);
    border-radius: 12px;
    overflow: hidden;
}

.qty-btn {
    background: var(--bg-white);
    border: none;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-dark);
}

.qty-btn:hover {
    background: var(--light-orange);
    color: var(--primary-orange);
}

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

.qty-btn svg {
    transition: transform 0.2s ease;
}

.qty-btn:active svg {
    transform: scale(0.9);
}

.quantity-controls input {
    width: 80px;
    text-align: center;
    border: none;
    border-left: 1px solid var(--border-light);
    border-right: 1px solid var(--border-light);
    padding: 14px 8px;
    font-size: 18px;
    font-weight: 600;
    background: var(--bg-white);
    color: var(--text-dark);
}

.quantity-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.unit-price {
    font-size: 14px;
    color: var(--text-gray);
    font-weight: 500;
}

/* Order Summary */
.order-summary-card {
    background: linear-gradient(135deg, var(--light-orange) 0%, #FFF8F5 100%);
    border: 2px solid rgba(255, 107, 53, 0.2);
    border-radius: 16px;
    padding: 24px;
    margin-top: 8px;
}

.summary-header {
    margin-bottom: 20px;
}

.summary-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.summary-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    font-size: 15px;
    color: var(--text-gray);
}

#freeShippingRow {
    display: flex;
    justify-content: space-between;
    font-size: 15px;
    color: var(--text-gray);
}

.summary-divider {
    height: 1px;
    background: rgba(255, 107, 53, 0.2);
    margin: 8px 0;
}

.summary-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    margin-top: 4px;
}

.summary-total span:first-child {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-dark);
}

.total-amount {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-orange);
}

/* Payment Button */
.payment-button {
    width: 100%;
    background: linear-gradient(135deg, var(--primary-orange) 0%, var(--dark-orange) 100%);
    color: var(--text-white);
    border: none;
    padding: 18px 32px;
    border-radius: 14px;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 14px rgba(255, 107, 53, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 8px;
    position: relative;
    overflow: hidden;
}

.payment-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.payment-button:hover::before {
    left: 100%;
}

.payment-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.5);
}

.payment-button:active {
    transform: translateY(0);
}

.payment-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.payment-text {
    font-size: 17px;
    font-weight: 600;
}

.payment-arrow {
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.payment-button:hover .payment-arrow {
    transform: translateX(4px);
}

.security-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-gray);
    margin-top: 16px;
    text-align: center;
}

.security-note svg {
    color: var(--success-color);
    flex-shrink: 0;
}

/* Error States */
.field-error {
    color: var(--error-color);
    font-size: 12px;
    margin-top: 4px;
    display: block;
}

.form-group input:invalid:not(:placeholder-shown),
.form-group textarea:invalid:not(:placeholder-shown),
.form-group select:invalid {
    border-color: var(--error-color);
}

.form-group input:valid:not(:placeholder-shown),
.form-group textarea:valid:not(:placeholder-shown),
.form-group select:valid:not([value=""]) {
    border-color: var(--success-color);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .checkout-container {
        grid-template-columns: 1fr;
        gap: 32px;
        padding: 24px 16px;
    }

    .product-section {
        position: static;
        order: 2; /* Move to bottom on mobile */
    }

    .checkout-section {
        order: 1; /* Move to top on mobile */
    }

    .product-image-wrapper {
        max-width: 500px;
        margin: 0 auto;
    }

    .checkout-card {
        padding: 32px 24px;
    }
}

@media (max-width: 768px) {
    .checkout-container {
        padding: 16px;
        gap: 24px;
    }

    .top-header {
        padding: 12px 16px;
    }

    .checkout-card {
        padding: 24px 20px;
        border-radius: 20px;
    }

    .product-info {
        padding: 24px 20px;
    }

    .product-title {
        font-size: 24px;
    }

    .checkout-title {
        font-size: 24px;
    }

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

    /* Mobile: 2-column layout for quantity section */
    .quantity-selector {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 16px;
        align-items: start;
    }

    .quantity-product-image-mobile {
        display: block;
    }

    .quantity-controls-wrapper {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .quantity-info {
        align-items: flex-start;
    }

    .payment-button {
        padding: 16px 24px;
    }


    .total-amount {
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    .product-image-wrapper {
        border-radius: 16px;
    }

    .product-badge {
        top: 16px;
        right: 16px;
        padding: 6px 12px;
        font-size: 11px;
    }

    .checkout-card {
        padding: 20px 16px;
    }

    .product-info {
        padding: 20px 16px;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.checkout-card,
.product-section {
    animation: fadeIn 0.5s ease-out;
}

/* Loading State */
.payment-button.loading {
    pointer-events: none;
}

.payment-button.loading .payment-arrow {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}
