/* ===============================
   CHECKOUT PAGE — PREMIUM ULTRA
   File: /assets/frontend/css/pages-checkout.css
   Features: 8K Ready • Glass Morphism • Premium Animations
================================ */

/* Base Styles - 8K Ready with rem scaling */
.ck-page {
    padding: clamp(1rem, 2vw, 2rem) 0 clamp(2rem, 4vw, 4rem);
    background: linear-gradient(135deg, #fafafa 0%, #ffffff 100%);
    min-height: 100vh;
    font-size: 16px; /* Base for rem */
}

/* 8K Support */
@media (min-width: 3840px) {
    .ck-page { font-size: 24px; }
}

/* Premium Header */
.ck-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
    padding: 1.5rem 0 1.5rem;
    border-bottom: 1px solid rgba(199, 162, 83, 0.15);
    background: linear-gradient(to right, transparent, rgba(199, 162, 83, 0.02), transparent);
    margin-bottom: 1rem;
}

.ck-title {
    margin: 0.5rem 0 0;
    font-family: 'Playfair Display', var(--serif);
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #1a1a1a 0%, #333 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    display: inline-block;
}

.ck-title::after {
    content: '';
    position: absolute;
    bottom: -0.5rem;
    left: 0;
    width: 6rem;
    height: 3px;
    background: linear-gradient(90deg, #c7a253, transparent);
    border-radius: 2px;
}

.ck-sub {
    margin-top: 0.75rem;
    color: rgba(17, 17, 17, 0.6);
    font-size: clamp(0.85rem, 1.2vw, 1rem);
    letter-spacing: 0.02em;
}

/* Secure Checkout Pill */
.ck-head .pill {
    background: linear-gradient(135deg, #c7a253, #b38f3f);
    color: white;
    padding: 0.6rem 1.2rem;
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    box-shadow: 0 10px 20px -5px rgba(199, 162, 83, 0.3);
    animation: pillPulse 2s infinite;
}

@keyframes pillPulse {
    0% { box-shadow: 0 10px 20px -5px rgba(199, 162, 83, 0.3); }
    50% { box-shadow: 0 15px 30px -5px rgba(199, 162, 83, 0.5); }
    100% { box-shadow: 0 10px 20px -5px rgba(199, 162, 83, 0.3); }
}

/* Premium Grid Layout */
.ck-grid {
    display: grid;
    grid-template-columns: 1fr 0.85fr;
    gap: 2rem;
    margin-top: 2rem;
}

/* Glass Card Effect */
.ck-card {
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(199, 162, 83, 0.15);
    box-shadow: 
        0 25px 50px -12px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(199, 162, 83, 0.05) inset;
    overflow: hidden;
    padding: 2rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ck-card:hover {
    transform: translateY(-5px);
    box-shadow: 
        0 30px 60px -12px rgba(199, 162, 83, 0.25),
        0 0 0 1px rgba(199, 162, 83, 0.15) inset;
    border-color: rgba(199, 162, 83, 0.3);
}

/* Form Title */
.form-title {
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-size: 0.85rem;
    color: #c7a253;
    margin-bottom: 1.5rem;
    position: relative;
    padding-bottom: 0.75rem;
}

.form-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 3rem;
    height: 2px;
    background: linear-gradient(90deg, #c7a253, transparent);
    border-radius: 1px;
}

/* Premium Form Fields */
.frow {
    display: grid;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.frow label {
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(17, 17, 17, 0.7);
    font-weight: 700;
    transition: color 0.2s ease;
}

.frow:focus-within label {
    color: #c7a253;
}

.frow input {
    padding: 1rem 1.2rem;
    border-radius: 18px;
    border: 1.5px solid rgba(17, 17, 17, 0.08);
    outline: none;
    font-size: 1rem;
    transition: all 0.2s ease;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02) inset;
}

.frow input:hover {
    border-color: rgba(199, 162, 83, 0.3);
    background: white;
}

.frow input:focus {
    border-color: #c7a253;
    box-shadow: 0 0 0 4px rgba(199, 162, 83, 0.1);
}

.frow input::placeholder {
    color: rgba(17, 17, 17, 0.3);
    font-size: 0.95rem;
}

/* Two Column Layout */
.frow2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Premium Place Order Button */
.ck-card .btn {
    width: 100%;
    padding: 1.2rem 1.5rem;
    background: linear-gradient(135deg, #1a1a1a, #2d2d2d);
    color: white;
    border: none;
    border-radius: 18px;
    font-weight: 800;
    font-size: 1rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.3);
}

.ck-card .btn::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;
}

.ck-card .btn:hover {
    background: linear-gradient(135deg, #c7a253, #b38f3f);
    transform: translateY(-2px);
    box-shadow: 0 15px 30px -5px rgba(199, 162, 83, 0.4);
}

.ck-card .btn:hover::before {
    left: 100%;
}

.ck-card .btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
    background: linear-gradient(135deg, #999, #777);
}

/* Hint Text */
.hint {
    margin-top: 1rem;
    color: rgba(17, 17, 17, 0.5);
    font-size: 0.85rem;
    line-height: 1.6;
    text-align: center;
    font-style: italic;
}

/* Premium Order Summary */
.ck-summary {
    background: linear-gradient(135deg, #fafafa, #ffffff);
    position: relative;
    overflow: hidden;
}

.ck-summary::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(199, 162, 83, 0.02) 0%, transparent 70%);
    pointer-events: none;
}

.sum-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(199, 162, 83, 0.1);
    transition: all 0.2s ease;
    position: relative;
    z-index: 1;
}

.sum-row:hover {
    padding-left: 0.5rem;
    background: rgba(199, 162, 83, 0.02);
    border-radius: 8px;
}

.sum-row span {
    color: rgba(17, 17, 17, 0.7);
    font-size: 0.95rem;
    font-weight: 500;
}

.sum-row b {
    font-size: 1.1rem;
    font-weight: 800;
    color: #1a1a1a;
}

.sum-total {
    border-bottom: none;
    margin-top: 0.5rem;
    padding-top: 1.5rem;
    border-top: 2px solid rgba(199, 162, 83, 0.2);
}

.sum-total span {
    font-size: 1.1rem;
    font-weight: 700;
    color: #c7a253;
}

.sum-total b {
    font-size: 1.5rem;
    background: linear-gradient(135deg, #c7a253, #b38f3f);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Premium Toast Notifications */
.premium-toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1rem 2rem;
    background: white;
    border-radius: 50px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #c7a253;
    font-weight: 500;
    transform: translateX(400px);
    animation: slideInRight 0.3s forwards;
    z-index: 9999;
}

@keyframes slideInRight {
    to { transform: translateX(0); }
}

/* Success Popup */
.success-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 2rem 3rem;
    border-radius: 30px;
    box-shadow: 0 50px 100px rgba(0, 0, 0, 0.2);
    text-align: center;
    z-index: 10000;
    animation: popIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(199, 162, 83, 0.2);
    backdrop-filter: blur(20px);
}

.success-popup h3 {
    color: #c7a253;
    font-size: 2rem;
    margin: 0 0 1rem;
}

.success-popup p {
    color: #666;
    margin-bottom: 1.5rem;
}

.success-popup button {
    padding: 1rem 2rem;
    background: #c7a253;
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
}

/* Loading Animation */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===============================
   RESPONSIVE DESIGN
================================ */
@media (max-width: 1200px) {
    .ck-grid {
        gap: 1.5rem;
    }
}

@media (max-width: 980px) {
    .ck-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .ck-card {
        padding: 1.5rem;
    }
    
    .frow2 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .ck-page {
        padding: 1rem 0 2rem;
    }
    
    .ck-head {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .ck-title {
        font-size: 1.8rem;
    }
    
    .ck-card {
        padding: 1.2rem;
        border-radius: 20px;
    }
    
    .frow input {
        padding: 0.9rem 1rem;
    }
    
    .ck-card .btn {
        padding: 1rem;
    }
    
    .sum-total b {
        font-size: 1.3rem;
    }
}

/* Touch Device Optimizations */
@media (hover: none) {
    .ck-card:hover {
        transform: none;
    }
    
    .frow input:hover {
        border-color: rgba(17, 17, 17, 0.08);
    }
    
    .ck-card .btn:hover {
        transform: none;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .ck-page {
        background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    }
    
    .ck-title {
        background: linear-gradient(135deg, #fff 0%, #c7a253 100%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
    }
    
    .ck-card {
        background: rgba(45, 45, 45, 0.95);
        border-color: rgba(199, 162, 83, 0.15);
    }
    
    .frow label {
        color: rgba(255, 255, 255, 0.7);
    }
    
    .frow input {
        background: rgba(255, 255, 255, 0.05);
        border-color: rgba(255, 255, 255, 0.1);
        color: white;
    }
    
    .sum-row span {
        color: rgba(255, 255, 255, 0.6);
    }
    
    .sum-row b {
        color: white;
    }
}
/* Premium Order Items List */
.order-items-list {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 1.5rem;
    padding-right: 0.5rem;
}

.order-items-list::-webkit-scrollbar {
    width: 4px;
}

.order-items-list::-webkit-scrollbar-track {
    background: rgba(199, 162, 83, 0.05);
    border-radius: 10px;
}

.order-items-list::-webkit-scrollbar-thumb {
    background: rgba(199, 162, 83, 0.3);
    border-radius: 10px;
}

.order-item {
    display: flex;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(199, 162, 83, 0.1);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.order-item:last-child {
    border-bottom: none;
}

.item-image {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    overflow: hidden;
    background: rgba(199, 162, 83, 0.05);
    flex-shrink: 0;
}

.item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.item-details {
    flex: 1;
}

.item-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: #1a1a1a;
    margin-bottom: 0.25rem;
}

.item-meta {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.25rem;
}

.item-size, .item-color {
    font-size: 0.8rem;
    color: rgba(17, 17, 17, 0.6);
    background: rgba(199, 162, 83, 0.08);
    padding: 0.2rem 0.5rem;
    border-radius: 20px;
}

.item-price {
    font-size: 0.85rem;
    color: rgba(17, 17, 17, 0.7);
}

.item-total {
    font-weight: 700;
    color: #c7a253;
    min-width: 80px;
    text-align: right;
}

.empty-cart {
    padding: 2rem;
    text-align: center;
    color: rgba(17, 17, 17, 0.5);
    font-style: italic;
}

/* Premium Toast Container */
.premium-toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.premium-toast {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: white;
    border-radius: 50px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #c7a253;
    font-weight: 500;
    transform: translateX(400px);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: 400px;
}

.premium-toast.show {
    transform: translateX(0);
}

.premium-toast.hide {
    transform: translateX(400px);
}

.premium-toast-success {
    border-left-color: #10b981;
}

.premium-toast-error {
    border-left-color: #ef4444;
}

.premium-toast-info {
    border-left-color: #3b82f6;
}

.premium-toast-warning {
    border-left-color: #f59e0b;
}

.toast-icon {
    font-size: 1.2rem;
    font-weight: 700;
}

.toast-message {
    flex: 1;
    font-size: 0.95rem;
}

.toast-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: rgba(17, 17, 17, 0.4);
    transition: color 0.2s;
}

.toast-close:hover {
    color: rgba(17, 17, 17, 0.8);
}

/* Premium Popup */
.premium-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.premium-popup-overlay.show {
    opacity: 1;
}

.premium-popup-overlay.hide {
    opacity: 0;
}

.premium-popup {
    background: white;
    padding: 2.5rem;
    border-radius: 30px;
    box-shadow: 0 50px 100px rgba(0, 0, 0, 0.2);
    max-width: 450px;
    width: 90%;
    text-align: center;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(199, 162, 83, 0.2);
    position: relative;
}

.premium-popup-overlay.show .premium-popup {
    transform: scale(1);
}

.popup-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #c7a253, #b38f3f);
    color: white;
    font-size: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin: 0 auto 1.5rem;
    box-shadow: 0 20px 30px -10px rgba(199, 162, 83, 0.3);
}

.popup-title {
    font-size: 1.8rem;
    color: #1a1a1a;
    margin-bottom: 1rem;
    font-weight: 800;
}

.popup-message {
    color: rgba(17, 17, 17, 0.7);
    margin-bottom: 2rem;
    line-height: 1.6;
    font-size: 1rem;
}

.popup-button {
    background: linear-gradient(135deg, #1a1a1a, #2d2d2d);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 150px;
}

.popup-button:hover {
    background: linear-gradient(135deg, #c7a253, #b38f3f);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -5px rgba(199, 162, 83, 0.4);
}

.popup-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: rgba(17, 17, 17, 0.4);
    transition: color 0.2s;
}

.popup-close:hover {
    color: rgba(17, 17, 17, 0.8);
}

/* Loading Spinner */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease infinite;
    margin-right: 0.5rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}