:root {
    /* Fonts */
    --font-arabic: 'Cairo', 'Tajawal', sans-serif;
    --font-english: 'Outfit', sans-serif;

    /* SWER Unified Palette */
    --primary-color: #7b1928;
    --primary-light: #a42c40;
    --primary-hover: #a42c40;
    --bg-main: #fafafe;
    --bg-color: #fcf1f4;
    --card-bg: #ffffff;
    --text-main: #333333;
    --text-color: #333333;
    --text-muted: #666666;
    --border-color: #e5d1d6;
    --highlight: #f8c8d4;
    --success: #25D366;
    --success-hover: #1ebd5a;

    --transition: all 0.3s ease;
    --shadow-sm: 0 2px 8px rgba(123, 25, 40, 0.08);
    --shadow-md: 0 4px 12px rgba(123, 25, 40, 0.12);
    --shadow-lg: 0 8px 24px rgba(123, 25, 40, 0.15);
    --border-radius: 12px;
    --radius: 12px;
    --shadow: 0 8px 32px rgba(123, 25, 40, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-arabic);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: clip;
}

#wrapper {
    overflow-x: clip;
    width: 100%;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
/* Main Header SWER */
.main-header {
    background-color: var(--card-bg);
    padding: 2rem 1rem;
    text-align: center;
    border-bottom: 2px solid var(--primary-color);
    box-shadow: var(--shadow-sm);
    margin-bottom: 2rem;
}

.store-logo {
    max-width: 250px;
    height: auto;
    margin-bottom: 0.5rem;
    display: inline-block;
}

.header-content p {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: #fff;
    font-size: 1.3rem;
    text-decoration: none;
    transition: var(--transition);
}

.social-icon.tiktok {
    background-color: #000;
}

.social-icon.instagram {
    background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285AEB 90%);
}

.social-icon:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

/* Main Content */
.designer-wrapper {
    padding: 40px 0;
}

.designer-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: start;
}

/* Preview Section */
.preview-section {
    background: white;
    padding: 40px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 500px;
    position: -webkit-sticky;
    position: sticky;
    top: 20px;
    align-self: start;
}

.jacket-preview {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.jacket-preview svg {
    max-width: 100%;
    max-height: 550px;
    height: auto;
    filter: drop-shadow(0 15px 25px rgba(0, 0, 0, 0.1));
    position: relative;
    z-index: 1;
}

/* Design Overlay System */
.jacket-preview-wrapper {
    position: relative;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

.design-overlays-container {
    position: absolute;
    top: 0;
    left: 0;
    /* width & height are set dynamically by syncOverlayToSVG() in JS
       to exactly match the rendered SVG's bounding box on every screen size */
    pointer-events: none;
    z-index: 10;
    box-sizing: border-box;
}

.design-overlay {
    position: absolute;
    transform: translate(-50%, -50%);
    pointer-events: auto;
    user-select: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.design-overlay-content {
    width: 100%;
    height: 100%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.design-overlay.text-item {
    font-weight: bold;
    white-space: nowrap;
    line-height: 1;
}

.design-overlay.logo-item img {
    width: 60px;
    height: 60px;
    object-fit: contain;
}

.design-overlay .remove-design {
    position: absolute;
    top: 0;
    right: 0;
    transform: translate(55%, -55%);
    background: #FF7675;
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
}

.design-overlay:hover .remove-design {
    display: flex;
}

/* Controls Section */
.controls-section {
    min-width: 0;
    /* Prevent grid blowout */
}

.controls-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 12px;
}

.controls-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.icon-btn {
    padding: 10px 15px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.icon-btn svg {
    width: 18px;
    height: 18px;
}

/* Details Row */
.details-row {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.details-field {
    flex: 1;
    min-width: 100px;
}

.designer-card {
    background: var(--card-bg);
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.view-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 2px solid #EEE;
    padding-bottom: 10px;
}

.view-tab {
    padding: 10px 15px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.95rem;
    color: #636E72;
    transition: all 0.3s;
    border-radius: 8px;
}

.view-tab.active {
    background: var(--primary-color);
    color: white;
}

.view-thumb {
    width: 100%;
    height: 50px;
    margin-bottom: 8px;
    background: #f1f3f5;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    /* Crucial: passes clicks to parent button */
    overflow: hidden;
    transition: background 0.3s;
}

.view-tab.active .view-thumb {
    background: rgba(255, 255, 255, 0.2);
}

.view-thumb svg {
    width: 80%;
    height: 80%;
}

/* Main Navigation Tabs - Smaller & Sleeker */
.main-tabs-nav {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    background: #f1f3f5;
    padding: 4px;
    border-radius: 12px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.main-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 12px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-family: inherit;
    font-weight: 700;
    font-size: 0.85rem;
    color: #636E72;
    border-radius: 8px;
    transition: var(--transition);
}

.main-tab i {
    font-size: 0.9rem;
}

.main-tab.active {
    background: white;
    color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(123, 25, 40, 0.15);
}

.main-tab:not(.active):hover {
    background: rgba(255, 255, 255, 0.5);
    color: var(--primary-color);
}

/* Section Navigation Buttons */
.section-nav-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s;
    border: 1px solid #ddd;
    background: #fff;
    color: #444;
}

.nav-btn:hover {
    background: #f8f9fa;
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.nav-btn.primary {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

.nav-btn.primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 4px 12px rgba(123, 25, 40, 0.2);
}

.main-tab.active {
    background: white;
    color: var(--primary-color);
    box-shadow: 0 4px 15px rgba(123, 25, 40, 0.1);
}

.main-tab i {
    transition: transform 0.3s;
}

.main-tab.active i {
    transform: scale(1.1);
}

.main-tab:not(.active):hover {
    background: rgba(255, 255, 255, 0.6);
    color: var(--primary-color);
}

.main-section {
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.main-section.hidden {
    display: none;
    opacity: 0;
    transform: translateY(10px);
}

.view-tabs.visual-tabs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    border-bottom: none;
    margin-bottom: 30px;
    padding-bottom: 0;
}

.view-tabs.visual-tabs .view-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 10px 5px;
    background: #fff;
    border: 2px solid #eee;
    border-radius: 12px;
    color: #636E72;
}

.view-tabs.visual-tabs .view-tab:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(123, 25, 40, 0.1);
}

.view-tabs.visual-tabs .view-tab.active {
    border-color: var(--primary-color);
    background: rgba(123, 25, 40, 0.05);
    color: var(--primary-color);
}

.view-thumb {
    width: 50px;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.view-thumb svg {
    max-width: 100%;
    max-height: 100%;
}

.view-tabs.visual-tabs span {
    font-weight: 600;
    font-size: 0.85rem;
}

.section-title {
    font-size: 1.2rem;
    margin-bottom: 20px;
    font-weight: 700;
}

.part-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    overflow-x: visible;
    padding-bottom: 5px;
}

.part-btn {
    padding: 10px 18px;
    border: 2px solid #EEE;
    border-radius: 30px;
    background: white;
    cursor: pointer;
    font-family: inherit;
    font-weight: 500;
    transition: all 0.3s;
    white-space: nowrap;
    flex: 0 0 auto;
    font-size: 0.9rem;
}

.part-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(197, 31, 71, 0.05);
}

/* Color Palette and Logo Library */
.color-palette {
    animation: fadeIn 0.4s ease;
}

.logo-library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
    gap: 10px;
    max-height: 148px;
    overflow-y: auto;
    padding-inline-end: 6px;
}

.library-logo-item {
    aspect-ratio: 1;
    border: 2px solid #EEE;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    transition: all 0.2s;
    background: white;
}

.library-logo-item:hover,
.library-logo-item.active {
    border-color: var(--primary-color);
    background: rgba(197, 31, 71, 0.05);
}

.library-logo-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
}

.palette-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.back-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    border: none;
    background: transparent;
    color: var(--primary-color);
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
}

.colors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(45px, 1fr));
    gap: 12px;
}

.colors-grid.mini-grid {
    grid-template-columns: repeat(auto-fill, minmax(30px, 1fr));
    gap: 8px;
    margin-top: 10px;
}

.mini-grid .color-option {
    width: 30px;
    height: 30px;
    border-width: 2px;
}

.color-option {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
}

.color-option:hover {
    transform: scale(1.15);
}

.color-option.selected {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px var(--primary-color);
}

/* Design Lab Panel Styles */
.design-lab-panel {
    animation: fadeIn 0.4s ease;
}

/* Color row and fields */
.design-color-row {
    display: flex;
    gap: 15px;
    align-items: flex-end;
}

.design-color-field {
    flex: 1;
}

.color-picker-input {
    width: 100%;
    height: 40px;
    border-radius: 8px;
    border: 2px solid #eee;
    cursor: pointer;
    padding: 2px;
    transition: border-color 0.3s;
}

.color-picker-input:hover {
    border-color: var(--primary-color);
}

/* Stagger option */
.stagger-option {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 15px;
    background: rgba(0, 0, 0, 0.03);
    padding: 12px;
    border-radius: 10px;
}

.stagger-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
    flex-shrink: 0;
}

.stagger-label {
    margin: 0 !important;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1.4;
}

.design-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.design-type-tab {
    flex: 1;
    padding: 10px;
    border: 1px solid #EEE;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 500;
}

.design-type-tab.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.design-section {
    margin-bottom: 25px;
}

.location-options {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 10px;
    padding-bottom: 4px;
}

.location-option {
    position: relative;
    flex: 0 0 auto;
}

.location-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.location-option span {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 46px;
    min-width: 120px;
    padding: 10px 14px;
    border: 2px solid #eee;
    border-radius: 10px;
    background: #fff;
    color: var(--text-color);
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.location-option span::before {
    content: "";
    width: 18px;
    height: 18px;
    border: 2px solid #c9c9c9;
    border-radius: 50%;
    background: #fff;
    box-shadow: inset 0 0 0 4px #fff;
    transition: var(--transition);
    flex-shrink: 0;
}

.location-option input:checked+span {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(197, 31, 71, 0.05);
}

.location-option input:checked+span::before {
    border-color: var(--primary-color);
    background: var(--primary-color);
}

.location-options-empty {
    padding: 12px 14px;
    border: 1px dashed var(--border-color);
    border-radius: 10px;
    color: var(--text-muted);
    background: #fff;
    min-width: 100%;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    font-size: 0.9rem;
    color: #636E72;
    margin-bottom: 8px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #EEE;
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus {
    border-color: var(--primary-color);
    outline: none;
}

.w-full {
    width: 100%;
}

.active-designs {
    border-top: 1px solid #EEE;
    padding-top: 20px;
}

.small-title {
    font-size: 0.95rem;
    color: #636E72;
    margin-bottom: 12px;
}

.design-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.design-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: white;
    border: 1px solid #EEE;
    border-radius: 8px;
    font-size: 0.9rem;
}

.design-item-info {
    display: flex;
    flex-direction: column;
}

.design-item-type {
    font-weight: 700;
    color: var(--primary-color);
}

.design-item-loc {
    font-size: 0.8rem;
    color: #B2BEC3;
}

.remove-btn-small {
    background: #FF7675;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.8rem;
}

/* Actions Area */
.action-footer {
    margin-top: 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.group-btn {
    display: flex;
    gap: 10px;
}

.btn {
    padding: 12px 25px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-weight: 700;
    transition: all 0.3s;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    background: #DFE6E9;
    color: #2D3436;
}

.btn-success {
    background: #00B894;
    color: white;
}

.hidden {
    display: none;
}

/* Footer */
/* Footer styles */
.site-footer {
    text-align: center;
    padding: 2rem 1rem 3rem;
    margin-top: 2rem;
}

.footer-content {
    max-width: 600px;
    margin: 0 auto;
    padding: 2rem;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border-top: 4px solid var(--primary-color);
}

.footer-icon {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.footer-content h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 1.4rem;
}

.footer-content p {
    color: var(--text-muted);
}

/* Summary Box - Inline */
.summary-box {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid #eee;
    width: 100%;
    transition: all 0.3s ease;
    margin-bottom: 20px;
}

.summary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.progress-badge {
    background: var(--bg-color);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--border-color);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 0.8rem;
}

.progress-fill {
    height: 100%;
    background: var(--primary-color);
    width: 0%;
    transition: width 0.4s ease;
}

.summary-list {
    list-style: none;
    font-size: 0.9rem;
    color: var(--text-muted);
    padding: 0;
}

.summary-list li {
    margin-bottom: 6px;
    padding: 8px 10px;
    border-radius: 8px;
    background: #fcf1f4;
    border: 1px solid rgba(123, 25, 40, 0.05);
    border-bottom: 1px dashed var(--border-color);
}

.summary-list li strong {
    color: var(--primary-color);
    display: block;
    font-size: 0.75rem;
}

.empty-summary {
    font-style: italic;
    opacity: 0.7;
    border-bottom: none !important;
}

.btn-whatsapp {
    background-color: var(--success);
    color: #fff;
    border: none;
    padding: 1rem 1.5rem;
    border-radius: 50px;
    font-family: inherit;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    justify-content: center;
}

.btn-whatsapp:hover {
    background-color: var(--success-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(37, 211, 102, 0.4);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: var(--card-bg);
    padding: 2.5rem 2rem;
    border-radius: var(--radius);
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: var(--shadow-lg);
    border-bottom: 4px solid var(--primary-color);
}

.alert-icon {
    font-size: 4rem;
    color: var(--primary-light);
    margin-bottom: 1rem;
}

.modal-content h2 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.modal-content p {
    margin-bottom: 1.5rem;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* PDF Overlay */
.pdf-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.pdf-overlay.hidden {
    display: none !important;
}

.pdf-spinner {
    border: 5px solid #f3f3f3;
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: pdfSpin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes pdfSpin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.pdf-overlay p {
    font-size: 1.2rem;
    color: var(--primary-color);
    font-weight: 600;
}

/* Location Marker */
.location-marker {
    position: absolute;
    transform: translate(-50%, -50%);
    width: 24px;
    height: 24px;
    border: 2px dashed rgba(123, 25, 40, 0.5);
    border-radius: 50%;
    background-color: rgba(123, 25, 40, 0.1);
    pointer-events: none;
    z-index: 5;
    display: flex;
    justify-content: center;
    align-items: center;
}

.location-marker::after {
    content: '';
    width: 6px;
    height: 6px;
    background-color: rgba(123, 25, 40, 0.7);
    border-radius: 50%;
}

.location-marker .tooltip-text {
    position: absolute;
    bottom: 110%;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    white-space: nowrap;
    opacity: 0.5;
}

/* =======================================
   RESPONSIVE DESIGN
   ======================================= */

/* Tablet Landscape / Small Desktop */
@media (max-width: 1100px) {
    .designer-layout {
        gap: 25px;
    }

    .preview-section {
        padding: 25px;
        min-height: 400px;
    }

    .designer-card {
        padding: 25px 20px;
    }
}

/* Tablet Portrait */
@media (max-width: 968px) {
    .designer-layout {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .designer-wrapper {
        padding: 0;
    }

    .container {
        padding: 0 15px;
    }

    .main-header {
        margin-bottom: 0;
        padding: 1.5rem 1rem;
    }

    .store-logo {
        max-width: 180px;
    }

    .header-content p {
        font-size: 0.95rem;
    }

    .preview-section {
        min-height: auto;
        padding: 20px 15px;
        position: sticky;
        top: 0;
        z-index: 100;
        background: white;
        border-radius: 0;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    }

    .jacket-preview svg {
        max-height: 280px;
    }

    .designer-card {
        padding: 25px 15px;
        border-radius: 20px 20px 0 0;
        margin-top: -15px;
        position: relative;
        z-index: 101;
        box-shadow: 0 -8px 20px rgba(0, 0, 0, 0.05);
    }

    /* Controls Header */
    .controls-header {
        flex-wrap: wrap;
        gap: 12px;
    }

    /* View Tabs */
    .view-tabs.visual-tabs {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
        margin-bottom: 20px;
    }

    .view-tabs.visual-tabs .view-tab {
        padding: 8px 4px;
    }

    .view-thumb {
        width: 40px;
        height: 40px;
    }

    .view-tabs.visual-tabs span {
        font-size: 0.75rem;
    }

    /* Part Buttons - horizontal scroll */
    .part-buttons {
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
        padding-bottom: 8px;
    }

    .part-buttons::-webkit-scrollbar {
        display: none;
    }

    .part-btn {
        flex-shrink: 0;
    }

    /* Details row - stack on tablet */
    .details-row {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .details-field {
        min-width: 120px;
    }

    /* Summary */
    .summary-list li strong {
        display: block;
        margin-bottom: 4px;
    }

    /* Section Title */
    .section-title {
        font-size: 1.1rem;
        margin-bottom: 15px;
    }

    /* Design Lab - ensure proper stacking */
    .design-lab-panel {
        margin-top: 20px;
    }

    .design-lab-panel .form-group {
        margin-bottom: 12px;
    }

    /* Footer */
    .site-footer {
        padding: 1.5rem 1rem 2rem;
    }

    .footer-content {
        padding: 1.5rem;
    }

    .footer-content h3 {
        font-size: 1.2rem;
    }
}

/* Mobile */
@media (max-width: 600px) {
    .main-header {
        padding: 1rem 0.75rem;
    }

    .store-logo {
        max-width: 150px;
    }

    .header-content p {
        font-size: 0.85rem;
        margin-bottom: 0.5rem;
    }

    .social-icon {
        width: 35px;
        height: 35px;
        font-size: 1.1rem;
    }

    .container {
        padding: 0 10px;
    }

    .preview-section {
        padding: 15px 10px;
    }

    .jacket-preview svg {
        max-height: 220px;
    }

    .designer-card {
        padding: 20px 12px;
    }

    /* Controls header - stack on small mobile */
    .controls-header {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px;
    }

    .controls-header h3 {
        text-align: center;
    }

    .controls-actions {
        display: flex;
        justify-content: center;
        gap: 8px;
        flex-wrap: wrap;
    }

    .controls-header .btn,
    .controls-header .icon-btn {
        padding: 8px 14px;
        font-size: 0.85rem;
    }

    .icon-btn span {
        font-size: 0.8rem;
    }

    /* Details panel - stack vertically on mobile */
    .details-row {
        flex-direction: column !important;
        gap: 10px;
    }

    .details-field {
        min-width: unset !important;
        flex: unset !important;
        width: 100%;
    }

    /* Form fields */
    .form-group input,
    .form-group select {
        padding: 10px;
        font-size: 0.9rem;
    }

    /* View Tabs */
    .view-tabs.visual-tabs {
        grid-template-columns: repeat(4, 1fr);
        gap: 6px;
    }

    .view-tabs.visual-tabs .view-tab {
        padding: 6px 2px;
        border-radius: 10px;
    }

    .view-thumb {
        width: 35px;
        height: 35px;
    }

    .view-tabs.visual-tabs span {
        font-size: 0.7rem;
    }

    /* Part buttons */
    .part-btn {
        padding: 8px 14px;
        font-size: 0.8rem;
    }

    /* Colors grid */
    .colors-grid {
        grid-template-columns: repeat(auto-fill, minmax(38px, 1fr));
        gap: 8px;
    }

    .color-option {
        width: 38px;
        height: 38px;
    }

    /* Section titles */
    .section-title {
        font-size: 1rem;
        margin-bottom: 12px;
    }

    /* Design Lab on mobile - full width stacking */
    .design-lab-panel {
        margin-top: 15px;
    }

    .design-tabs {
        gap: 6px;
    }

    .design-type-tab {
        padding: 8px;
        font-size: 0.85rem;
    }

    .location-options {
        gap: 8px;
        padding-bottom: 2px;
    }

    .location-option span {
        min-width: 108px;
        padding: 9px 12px;
        font-size: 0.84rem;
    }

    .logo-library-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        max-height: 156px;
    }

    /* Color row stacks vertically on mobile */
    .design-color-row {
        flex-direction: column;
        gap: 10px;
    }

    .design-color-field {
        width: 100%;
    }

    .color-picker-input {
        height: 45px;
    }

    /* Stagger option mobile */
    .stagger-option {
        padding: 10px;
    }

    .stagger-label {
        font-size: 0.82rem;
    }

    /* Range slider on mobile */
    #design-text-size,
    #design-logo-size {
        width: 100% !important;
    }

    /* Text color + border color side by side on mobile */
    #text-section>.form-group {
        width: 100%;
    }

    /* Summary box */
    .summary-box {
        padding: 15px 12px;
    }

    .summary-header {
        font-size: 0.9rem;
    }

    .summary-list {
        font-size: 0.82rem;
    }

    /* WhatsApp button */
    .btn-whatsapp {
        padding: 0.85rem 1rem;
        font-size: 1rem;
    }

    /* Part selector */
    .part-selector {
        margin-bottom: 15px !important;
    }
}

/* Extra small mobile */
@media (max-width: 380px) {
    .store-logo {
        max-width: 120px;
    }

    .jacket-preview svg {
        max-height: 180px;
    }

    .designer-card {
        padding: 15px 10px;
    }

    .view-tabs.visual-tabs {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }

    .view-tabs.visual-tabs .view-tab {
        flex-direction: row;
        gap: 6px;
        padding: 8px 10px;
    }

    .view-thumb {
        width: 30px;
        height: 30px;
    }

    .controls-actions .btn {
        flex: 1;
        justify-content: center;
    }

    .btn-whatsapp {
        font-size: 0.9rem;
        padding: 0.75rem;
    }
}



/* Final mobile/product UX adjustments */
.controls-actions .icon-btn {
    width: 46px;
    height: 46px;
    padding: 0;
    justify-content: center;
    border-radius: 50%;
}

.controls-actions .icon-btn span {
    display: none !important;
}

.controls-actions .icon-btn i,
.controls-actions .icon-btn svg {
    width: 21px;
    height: 21px;
    margin: 0;
}

.size-stepper {
    display: flex;
    align-items: center;
    gap: 15px;
    background: #f1f3f5;
    padding: 6px;
    border-radius: 14px;
    width: fit-content;
}

.step-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: none;
    background: white;
    color: var(--primary-color);
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.step-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

.step-btn:active {
    transform: scale(0.95);
}

.size-value-badge {
    min-width: 60px;
    text-align: center;
    font-weight: 800;
    color: var(--text-main);
    font-size: 1rem;
}

.border-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #f8f9fa;
    padding: 8px 12px;
    border-radius: 12px;
    border: 1px solid #eee;
}

.mini-stepper {
    gap: 8px !important;
    padding: 4px !important;
    background: white !important;
    border: 1px solid #eee;
}

.mini-stepper .step-btn {
    width: 32px !important;
    height: 32px !important;
    font-size: 0.9rem !important;
}

.mini-stepper .size-value-badge {
    min-width: 30px !important;
    font-size: 0.9rem !important;
}

/* Toggle Switch Styles */
.switch-container {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.switch-container input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}

.switch-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .switch-slider {
    background-color: var(--primary-color);
}

input:checked + .switch-slider:before {
    transform: translateX(20px);
}

.design-overlay.text-item svg {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
}

.design-overlay.logo-item img,
.design-overlay.logo-item svg {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain;
}

.summary-price-item {
    display: grid !important;
    grid-template-columns: 32px 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 10px 12px !important;
    margin-bottom: 8px;
    background: #fff !important;
    border-radius: 10px !important;
    border: 1px solid #eee !important;
}

.summary-item-icon {
    width: 32px;
    height: 32px;
    background: var(--bg-color);
    color: var(--primary-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .9rem;
}

.summary-item-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.summary-item-label {
    font-weight: 700;
    color: var(--text-muted);
    font-size: .82rem;
}

.summary-item-value {
    font-weight: 800;
    color: var(--primary-color);
    font-size: .9rem;
    overflow-wrap: anywhere;
}

.summary-item-price {
    color: #166534;
    background: #dcfce7;
    border: 1px solid #bbf7d0;
    border-radius: 999px;
    padding: 4px 8px;
    font-size: .78rem;
    font-weight: 900;
    white-space: nowrap;
}

.summary-total-row {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 10px;
    padding: 12px 14px !important;
    background: var(--primary-color) !important;
    color: #fff !important;
    border: 0 !important;
    border-radius: 12px !important;
    font-weight: 900;
}

.summary-total-row strong {
    color: #fff !important;
    font-size: 1rem !important;
}

@media(max-width:968px) {
    .preview-section {
        position: sticky !important;
        top: 0 !important;
        z-index: 1000 !important;
        min-height: 260px;
    }

    .designer-card {
        z-index: 1 !important;
    }

    .jacket-preview-wrapper {
        max-height: 300px;
    }
}

@media(max-width:600px) {
    .preview-section {
        padding: 8px 8px 10px !important;
        min-height: 230px;
    }

    .jacket-preview svg {
        max-height: 210px !important;
    }

    .jacket-preview-wrapper {
        max-height: 220px;
    }

    .controls-actions .icon-btn {
        width: 44px;
        height: 44px;
    }

    .summary-price-item {
        grid-template-columns: 28px 1fr auto;
        gap: 8px;
        padding: 9px 10px !important;
    }

    .summary-item-icon {
        width: 28px;
        height: 28px;
    }

    .summary-item-price {
        font-size: .7rem;
        padding: 3px 6px;
    }
}

/* User requested refinements: cleaner controls, no current-additions list, better delete icon, horizontal details on mobile */
.controls-title {
    font-size: 1.05rem;
    line-height: 1.4;
    color: var(--primary-color);
    letter-spacing: -.2px;
}

.active-designs,
.design-list {
    display: none !important;
}

.design-overlay .remove-design {
    display: flex !important;
    width: 24px !important;
    height: 24px !important;
    top: 0 !important;
    right: 0 !important;
    transform: translate(58%, -58%) !important;
    z-index: 30 !important;
    background: #e11d48 !important;
    color: #fff !important;
    border: 2px solid #fff !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .25) !important;
    font-size: 18px !important;
    line-height: 18px !important;
    font-weight: 900 !important;
    padding: 0 !important;
    opacity: .96 !important;
}

.design-overlay .remove-design:hover {
    transform: scale(1.08);
    background: #be123c !important;
}

.details-row {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 10px !important;
    align-items: end;
}

.details-field {
    min-width: 0 !important;
    width: auto !important;
}

.details-field label {
    font-size: .82rem;
    white-space: nowrap;
}

.details-field select {
    width: 100%;
    min-width: 0;
    padding: 10px 8px !important;
    font-size: .88rem !important;
    text-overflow: ellipsis;
}

@media(max-width:600px) {
    .controls-title {
        text-align: center;
        font-size: 1rem;
    }

    .details-row {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 7px !important;
    }

    .details-field {
        width: auto !important;
        min-width: 0 !important;
        flex: unset !important;
    }

    .details-field label {
        font-size: .72rem !important;
        margin-bottom: 5px !important;
    }

    .details-field select {
        padding: 9px 5px !important;
        font-size: .76rem !important;
        border-radius: 10px !important;
    }

    .design-overlay .remove-design {
        width: 22px !important;
        height: 22px !important;
        top: 0 !important;
        right: 0 !important;
        transform: translate(54%, -54%) !important;
        font-size: 17px !important;
    }
}
