:root {
    --muted: #6b7280;
    /*--success: #28a745;*/
    --success: #c18bbc;
    --danger: #dc3545;

    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;

    --shadow-sm: 0 2px 6px rgba(0,0,0,.08);
    --shadow-md: 0 8px 24px rgba(0,0,0,.12);

    --space-xs: 6px;
    --space-sm: 10px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 40px;

    --transition: 0.25s ease;
    
    --primary: #4a64f7;
    --secondary: #c18bbc;
    --accent: #f1cbcb;
    --bg: #f2f2f2;
    --hover: #c6ff28;
    --text: #2d2d2d;
    --active: #007bff;

    --padding-content: 16px 12px;
    --padding-card: 12px;
    --padding-section: 24px;
}

/* =======================
   RESET
======================= */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: "Roboto", sans-serif;
    font-size: 16px;
    color: var(--text);
    background: var(--background);
}

a {
    text-decoration: none !important;
}


.no-scroll {
    overflow: hidden !important;
    height: 100%;
}

li {
    margin: 40px auto;
}
li strong,
li i {
    display: block;
}
li small {
    display: none;
}

/* ========================= PRELOADER ========================= */
#loading {
    background-color: var(--primary);
    height: 100%;
    width: 100%;
    position: fixed;
    z-index: 1;
    margin-top: 0px;
    top: 0px;
    z-index: 20000;
}

#loading-center {
    width: 100%;
    height: 100%;
    position: relative;
}

#loading-center-absolute {
    position: absolute;
    left: 50%;
    top: 50%;
    height: 40%;
    width: 450px;
    margin-top: -25px;
    margin-left: -75px;
}

.object {
    width: 16px;
    height: 40%;
    margin-right: 5px;
    background-color: #fff;
    -webkit-animation: animate-loading 1s infinite;
    animation: animate-loading 1s infinite;
    float: left;
}

.object:last-child {
    margin-right: 0px;
}

.object:nth-child(10) {
    -webkit-animation-delay: 0.9s;
    animation-delay: 0.9s;
}

.object:nth-child(9) {
    -webkit-animation-delay: 0.8s;
    animation-delay: 0.8s;
}

.object:nth-child(8) {
    -webkit-animation-delay: 0.7s;
    animation-delay: 0.7s;
}

.object:nth-child(7) {
    -webkit-animation-delay: 0.6s;
    animation-delay: 0.6s;
}

.object:nth-child(6) {
    -webkit-animation-delay: 0.5s;
    animation-delay: 0.5s;
}

.object:nth-child(5) {
    -webkit-animation-delay: 0.4s;
    animation-delay: 0.4s;
}

.object:nth-child(4) {
    -webkit-animation-delay: 0.3s;
    animation-delay: 0.3s;
}

.object:nth-child(3) {
    -webkit-animation-delay: 0.2s;
    animation-delay: 0.2s;
}

.object:nth-child(2) {
    -webkit-animation-delay: 0.1s;
    animation-delay: 0.1s;
}

@-webkit-keyframes animate-loading {
    50% {
        -ms-transform: translateX(-25px) scaleY(0.5);
        -webkit-transform: translateX(-25px) scaleY(0.5);
        transform: translateX(-25px) scaleY(0.5);
    }
}

@keyframes animate-loading {
    50% {
        -ms-transform: translateX(-25px) scaleY(0.5);
        -webkit-transform: translateX(-25px) scaleY(0.5);
        transform: translateX(-25px) scaleY(0.5);
    }
}

/* ========================= HEADER ===================== */
header {
    height: 70px;
    background: var(--secondary);
    display: flex;
    flex-direction: row;
    align-items: center;
    color: white;
    padding: var(--padding-content);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
    
}

header h1 {
    color: white;
    font-size: clamp(28px, 0.5vw + 0.75rem, 24px);
}

.logo {
    height: 100%;
    display: flex;
    flex-direction: row;
    gap: 12px;
    align-items: center;
}

header .logo img {
    height: 100%;
    width: auto;
}

.nav > li > a:focus,
.nav > li > a:hover {
    background: transparent !important;
}


/* ======== BACK BUTTON ======== */
.back-btn {
    background-color: transparent;
    color: #6c4cf1;
    font-size: 24px;
    padding: 10px 16px;
}

.back-btn:hover {
    color: #5840c2;
}

/* ======== TAB HEADERS ============ */

/* STEP */
.tab-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 13px;
    color: #999;
    width: 100%;
}

/* CIRCLE */
.step-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin-bottom: 6px;
    transition: all 0.3s ease;
}

/* ACTIVE STEP */
.tab-header.active .step-circle {
    background: #6c4cf1;
    color: white;
}

/* COMPLETED STEP */
.tab-header.completed .step-circle {
    background: #6c4cf1;
    color: white;
}

/* LABEL */
.tab-header span {
    text-align: center;
    font-size: 12px;
}

/* Tab content area */
.tab-content {
    padding: 20px;
}

.tab-blinds {
    flex-direction: column;
    align-items: center;
}

/* ======================= TABS ======================= */
/* Make tab content area scrollable with dynamic height */
.tab {
    display: none;
    flex-direction: column;
    overflow-y: auto;
    position: relative;
}

.tab.active {
    display: flex;
}

.tab-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    border: 1px solid #ddd;
    width: 100%;
    max-width: 1200px;
    margin: var(--space-xl) auto;
    padding: var(--space-xl);
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.tab-container:hover {
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}

.tab-headers {
    display: flex;
    border-bottom: 1px solid #e5e7eb;
}

.tab-header {
    flex: 1;
    padding: var(--space-sm);
    text-align: center;
    font-weight: 600;
    color: var(--muted);
}

.tab-header.active {
    color: var(--primary);
    border-bottom: 3px solid var(--primary);
}

/* Keep form-actions sticky at bottom */
.form-actions {
    width: 100%;
    position: sticky;
    bottom: 0;
    background: #fff;
    /* same as tab background */
    padding: 15px 0;
    display: flex;
    justify-content: space-around;
    border-top: 1px solid #ccc;
    z-index: 10;
    /* stay above scrolling content */
}

/* Input wrapper with labels and icons */
.input-wrapper {
    margin-bottom: 15px;
}

.input-wrapper label {
    display: flex;
    align-items: center;
    font-weight: 500;
    margin-bottom: 5px;
    color: #444;
}

.input-wrapper label i {
    margin-right: 8px;
    width: 20px;
    text-align: center;
}

/* ======== CUSTOMER DETAILS ============ */
.customer-details {
    display: flex;
    flex-direction: column;
    border-radius: var(--radius-lg);
    box-shadow: 0 6px 18px rgba(0, 0, 0, .08);
    padding: var(--padding-section);
    margin: 12px 6px;
}

.customer-details h3 {
    margin-bottom: 8px;
}

.customer-details p {
    margin-bottom: 20px;
}

.content .collapse {
    display: none;
}

.item-content {
    padding: 15px;
    display: none;
    background: #f1f8e9;
}

.item.active .item-content {
    display: block;
}

/* ==================== BLIND SELECTOR =================== */

.btn-open-selector {
    background-color: #fb66ff;
    color: var(--text);
    font-weight: 600;
    font-size: 14px;
    max-width: 320px;
    margin: 20px auto;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s ease-in-out, color 0.5s ease-in-out;
}

.btn-open-selector:hover {
    background-color: #fa66ffe0;
    color: #fff;
}

.modal {
    z-index: 100;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.97);
    transition: opacity 0.5s;
    display: block;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    border-bottom: 1px solid #ddd;
    color: #fff;
}

.modal-content {
    width: 90%;
    max-width: 800px;
    max-height: 80%;
    background-color: #fff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
    margin: 14px;
    height: 100%;
    overflow-y: auto;
    margin: 40px auto;
    animation: blind-open 0.5s;
}

.modal-hidden {
    opacity: 0;
    pointer-events: none;
    display: none;
}

.modal-hidden .modal-content {
    animation: blind-close 0.5s;
}

@keyframes blind-close {
    0% {
        transform: scaleY(1);
        transform-origin: top;
    }
    100% {
        transform: scaleY(0);
        transform-origin: top;
    }
}

.overlay {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 50%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    color: #fff;
    padding: 12px;
    border-radius: 0 0 10px 10px;
}

.overlay h3 {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 10px;
}

.overlay p {
    font-size: 14px;
    text-align: center;
}

/* ================ DIMENSIONS ================ */
.resizable-box {
    position: relative;
    width: 150px;
    height: 150px;
    background: rgba(108, 76, 241, 0.08);
    border: 2px solid #6c4cf1;
    border-radius: 6px;
}

/* Handles */
.resize-handle {
    position: absolute;
    background: #6c4cf1;
    opacity: 0.5;
    z-index: 10;
    opacity: 0.8;
}

/* Horizontal (height control) */
.resize-handle.top,
.resize-handle.bottom {
    height: 12px;
    width: 100%;
    cursor: ns-resize;
}

.resize-handle.top {
    top: -3px;
}

.resize-handle.bottom {
    bottom: -3px;
}

/* Vertical (width control) */
.resize-handle.left,
.resize-handle.right {
    height: 100%;
    width: 12px;
    cursor: ew-resize;
}

.resize-handle.left {
    left: -3px;
}

.resize-handle.right {
    right: -3px;
}

.dimensions {
    font-size: 16px;
    background: #fff;
    padding: 5px;
    margin: 20px auto;
    border: 1px solid #ccc;
    border-radius: 5px;
    display: inline-block;
}

.dimensions-container {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
}

.dimensions-box {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 14px;
    min-height: 600px;
}


#styles-container,
#fabrics-container,
#product-container {
    display: none;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
}

.blind-details {
    white-space: pre-wrap;
    font-size: 16px;
    font-weight: 600;
    color: white;
}

@keyframes bg-pos-anim {
    0% {
        background-position: top left;
    }
    25% {
        background-position: bottom left;
    }
    75% {
        background-position: bottom right;
    }
    100% {
        background-position: top right;
    }
}

.overlay h3 {
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.overlay p {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===================== Footer ===================== */
footer {
    background: var(--secondary);
    width: 100%;
    height: 80px;
    color: white;
    padding: var(--padding-content);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* ======================= FORMS ======================= */
form {
    color: var(--text);
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.form-group {
    align-items: flex-start;
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    width: 100%;
}

label {
    font-weight: 600;
}

.input-field {
    padding: 12px;
    font-size: 15px;
    border-radius: var(--radius-sm);
    border: 1px solid #d1d5db;
    transition: border var(--transition), box-shadow var(--transition);
    margin-bottom: 12px;
    display: block;
    width: 100%;
}

.input-field:focus-visible {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(74,100,247,.15);
}

.input-field.valid {
    border-color: var(--success);
}

.input-field.invalid {
    border-color: var(--danger);
}

/* ======== GLOBAL BUTTONS ============ */
button {
    font-family: inherit;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-align: center;
    outline: none;
}

/* Disabled State */
button:disabled {
    background-color: #d1d5db;
    color: #6b7280;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ======== PRIMARY BUTTONS ======== */
.next-btn,
.primary-btn {
    background-color: #6c4cf1;
    color: #fff;
    padding: 12px 28px;
    font-size: 16px;
}

.next-btn:hover:not(:disabled),
.primary-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108,76,241,0.25);
}

.next-btn:active,
.primary-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(108,76,241,0.25);
}

/* ======== SECONDARY BUTTONS ======== */
.secondary-btn {
    background-color: #ff69b4;
    color: #fff;
    padding: 12px 24px;
    font-size: 15px;
}

.secondary-btn:hover:not(:disabled) {
    background-color: #ff3b8f;
}

/* ======== ADD BUTTON ======== */
.add-blind-btn {
    width: 90%;
    max-width: 400px;
    background-color: #ede8ed;
    color: #184fff;
    font-size: 15px;
    padding: 14px;
    font-weight: 600;
    border-radius: 8px;
    margin: 20px auto;
    transition: all 0.3s ease;
}

.add-blind-btn span {
    font-size: 14px;
}

.add-blind-btn:hover:not(:disabled) {
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.add-blind-btn:active:not(:disabled) {
    border: 2px solid #6c4cf1;
}

/* ======== REMOVE BUTTON ======== */
.remove-btn {
    width: 32px;
    height: 32px;
    background-color: red;
    color: #fff;
    font-size: 16px;
    border-radius: 50%;
    position: absolute;
    top: -12px;
    right: -12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.remove-btn:hover {
    transform: scale(1.1);
}

.remove-btn:active {
    box-shadow: 0 0 10px rgba(0,0,0,0.6);
}

/* ======== NAVIGATION BUTTONS ======== */
.prev-btn {
    background-color: #f1f1f1;
    color: #333;
    padding: 12px 28px;
    font-size: 16px;
}

.prev-btn:hover:not(:disabled) {
    background-color: #e0e0e0;
}

.next-btn {
    background-color: #6c4cf1;
    color: #fff;
    padding: 12px 28px;
    font-size: 16px;
}

.next-btn:hover:not(:disabled) {
    background-color: #5840c2;
}

/* ======== DOWNLOAD PDF BUTTON ======== */
#download-pdf-btn {
    background: linear-gradient(135deg, #ff8c00, #ff6a00);
    color: #fff;
    padding: 14px 28px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(255,140,0,0.25);
    transition: all 0.25s ease;
}

#download-pdf-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(255,140,0,0.35);
}

#download-pdf-btn:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 3px 10px rgba(255,140,0,0.25);
}

#download-pdf-btn:focus {
    outline: 2px solid rgba(255,140,0,0.4);
    outline-offset: 3px;
}

#download-pdf-btn:disabled {
    background-color: #ccc;
    color: #888;
    cursor: not-allowed;
    box-shadow: none;
}

/* ======================= CARDS ======================= */
.card {
    position: relative;
    border-radius: 10px;
    border: 1px solid #ddd;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
    display: inline-block;
    margin: 10px;
    padding: 10px;
    cursor: pointer;
    opacity: 0;
    transform: scale(0.5);
    transition: opacity 0.5s, transform 0.5s;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.card.animate {
    opacity: 1;
    transform: scale(1);
}

/* ======================= MAIN ======================= */
main {
    padding: var(--space-xl);
    min-height: calc(100vh - 140px);
}

/* ======================= BLINDS - STEP 2 ======================= */

#blinds-container { 
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 20px 0;
    border-radius: 4px;
    width: 100%;
    padding: 0 14px;
    min-height: 400px;
}

/* Card */
.blind-container {
    position: relative;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 6px 18px rgba(0,0,0,.08);
    padding: 18px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.blind-container:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 24px rgba(0,0,0,.12);
}

.blind {
    position: relative;
    margin: 40px;
    padding: 20px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    border-radius: 5px;
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
}

.resizable-box {
    position: relative;
    width: 150px;
    height: 150px;
    background: lightgray;
    border: 2px solid #333;
    overflow: hidden;
    min-width: 75px;
    min-height: 75px;
    max-width: 400px;
    max-height: 400px;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    background: #f8f9fa;
    border-radius: 12px;
    color: #777;
    font-size: 15px;
}

/* Layout */
.blind-body {
    display: flex;
    gap: 18px;
    align-items: flex-start;
}

/* Image */
.blind-image {
    width: 140px;
    min-width: 140px;
    height: 140px;
    border-radius: 10px;
    object-fit: cover;
}

/* Info */
.blind-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

/* Title */
.blind-name {
    font-size: 18px;
    font-weight: 600;
    line-height: 1.3;
}

/* Description */
.blind-desc {
    font-size: 14px;
    color: #555;
    line-height: 1.5;
}

/* Meta */
.blind-meta {
    display: flex;
    flex-wrap: wrap; /* important for responsiveness */
    gap: 12px;
    font-size: 13px;
    font-weight: 600;
    color: #333;
}

/* ======================= STEP 3 - REVIEW QUOTE =====================*/
.blinds-table tfoot tr {
    background: #fafafa;
}

.blinds-table tfoot tr.grand-total-row {
    background: #f2f7ff;
    font-size: 16px;
}

.blinds-table tfoot tr.grand-total-row td {
    border-top: 2px solid #003366;
    font-weight: 700;
}

.table-wrapper {
    width: 100%;
    overflow-x: auto;
}

.blinds-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 700px;
}

.blinds-table th,
.blinds-table td {
    padding: 12px;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
    vertical-align: middle;
    white-space: normal;      
    word-break: break-word;   
}

.blinds-table th {
    background: #f9fafb;
    font-weight: 600;
    font-size: 14px;
    min-width: 120px;
}

.blind-thumb {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
}

.qty-input {
    width: 60px;
    padding: 6px;
}

.price {
    font-weight: 600;
    white-space: nowrap;
}

.error-row {
    color: #b91c1c;
    font-style: italic;
}

.total-row td {
    border-top: 2px solid #111;
    font-size: 16px;
}

.total-row .price {
    font-weight: 700;
}

.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(6px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.3s ease;
}

.loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.spinner {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 5px solid #e5e7eb;
    border-top-color: #2563eb;
    animation: spin 1s linear infinite;
}

.loading-overlay p {
    margin-top: 16px;
    font-size: 0.95rem;
    color: #374151;
    font-weight: 500;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* =============== INSTALLATION OPTION ================= */
.installation-option {
    margin: 25px 0;
    display: flex;
    justify-content: center;
}

.install-card {
    width: 100%;
    max-width: 720px;
    background: linear-gradient(135deg, #f8fbff, #eef6ff);
    border: 1px solid #d6e8ff;
    border-radius: 14px;
    padding: 18px 22px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.08);
}

.install-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(0, 102, 204, 0.15);
}

.install-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.install-left input[type="checkbox"] {
    width: 22px;
    height: 22px;
    accent-color: #0066cc;
    cursor: pointer;
}

.install-text h4 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #003366;
}

.install-text p {
    margin: 4px 0 0 0;
    font-size: 14px;
    color: #555;
}

.install-badge {
    background: #0066cc;
    color: #fff;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 20px;
    letter-spacing: 0.5px;
}

/* Checked state styling */
.install-left input[type="checkbox"]:checked + .install-text h4 {
    color: #0066cc;
}

.install-left input[type="checkbox"]:checked ~ .install-badge {
    background: #004a99;
}

/* ===================== RESPONSIVE ===================== */
@media (max-width: 768px) {
    main {
        padding: 1%!important;
    }

    .tab-content {
        padding: 0;
    }
    
    .quote-container {
        margin: 10px;
        padding: 15px;
    }

    .blind {
        margin: 10px;
    }
    
    .blinds-table {
        min-width: 600px;
    }

    .blind-thumb {
        width: 48px;
        height: 48px;
    }

    .blind-body {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .blind-image {
        width: 100%;
        max-width: 250px;
        height: auto;
    }

    .blind-meta {
        justify-content: center;
    }

    .blind-name {
        font-size: 16px;
    }

    .blind-desc {
        font-size: 13px;
    }

    /* Make container clean */
    .tab-headers {
        overflow: hidden;
        justify-content: center;
    }
}
