/* =============================================
   CREATIVE PRINTERS ONLINE - MAIN STYLESHEET
   Dark Premium Theme with Modern Aesthetics
   ============================================= */

/* === CSS RESET & BASE === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* ── Brand Colors ── */
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #f59e0b;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;

    /* ── Light Mode Backgrounds ── */
    --bg-primary: #f0f4f8;
    --bg-secondary: #ffffff;
    --bg-tertiary: #e8edf3;
    --card-bg: #ffffff;

    /* ── Light Mode Text ── */
    --text-primary: #1a202c;
    --text-secondary: #2d3748;
    --text-muted: #718096;

    /* ── Light Mode Borders ── */
    --border-color: #cbd5e0;

    /* ── Light Mode Shadows ── */
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 8px -2px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 10px 20px -5px rgba(0, 0, 0, 0.15);
    --shadow-xl: 0 20px 30px -8px rgba(0, 0, 0, 0.20);

    /* ── Spacing ── */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 40px;
    --space-2xl: 64px;

    /* ── Border Radius ── */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-pill: 9999px;

    /* ── Transitions ── */
    --transition: all 0.3s ease;
    --transition-fast: all 0.15s ease;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 2rem;
}

/* === HEADER === */
.main-header {
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 1rem 2rem;
    width: 100%;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.main-header.hidden-scroll {
    transform: translateY(-100%);
}

.main-header .container {
    max-width: none;
    padding: 0;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-light);
    flex-shrink: 0;
    min-width: 60px;
}

.logo img {
    height: 50px;
    width: auto;
    display: block;
    flex-shrink: 0;
}

.logo i {
    font-size: 2rem;
}

.search-bar {
    flex: 1;
    max-width: 500px;
    position: relative;
}

.search-bar i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-bar input {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 3rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 0;
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: var(--transition);
}

.search-bar input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Hide Mobile Elements on Desktop */
.mobile-menu-toggle,
.mobile-menu-header,
.mobile-menu-overlay {
    display: none;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.95rem;
    cursor: pointer;
    border-radius: 8px;
    transition: var(--transition);
    position: relative;
}

.nav-btn:hover {
    background: var(--bg-tertiary);
    color: var(--primary-light);
}

.nav-btn i {
    font-size: 1.25rem;
}

.badge {
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    background: var(--danger);
    color: white;
    font-size: 0.7rem;
    padding: 0.125rem 0.375rem;
    border-radius: 10px;
    font-weight: 600;
}

/* === HERO SECTION === */
.hero {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(30, 41, 59, 0.8) 100%);
    padding: 4rem 0;
    text-align: center;
}

.hero-content h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--primary-light), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-content p {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-lg);
}

.cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

/* === MAIN CONTENT === */
.main-content {
    padding: 3rem 2rem;
}

.main-content .container {
    max-width: none;
    padding: 0;
}

.product-category {
    margin-bottom: 4rem;
}

.category-header {
    margin-bottom: 2rem;
}

.category-header h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.category-header p {
    color: var(--text-secondary);
    font-size: 1.05rem;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 2rem;
}

/* === PRODUCT CARD === */
.product-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), box-shadow 0.4s ease;
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 30px -10px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-light);
}

/* Product Card Header */
.product-card-header {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    right: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    z-index: 10;
}

.product-badge {
    background: #000000;
    color: #ffffff;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.wishlist-heart {
    background: transparent;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    z-index: 10;
}

.wishlist-heart i {
    color: var(--text-muted, #94a3b8);
    font-size: 1.1rem;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
    transition: all 0.3s ease;
}

.wishlist-heart.active i,
.wishlist-heart:hover i {
    color: #ef4444;
}

.wishlist-heart:hover {
    transform: scale(1.1);
    background: transparent;
}

/* Product Image Wrapper with Carousel */
.product-image-wrapper {
    position: relative;
    background: transparent;
    padding: 0;
    overflow: hidden;
    /* Aspect ratio 4:5 - shorter portrait look */
    aspect-ratio: 4 / 5;
    width: 100%;
}

.product-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    background: #f8fafc;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    transition: transform 0.8s cubic-bezier(0.165, 0.84, 0.44, 1), opacity 0.5s ease;
    position: absolute;
    top: 0;
    left: 0;
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.product-image img.fade-out {
    opacity: 0;
}

.product-image img.fade-in {
    opacity: 1;
}

.product-image i {
    font-size: 5rem;
    color: var(--border-color);
}

/* Carousel Indicators - Positioned over image */
.carousel-indicators {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    justify-content: center;
    gap: 0.4rem;
    z-index: 5;
}

.carousel-indicators .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease;
    cursor: pointer;
}

.carousel-indicators .dot:hover {
    background: rgba(255, 255, 255, 0.8);
}

.carousel-indicators .dot.active {
    background: #ffffff;
    width: 16px;
    border-radius: 4px;
}

/* Product Info */
.product-info {
    padding: 1.25rem;
    background: var(--card-bg);
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.product-brand {
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.35rem;
}

.product-name {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price-label {
    display: none; /* Hide label for cleaner look */
}

.product-price {
    color: var(--text-primary);
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 1rem;
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.product-price small {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
    text-decoration: line-through;
}

/* Buy Now Button */
.btn-buy-now {
    width: 100%;
    padding: 0.75rem;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: auto;
}

.btn-buy-now:hover {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.btn-buy-now:active {
    transform: translateY(0);
}


/* === FOOTER === */
.main-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 3rem 2rem 1.5rem;
    margin-top: 4rem;
    width: 100%;
}

.main-footer .container {
    max-width: none;
    padding: 0;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    margin-bottom: 1rem;
    color: var(--primary-light);
}

.footer-section p {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border-radius: 50%;
    transition: var(--transition);
}

.social-links a:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-3px);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
}

/* === MODAL SYSTEM === */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 2rem;
    overflow-y: auto;
}

.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2.5rem;
    max-width: 500px;
    width: 100%;
    position: relative;
    box-shadow: var(--shadow-xl);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: var(--bg-tertiary);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.modal-close:hover {
    background: var(--danger);
    color: white;
    transform: rotate(90deg);
}

.modal-content h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.modal-subtitle {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

/* === SIDEBAR SYSTEM === */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(4px);
    z-index: 1010;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

.sidebar-panel {
    position: fixed;
    top: 0;
    height: 100%;
    width: 400px;
    max-width: 100%;
    background: var(--bg-secondary);
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.2);
    z-index: 1011;
    display: flex;
    flex-direction: column;
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.sidebar-panel.right-sidebar {
    right: 0;
    transform: translateX(100%);
    border-left: 1px solid var(--border-color);
}

.sidebar-panel.active {
    transform: translateX(0);
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-header h2 {
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0;
}

.sidebar-close {
    background: var(--bg-tertiary);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.sidebar-close:hover {
    background: var(--danger);
    color: white;
    transform: rotate(90deg);
}

.sidebar-content {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
}

.sidebar-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

/* === LOGIN MODAL === */
#login-modal {
    z-index: 1000;
}

.login-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    background: var(--bg-tertiary);
    padding: 0.25rem;
    border-radius: 12px;
}

.tab-btn {
    flex: 1;
    padding: 0.75rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-weight: 500;
    cursor: pointer;
    border-radius: 10px;
    transition: var(--transition);
}

.tab-btn.active {
    background: var(--primary);
    color: white;
}

.login-tab-content {
    display: none;
}

.login-tab-content.active {
    display: block;
}

/* === ORDER FORM MODAL === */
#order-modal {
    z-index: 1001;
}

.order-modal {
    max-width: 900px;
}

#order-form-content {
    margin-bottom: 2rem;
}

.form-section {
    margin-bottom: 2rem;
}

.form-section h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--primary-light);
}

.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

.upload-area:hover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
}

.upload-area i {
    font-size: 3rem;
    color: var(--primary-light);
    margin-bottom: 1rem;
    display: block;
}

.uploaded-files {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.file-preview {
    position: relative;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem;
    background: var(--bg-tertiary);
}

.file-preview img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: 4px;
}

.file-remove {
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    background: var(--danger);
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    font-size: 0.75rem;
}

.pdf-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    padding: 0.5rem;
}

.pdf-preview i {
    font-size: 2rem;
    color: var(--danger);
    margin-bottom: 0.5rem;
}

.pdf-preview p {
    font-size: 0.7rem;
    text-align: center;
    word-break: break-word;
    color: var(--text-muted);
}

.price-summary {
    background: var(--bg-tertiary);
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
}

.price-row {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.price-row:last-child {
    border-bottom: none;
}

.price-row.total {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-light);
    padding-top: 1rem;
    margin-top: 0.5rem;
    border-top: 2px solid var(--border-color);
}

/* === MOCKUP EDITOR MODAL === */
#mockup-modal {
    z-index: 1002;
}

.mockup-editor-overlay {
    background: rgba(15, 23, 42, 0.95);
}

.mockup-editor {
    width: 100%;
    max-width: 1400px;
    height: 90vh;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.mockup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.mockup-workspace {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 320px;
    overflow: hidden;
}

.mockup-canvas-container {
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: auto;
    padding: 2rem;
}

.mockup-base {
    position: relative;
    max-width: 600px;
    max-height: 600px;
}

.mockup-base img {
    width: 100%;
    height: auto;
    display: block;
}

.design-layers {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.design-layer {
    position: absolute;
    cursor: move;
    pointer-events: all;
}

.design-layer img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.mockup-toolbar {
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-color);
    padding: 1.5rem;
    overflow-y: auto;
}

.tool-group {
    margin-bottom: 2rem;
}

.tool-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
}

.color-picker {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.color-option {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 3px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition);
}

.color-option:hover,
.color-option.active {
    border-color: var(--primary);
    transform: scale(1.1);
}

.layers-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 200px;
    overflow-y: auto;
}

.layer-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border-radius: 8px;
    cursor: pointer;
}

.layer-item:hover {
    background: var(--bg-primary);
}

.tool-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* === PAYMENT MODAL === */
#payment-modal {
    z-index: 1003;
}

.payment-modal {
    max-width: 600px;
}

.payment-summary {
    background: var(--bg-tertiary);
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
}

.payment-methods h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.payment-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.payment-option {
    cursor: pointer;
}

.payment-option input[type="radio"] {
    display: none;
}

.option-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.5rem;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    transition: var(--transition);
}

.payment-option input:checked+.option-content {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
}

.option-content i {
    font-size: 2rem;
    color: var(--primary-light);
}

/* === FORM ELEMENTS === */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.error-message {
    color: var(--danger);
    font-size: 0.875rem;
    margin-top: 0.5rem;
    padding: 0.75rem;
    background: rgba(239, 68, 68, 0.1);
    border-radius: 8px;
    display: none;
}

.error-message:not(:empty) {
    display: block;
}

/* === BUTTONS === */
.btn-primary,
.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    width: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-primary);
    border-color: var(--primary);
}

.btn-success {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    background: #10b981;
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-md);
}

.btn-success:hover {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-success:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-large {
    padding: 1.25rem 2rem;
    font-size: 1.125rem;
}

.form-actions {
    display: grid;
    grid-template-columns: auto 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 768px) {
    .form-actions {
        grid-template-columns: 1fr;
    }
}

/* === LOADING OVERLAY === */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--bg-tertiary);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-overlay p {
    margin-top: 1rem;
    font-size: 1.125rem;
    color: var(--text-secondary);
}

/* === RESPONSIVE DESIGN === */
@media (max-width: 1024px) {
    .mockup-workspace {
        grid-template-columns: 1fr;
    }

    .mockup-toolbar {
        border-left: none;
        border-top: 1px solid var(--border-color);
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-wrap: wrap;
    }

    .search-bar {
        order: 3;
        flex-basis: 100%;
        max-width: 100%;
        margin-top: 1rem;
    }

    .header-nav {
        flex-wrap: wrap;
    }

    .nav-btn span {
        display: inline; /* Show text in sidebar */
    }

    .hero-content h1 {
        font-size: 2rem;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1rem;
    }

    .modal-content {
        padding: 1.5rem;
    }

    .form-actions {
        grid-template-columns: 1fr;
    }

    .payment-options {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }

    .hero {
        padding: 2rem 0;
    }

    .hero-content h1 {
        font-size: 1.75rem;
    }

    .products-grid {
        grid-template-columns: 1fr;
    }
}/* =============================================
   CHECKOUT MODAL
   ============================================= */
.pd-checkout-box {
    background: var(--bg-primary);
    border-radius: 20px;
    padding: 2rem;
    width: 100%;
    max-width: 560px;
    position: relative;
    box-shadow: 0 24px 60px rgba(0,0,0,0.35);
    max-height: 90vh;
    overflow-y: auto;
}

/* Desktop Full Screen for Checkout Modal */
@media (min-width: 641px) {
    .pd-checkout-box {
        max-width: 100vw;
        max-height: 100vh;
        width: 100vw;
        height: 100vh;
        border-radius: 0;
        padding: 3rem 10%;
    }
    #pd-checkout-modal, #cart-checkout-modal {
        padding: 0 !important;
    }
}

.pd-checkout-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--bg-secondary);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 1rem;
    transition: all 0.2s;
    z-index: 10;
}

.pd-checkout-close:hover { background: var(--bg-tertiary); color: var(--text-primary); }

/* Step indicator */
.pd-checkout-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 1.75rem;
    padding-top: 0.25rem;
}

.pd-cstep {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
}

.pd-cstep-num {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    color: var(--text-muted);
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    transition: all 0.3s;
}

.pd-cstep span {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 500;
    transition: color 0.3s;
}

.pd-cstep.active .pd-cstep-num {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.pd-cstep.active span { color: var(--primary); font-weight: 700; }

.pd-cstep-line {
    width: 48px;
    height: 2px;
    background: var(--border-color);
    margin: 0 0.25rem;
    margin-bottom: 1.2rem;
    transition: background 0.3s;
}

.pd-cstep-line.active { background: var(--primary); }

/* Step content */
.pd-cstep-content { animation: pdFadeIn 0.3s ease; }

@keyframes pdFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.pd-co-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pd-co-title i { color: var(--primary); }

/* Form */
.pd-co-form { display: flex; flex-direction: column; gap: 0.85rem; margin-bottom: 1.25rem; }

.pd-co-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.pd-co-row:has(.pd-co-group:nth-child(3)) {
    grid-template-columns: 1fr 1fr 1fr;
}

.pd-co-group { display: flex; flex-direction: column; gap: 0.3rem; }

.pd-co-group label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.pd-co-group input {
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    padding: 0.6rem 0.8rem;
    font-size: 0.9rem;
    color: var(--text-primary);
    background: var(--bg-primary);
    outline: none;
    transition: border-color 0.2s;
    font-family: inherit;
    width: 100%;
    box-sizing: border-box;
}

.pd-co-group input:focus { border-color: var(--primary); }

/* Order summary */
.pd-co-summary {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1.25rem;
    border: 1px solid var(--border-color);
}

.pd-co-summary-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

@media (min-width: 768px) {
    .pd-co-summary-grid {
        display: grid;
        grid-template-columns: 1.2fr 1fr;
        gap: 2rem;
        align-items: start;
    }
    
    .pd-co-product-col {
        background: var(--bg-primary);
        padding: 1.5rem;
        border-radius: 12px;
        border: 1px solid var(--border-color);
        height: 100%;
    }
    
    .pd-co-product-col .pd-co-product-img {
        width: 100% !important;
        height: 250px !important;
        object-fit: contain !important;
        border-radius: 8px;
        background: var(--bg-tertiary);
        margin-bottom: 1rem;
    }
    
    .pd-co-product-col .pd-co-product-name {
        font-size: 1.4rem !important;
        margin-bottom: 0.5rem;
    }
    
    .pd-co-product-col .pd-co-product-meta {
        font-size: 0.95rem !important;
    }
    
    .pd-co-billing-col {
        background: var(--bg-primary);
        padding: 1.5rem;
        border-radius: 12px;
        border: 1px solid var(--border-color);
        height: 100%;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
    
    .pd-co-billing-col .pd-co-price-row {
        font-size: 1rem !important;
        margin-bottom: 0.5rem;
    }
    
    .pd-co-billing-col .pd-co-total-row {
        font-size: 1.25rem !important;
        padding-top: 1rem !important;
        margin-top: 0.5rem !important;
    }
}

.pd-co-product-row {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.pd-co-product-img {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
    background: var(--bg-tertiary);
}

.pd-co-product-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-primary);
    margin-bottom: 0.3rem;
}

.pd-co-product-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.pd-co-price-rows { display: flex; flex-direction: column; gap: 0.4rem; }

.pd-co-price-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.pd-co-total-row {
    font-weight: 800;
    font-size: 1rem;
    color: var(--text-primary);
    border-top: 1px solid var(--border-color);
    padding-top: 0.5rem;
    margin-top: 0.2rem;
}

/* Payment options */
.pd-co-pay-options { display: flex; flex-direction: column; gap: 0.6rem; }

.pd-co-pay-opt {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.85rem 1rem;
    border: 1.5px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bg-primary);
}

.pd-co-pay-opt:hover { border-color: var(--primary); background: rgba(99,102,241,0.04); }

.pd-co-pay-opt.active { border-color: var(--primary); background: rgba(99,102,241,0.07); }

.pd-co-radio {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    flex-shrink: 0;
    position: relative;
    transition: all 0.2s;
}

.pd-co-radio.checked {
    border-color: var(--primary);
    background: var(--primary);
    box-shadow: inset 0 0 0 3px var(--bg-primary);
}

.pd-co-pay-title {
    font-weight: 700;
    font-size: 0.92rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.15rem;
}

.pd-co-pay-title i { color: var(--primary); }

.pd-co-pay-sub { font-size: 0.78rem; color: var(--text-muted); }

/* Buttons */
.pd-co-btn-primary {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 0.9rem 1.5rem;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s;
    box-shadow: 0 4px 14px rgba(99,102,241,0.3);
    font-family: inherit;
}

.pd-co-btn-primary:hover { filter: brightness(1.08); transform: translateY(-1px); }
.pd-co-btn-primary:disabled { opacity: 0.7; cursor: not-allowed; transform: none; }

.pd-co-btn-secondary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1.5px solid var(--border-color);
    padding: 0.9rem 1.25rem;
    border-radius: 10px;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.pd-co-btn-secondary:hover { border-color: var(--primary); color: var(--primary); }

/* Success state */
.pd-co-success-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #10b981, #059669);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
    animation: pdScaleIn 0.5s ease-out;
}

.pd-co-success-icon i { font-size: 2rem; color: #fff; }

@keyframes pdScaleIn {
    from { transform: scale(0); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}

.pd-co-order-id-box {
    background: var(--bg-secondary);
    border-radius: 10px;
    padding: 1rem 1.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    display: inline-block;
}

.pd-co-order-id-box strong {
    display: block;
    font-size: 1.3rem;
    color: var(--primary);
    font-family: monospace;
    margin-top: 0.25rem;
}

@media (max-width: 640px) {
    .pd-checkout-box { padding: 1.5rem 1rem; border-radius: 16px 16px 0 0; align-self: flex-end; max-height: 95vh; }
    #pd-checkout-modal { align-items: flex-end !important; padding: 0 !important; }
    .pd-co-row { grid-template-columns: 1fr 1fr; }
    .pd-co-row:has(.pd-co-group:nth-child(3)) { grid-template-columns: 1fr 1fr; }
}
