/* ============================================
   CHECKOUT PAGE STYLES - SHOPIFY INSPIRED
   ============================================ */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #fafafa;
    color: #2c2c2c;
    line-height: 1.6;
    min-height: 100vh;
}

/* ============================================
   CHECKOUT CONTAINER
   ============================================ */
.checkout-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
}

/* ============================================
   LEFT COLUMN - FORM
   ============================================ */
.checkout-left {
    background-color: #ffffff;
    padding: 24px 80px 80px;
    max-width: 680px;
    margin: 0 auto;
    width: 100%;
}

.checkout-header {
    padding: 24px 0 24px;
    border-bottom: 1px solid #e5e5e5;
    margin-bottom: 32px;
    text-align: center;
}

.trust-badges {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.trust-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #2c2c2c;
    font-weight: 500;
}

.trust-icon {
    width: 20px;
    height: 20px;
    color: #0071e3;
}

.trust-divider {
    width: 1px;
    height: 20px;
    background-color: #d1d1d1;
}

.logo-link {
    display: flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
}

.logo-image {
    height: 60px;
    width: auto;
    display: block;
}

.logo-image:hover {
    opacity: 0.9;
}

/* ============================================
   ORDER SUMMARY - MOBILE (SHOWN ON LEFT)
   ============================================ */
.order-summary-mobile {
    display: block;
    background-color: #fafafa;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    margin-bottom: 32px;
}

.summary-header-mobile {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    cursor: pointer;
    border-bottom: 1px solid #e5e5e5;
}

.summary-title-mobile {
    font-size: 16px;
    font-weight: 600;
    color: #2c2c2c;
}

.summary-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.summary-total {
    font-size: 18px;
    font-weight: 700;
    color: #2c2c2c;
}

.toggle-icon {
    width: 16px;
    height: 16px;
    color: #6a6a6a;
    transition: transform 0.3s;
}

.summary-toggle.active .toggle-icon {
    transform: rotate(180deg);
}

.summary-content-mobile {
    padding: 20px;
    display: block;
}

.summary-content-mobile.collapsed {
    display: none;
}

/* Hide mobile summary on right column */
.checkout-right .order-summary-mobile {
    display: none;
}

/* ============================================
   BREADCRUMB
   ============================================ */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 32px;
    font-size: 13px;
}

.breadcrumb-item {
    color: #999999;
}

.breadcrumb-item.active {
    color: #2c2c2c;
    font-weight: 500;
}

.breadcrumb-separator {
    color: #d1d1d1;
}

/* ============================================
   CHECKOUT SECTIONS
   ============================================ */
.checkout-section {
    margin-bottom: 40px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.section-title {
    font-size: 16px;
    font-weight: 600;
    color: #2c2c2c;
}

.card-icons {
    display: flex;
    gap: 6px;
}

.card-icon {
    height: 24px;
    width: auto;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* ============================================
   FORM ELEMENTS
   ============================================ */
.form-group {
    margin-bottom: 16px;
    position: relative;
}

.form-group.full-width {
    width: 100%;
}

.form-input,
.form-select {
    width: 100%;
    padding: 14px 16px;
    font-size: 14px;
    border: 1px solid #d1d1d1;
    border-radius: 8px;
    background-color: #ffffff;
    color: #2c2c2c;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: #0071e3;
    box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.1);
}

.form-input::placeholder {
    color: #999999;
}

.form-select {
    appearance: none;
    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='%232c2c2c' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
    cursor: pointer;
}

.form-label {
    position: absolute;
    top: -8px;
    left: 12px;
    background-color: #ffffff;
    padding: 0 4px;
    font-size: 12px;
    color: #6a6a6a;
}

/* ============================================
   FORM ROWS
   ============================================ */
.form-row {
    display: grid;
    gap: 16px;
    margin-bottom: 16px;
}

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

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

/* ============================================
   SHIPPING METHOD
   ============================================ */
.shipping-option {
    border: 2px solid #d1d1d1;
    border-radius: 8px;
    padding: 16px;
    cursor: pointer;
    transition: border-color 0.2s;
    background-color: #fafafa;
}

.shipping-option:hover {
    border-color: #0071e3;
}

.shipping-option-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.shipping-radio {
    display: flex;
    align-items: center;
    gap: 12px;
}

.shipping-radio input[type="radio"] {
    width: 20px;
    height: 20px;
    accent-color: #0071e3;
    cursor: pointer;
}

.shipping-radio label {
    font-size: 14px;
    font-weight: 500;
    color: #2c2c2c;
    cursor: pointer;
}

.shipping-price {
    font-size: 14px;
    font-weight: 600;
    color: #0071e3;
}

.shipping-description {
    font-size: 13px;
    color: #6a6a6a;
    margin-left: 32px;
}

/* ============================================
   PAYMENT SECTION
   ============================================ */
.payment-notice {
    background-color: #f7f7f7;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 13px;
    color: #6a6a6a;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.payment-notice::before {
    content: "🔒";
    font-size: 16px;
}

.payment-box {
    border: 1px solid #d1d1d1;
    border-radius: 8px;
    padding: 20px;
    background-color: #fafafa;
}

/* ============================================
   CHECKOUT BUTTON
   ============================================ */
.checkout-actions {
    margin: 32px 0;
}

.btn-checkout {
    width: 100%;
    padding: 20px;
    background: linear-gradient(135deg, #0071e3 0%, #005bb5 100%);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    font-family: inherit;
}

.btn-checkout:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 113, 227, 0.3);
}

.btn-checkout:active {
    transform: translateY(0);
}

/* ============================================
   FOOTER
   ============================================ */
.checkout-footer {
    padding-top: 32px;
    border-top: 1px solid #e5e5e5;
    margin-top: 32px;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
}

.footer-links a {
    color: #6a6a6a;
    font-size: 13px;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: #2c2c2c;
}

/* ============================================
   RIGHT COLUMN - ORDER SUMMARY
   ============================================ */
.checkout-right {
    background-color: #fafafa;
    border-left: 1px solid #e5e5e5;
    padding: 80px 80px 80px 40px;
}

.order-summary {
    max-width: 480px;
}

.summary-title {
    font-size: 20px;
    font-weight: 600;
    color: #2c2c2c;
    margin-bottom: 24px;
}

/* ============================================
   PRODUCT ITEM
   ============================================ */
.product-item {
    display: grid;
    grid-template-columns: 80px 1fr auto;
    gap: 16px;
    padding-bottom: 24px;
    border-bottom: 1px solid #e5e5e5;
    margin-bottom: 24px;
}

.product-image-wrapper {
    position: relative;
}

.product-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #e5e5e5;
}

.product-quantity {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: #6a6a6a;
    color: #ffffff;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
}

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

.product-name {
    font-size: 14px;
    font-weight: 500;
    color: #2c2c2c;
    line-height: 1.4;
    margin-bottom: 4px;
}

.product-variant {
    font-size: 12px;
    color: #E91E63;
    font-weight: 600;
    margin-top: 4px;
}

.product-price {
    font-size: 16px;
    font-weight: 600;
    color: #2c2c2c;
    display: flex;
    align-items: center;
}

/* ============================================
   DISCOUNT CODE - APPLIED
   ============================================ */
.discount-applied {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: linear-gradient(135deg, #E91E63 0%, #F4B942 100%);
    border-radius: 8px;
    margin-bottom: 24px;
}

.discount-badge {
    display: flex;
    align-items: center;
    gap: 8px;
}

.discount-icon {
    width: 16px;
    height: 16px;
    color: #ffffff;
}

.discount-text {
    font-size: 14px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.5px;
}

.discount-amount {
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
}

/* ============================================
   ORDER TOTALS
   ============================================ */
.order-totals {
    border-top: 1px solid #e5e5e5;
    padding-top: 24px;
}

.total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.total-label {
    font-size: 14px;
    color: #6a6a6a;
}

.total-value {
    font-size: 14px;
    color: #2c2c2c;
    font-weight: 500;
}

.shipping-free {
    color: #0071e3;
    font-weight: 600;
}

.discount-row {
    color: #E91E63;
}

.total-discount {
    color: #E91E63;
    font-weight: 700;
}

.total-row.grand-total {
    padding-top: 16px;
    border-top: 1px solid #e5e5e5;
    margin-top: 16px;
}

.grand-total .total-label {
    font-size: 16px;
    color: #2c2c2c;
    font-weight: 600;
}

.grand-total .total-value {
    font-size: 20px;
    font-weight: 700;
    color: #2c2c2c;
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.grand-total .currency {
    font-size: 12px;
    color: #6a6a6a;
    font-weight: 500;
}

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

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

/* Tablet */
@media (max-width: 1024px) {
    .checkout-container {
        grid-template-columns: 1fr;
    }
    
    .checkout-left {
        padding: 24px 40px 40px;
    }
    
    .checkout-right {
        display: none; /* Hide right column on tablet/mobile */
    }
    
    .order-summary-mobile {
        display: block; /* Show mobile summary */
    }
}

/* Mobile */
@media (max-width: 768px) {
    .checkout-left {
        padding: 20px 20px 40px;
    }
    
    .checkout-right {
        padding: 32px 20px;
    }
    
    .logo-image {
        height: 50px;
    }
    
    .form-row.two-columns,
    .form-row.three-columns {
        grid-template-columns: 1fr;
    }
    
    .product-item {
        grid-template-columns: 64px 1fr auto;
        gap: 12px;
    }
    
    .product-image {
        width: 64px;
        height: 64px;
    }
    
    .product-name {
        font-size: 13px;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
    
    .breadcrumb {
        font-size: 12px;
    }
    
    .discount-code {
        flex-direction: column;
    }
    
    .discount-btn {
        width: 100%;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .checkout-left {
        padding: 16px 16px 32px;
    }
    
    .checkout-right {
        padding: 24px 16px;
    }
    
    .checkout-header {
        padding: 16px 0 20px;
    }
    
    .trust-badges {
        gap: 12px;
        margin-top: 16px;
    }
    
    .trust-item {
        font-size: 11px;
    }
    
    .trust-icon {
        width: 16px;
        height: 16px;
    }
    
    .trust-divider {
        display: none;
    }
    
    .logo-image {
        height: 45px;
    }
    
    .section-title {
        font-size: 15px;
    }
    
    .card-icons {
        gap: 4px;
    }
    
    .card-icon {
        height: 20px;
    }
    
    .form-input,
    .form-select {
        padding: 12px 14px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .btn-checkout {
        padding: 18px;
        font-size: 16px;
        font-weight: 700;
    }
    
    .grand-total .amount {
        font-size: 22px;
    }
}

/* ============================================
   INPUT VALIDATION STATES
   ============================================ */
.form-input:invalid:not(:placeholder-shown),
.form-select:invalid {
    border-color: #dc3545;
}

.form-input:valid:not(:placeholder-shown) {
    border-color: #28a745;
}

/* ============================================
   LOADING STATE
   ============================================ */
.btn-checkout:disabled {
    background: #d1d1d1;
    cursor: not-allowed;
    transform: none;
}

.btn-checkout.loading {
    position: relative;
    color: transparent;
}

.btn-checkout.loading::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 3px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spinner 0.8s linear infinite;
}

@keyframes spinner {
    to {
        transform: rotate(360deg);
    }
}
