/* CSS Variables */
:root {
    --bg-primary: #0d0d0f;
    --bg-secondary: #141418;
    --bg-tertiary: #1a1a1f;
    --bg-card: #18181c;
    
    --text-primary: #f5f5f7;
    --text-secondary: #a1a1a6;
    --text-muted: #6e6e73;
    
    --accent: #c9a227;
    --accent-hover: #ddb62e;
    --accent-soft: rgba(201, 162, 39, 0.1);
    
    --border: #2a2a2f;
    --border-focus: #c9a227;
    
    --success: #34c759;
    --error: #ff453a;
    
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    
    --font-display: 'Fraunces', serif;
    --font-body: 'Outfit', sans-serif;
    
    --transition: 0.2s ease;
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Background Pattern */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(ellipse at 20% 20%, rgba(201, 162, 39, 0.03) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(201, 162, 39, 0.02) 0%, transparent 50%),
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 100px,
            rgba(255, 255, 255, 0.01) 100px,
            rgba(255, 255, 255, 0.01) 101px
        ),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 100px,
            rgba(255, 255, 255, 0.01) 100px,
            rgba(255, 255, 255, 0.01) 101px
        );
    pointer-events: none;
    z-index: -1;
}

/* Page Wrapper */
.page-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 0;
    border-bottom: 1px solid var(--border);
    animation: fadeDown 0.6s ease;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-primary);
}

.logo-icon {
    font-size: 28px;
    color: var(--accent);
    animation: pulse 3s ease-in-out infinite;
}

.logo-text {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -0.5px;
}

.secure-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    padding: 8px 16px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}

.secure-badge svg {
    color: var(--success);
}

/* Main Container */
.checkout-container {
    display: grid;
    grid-template-columns: 1fr 420px;
    gap: 48px;
    padding: 48px 0;
    flex: 1;
}

/* Form Sections */
.checkout-form {
    animation: fadeUp 0.6s ease 0.1s backwards;
}

.form-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
    margin-bottom: 24px;
    transition: var(--transition);
}

.form-section:hover {
    border-color: rgba(201, 162, 39, 0.2);
}

.section-title {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.step-number {
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 500;
    color: var(--accent);
    background: var(--accent-soft);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
}

/* Form Elements */
.form-group {
    margin-bottom: 20px;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 14px 16px;
    font-family: var(--font-body);
    font-size: 15px;
    color: var(--text-primary);
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    outline: none;
    transition: var(--transition);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

.form-group input:focus,
.form-group select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.form-group select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%236e6e73' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
}

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

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

/* Payment Options Section */
.payment-options {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

/* ============================================
   GOOGLE PAY MARK - Brand Guidelines
   https://developers.google.com/pay/api/web/guides/brand-guidelines#logo-mark
   
   Rules:
   - Use only the official Google Pay mark
   - Don't alter the mark in any way (color, weight, outline)
   - Clear space: 0.5x height of capital G on all sides
   - Size: Match other brand identities, never smaller
   ============================================ */

.gpay-mark {
    /* Don't alter the mark in any way */
    height: 20px;
    width: auto;
    /* Clear space: 0.5x of mark height = 10px on all sides */
    /* Applied via padding on container, not on the mark itself */
}

/* Google Pay Button Container */
/* Clear space: 8dp (8px) minimum on all sides per brand guidelines */
.gpay-button-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 8px;
    margin: 8px 0;
    min-height: 48px;
}

.gpay-button-container button,
.gpay-button-container > div {
    width: auto !important;
    flex-shrink: 0;
}

.gpay-note {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Payment confirmation - Success Modal */
/* Per brand guidelines: "Paid with Google Pay" is acceptable */
/* Format: "Paid with [Google Pay mark]" */
.payment-confirmation {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    /* Gap provides visual separation, not clear space */
    gap: 8px;
    margin-top: 16px;
    /* Clear space around the mark container */
    padding: 12px 20px;
    /* White background for mark visibility per guidelines */
    background: #ffffff;
    border-radius: var(--radius-md);
    font-size: 14px;
    /* Google gray text color for consistency */
    color: #5f6368;
    font-weight: 500;
}

/* Google Pay Mark in Success Modal */
/* Size: 20px height to match brand identity */
/* Clear space: Built into the pill-shaped mark design */
.gpay-mark-small {
    height: 20px;
    width: auto;
    /* Margin provides 0.5x clear space (10px) on sides */
    margin: 0 2px;
}

/* Review Modal - Clean Vertical Layout */
.review-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    padding: 20px;
    overflow-y: auto;
}

.review-modal.active {
    opacity: 1;
    visibility: visible;
}

.review-content {
    background: #f5f5f5;
    border-radius: 12px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 32px 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.review-title {
    text-align: center;
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 24px;
}

/* Review Rows */
.review-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
}

.review-label {
    font-size: 15px;
    font-weight: 500;
    color: #1a1a1a;
}

.review-value {
    font-size: 15px;
    color: #5f6368;
    text-align: right;
}

.review-value.discount {
    color: #34a853;
}

.review-row.total-row {
    padding: 16px 0;
}

.review-row.total-row .review-label,
.review-row.total-row .review-value {
    font-weight: 600;
    font-size: 16px;
    color: #1a1a1a;
}

/* Dividers */
.review-divider {
    height: 4px;
    background: linear-gradient(90deg, #34a853, #4285f4);
    border-radius: 2px;
    margin: 8px 0;
}

.review-row-divider {
    height: 1px;
    background: #e0e0e0;
    margin: 8px 0;
}

/* Payment Info - Review Modal */
/* Per guidelines: "Network •••• 1234 with Google Pay" format is acceptable */
.review-payment-info {
    display: flex;
    align-items: center;
    /* Gap between mark and card text */
    gap: 16px;
}

/* Google Pay Mark in Review Modal */
/* Brand Guidelines:
   - Size: Match other brand identities - MUST NOT be smaller
   - Clear space: 0.5x height of G on all sides (built into pill shape)
   - Don't alter the mark in any way
*/
.gpay-mark-review {
    /* Height to match VISA text size visually */
    /* The pill mark has significant internal padding */
    /* Larger size needed so "G Pay" matches "VISA •••• 1111" */
    height: 56px;
    width: auto;
    /* The official mark has white background with gray outline */
}

.review-payment-info span {
    font-size: 18px;
    font-weight: 500;
    /* Google gray for consistency with mark */
    color: #5f6368;
    letter-spacing: 0.5px;
}

/* Product Row */
.review-product {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 0;
    border-bottom: 1px solid #e0e0e0;
}

.product-image {
    width: 64px;
    height: 64px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image svg {
    opacity: 0.6;
}

.product-details {
    flex: 1;
}

.product-name {
    font-size: 15px;
    font-weight: 500;
    color: #1a1a1a;
    margin-bottom: 4px;
}

.product-variant {
    font-size: 13px;
    color: #5f6368;
}

.product-qty-price {
    font-size: 15px;
    color: #5f6368;
    text-align: right;
}

/* Shipping Row */
.review-row.shipping-row {
    padding: 20px 0;
    align-items: flex-start;
}

.shipping-info {
    text-align: right;
}

.shipping-method {
    display: block;
    font-size: 15px;
    font-weight: 500;
    color: #1a1a1a;
}

.shipping-estimate {
    display: block;
    font-size: 13px;
    color: #5f6368;
    margin-top: 2px;
}

/* Place Order Button */
.place-order-btn {
    display: block;
    width: 60%;
    max-width: 400px;
    margin: 32px auto 0;
    padding: 16px 32px;
    font-family: var(--font-body);
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: #ffffff;
    background: #34a853;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.place-order-btn:hover {
    background: #2d9249;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(52, 168, 83, 0.3);
}

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


/* Order Summary */
.order-summary {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
    height: fit-content;
    position: sticky;
    top: 24px;
    animation: fadeUp 0.6s ease 0.2s backwards;
}

.summary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.summary-header h2 {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 600;
}

.item-count {
    font-size: 13px;
    color: var(--text-muted);
}

/* Cart Items */
.cart-items {
    margin-bottom: 24px;
}

.cart-item {
    display: grid;
    grid-template-columns: 64px 1fr auto;
    gap: 16px;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
}

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

.item-image {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--text-secondary);
}

.item-details h3 {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
}

.item-details p {
    font-size: 12px;
    color: var(--text-muted);
}

.item-price {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Promo Code */
.promo-code {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
}

.promo-code input {
    flex: 1;
    padding: 12px 16px;
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--text-primary);
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    outline: none;
    transition: var(--transition);
}

.promo-code input:focus {
    border-color: var(--accent);
}

.promo-code button {
    padding: 12px 20px;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 500;
    color: var(--accent);
    background: var(--accent-soft);
    border: 1px solid var(--accent);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
}

.promo-code button:hover {
    background: var(--accent);
    color: var(--bg-primary);
}

/* Summary Totals */
.summary-totals {
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.total-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 14px;
    color: var(--text-secondary);
}

.total-row.discount {
    color: var(--success);
}

.total-row.final {
    padding-top: 16px;
    margin-top: 8px;
    border-top: 1px solid var(--border);
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Trust Badges */
.trust-badges {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.badge {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: var(--text-secondary);
}

.badge svg {
    color: var(--accent);
    opacity: 0.7;
}

/* Footer */
.footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 0;
    border-top: 1px solid var(--border);
    font-size: 13px;
    color: var(--text-muted);
}

.footer-links {
    display: flex;
    gap: 24px;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--accent);
}

/* Success Modal */
.success-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(13, 13, 15, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
}

.success-modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 48px;
    text-align: center;
    max-width: 420px;
    transform: scale(0.9) translateY(20px);
    transition: all 0.3s ease;
}

.success-modal.active .modal-content {
    transform: scale(1) translateY(0);
}

.success-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--success), #2a9d4a);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    animation: checkmark 0.5s ease 0.3s backwards;
}

.success-icon svg {
    stroke: white;
    stroke-width: 3;
}

.modal-content h2 {
    font-family: var(--font-display);
    font-size: 28px;
    margin-bottom: 12px;
}

.modal-content p {
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.order-number {
    font-family: var(--font-body);
    font-weight: 600;
    color: var(--accent) !important;
    margin-top: 16px !important;
}

.modal-btn {
    margin-top: 24px;
    padding: 14px 32px;
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 500;
    color: var(--bg-primary);
    background: var(--accent);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
}

.modal-btn:hover {
    background: var(--accent-hover);
}

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

@keyframes fadeDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

@keyframes checkmark {
    from {
        transform: scale(0);
    }
    to {
        transform: scale(1);
    }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .checkout-container {
        grid-template-columns: 1fr;
        gap: 32px;
    }
    
    .order-summary {
        position: static;
        order: -1;
    }
}

@media (max-width: 768px) {
    .page-wrapper {
        padding: 0 16px;
    }
    
    .header {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
    
    .form-section {
        padding: 24px;
    }
    
    .form-row,
    .form-row.triple {
        grid-template-columns: 1fr;
    }
    
    .review-content {
        padding: 24px;
        width: 100%;
    }
    
    .review-title {
        font-size: 20px;
    }
    
    .place-order-btn {
        width: 80%;
    }
}

@media (max-width: 600px) {
    .order-summary {
        padding: 24px;
    }
    
    .footer {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
    
    .review-product {
        flex-wrap: wrap;
    }
    
    .product-qty-price {
        width: 100%;
        text-align: left;
        margin-top: 8px;
        padding-left: 80px;
    }
    
    .place-order-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .gpay-button-container button {
        min-width: 100%;
    }
}

