:root {
    --top-bar-bg: #c85b34;
    --main-header-bg: #1a1719;
    --sub-header-bg: #252022;
    --left-panel-bg: #efe8dd;
    --text-color: #242424;
    --text-muted: #6f6f6f;
    --accent-color: #d97a3a;
    --accent-hover: #bd6328;
    --border-color: #e6ddd0;
    --panel-shadow: 0 18px 42px rgba(20, 20, 20, 0.08);
}

html, body {
    margin: 0;
    min-height: 100%;
    font-family: "Inter", Arial, sans-serif;
    color: var(--text-color);
    background: #f3f2f0;
}

.fs-7 { font-size: 0.8rem; }
.fs-10 { font-size: 10px; }
.fs-13 { font-size: 13px; }
.fs-14 { font-size: 14px; }
.fs-15 { font-size: 15px; }
.fw-semibold { font-weight: 600; }
.cursor-pointer { cursor: pointer; }

.top-bar {
    background: var(--top-bar-bg);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.03em;
}

.main-header {
    background: var(--main-header-bg);
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.logo {
    color: #fff !important;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.brand-mark img {
    height: 60px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 6px 12px rgba(0,0,0,0.22));
}

.brand-copy {
    display: flex;
    flex-direction: column;
    line-height: 1;
}

.brand-copy strong {
    font-size: 28px;
    letter-spacing: 0.08em;
    color: #fff4ea;
}

.brand-copy small {
    margin-top: 4px;
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #c7b7aa;
}

.main-nav-links .nav-link,
.sub-nav-links .nav-link {
    color: #fff !important;
    text-decoration: none;
}

.main-nav-links .nav-link:hover,
.sub-nav-links .nav-link:hover {
    color: #ffd6a8 !important;
}

.search-bar .form-control,
.search-bar .btn {
    height: 46px;
    background: #fff;
}

.search-bar .form-control:focus {
    box-shadow: none;
}

.sub-header {
    background: var(--sub-header-bg);
    border-bottom: 0 !important;
}

.custom-made-btn {
    background: linear-gradient(135deg, #fff7f0, #f3e5d3) !important;
    border-radius: 14px 0 0 14px;
    color: #111 !important;
    box-shadow: 0 12px 24px rgba(0,0,0,0.12);
}

.custom-made-subtitle {
    color: #8e684e;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.wrapper-area {
    min-height: calc(100vh - 132px);
    padding: 0;
}

.design-container {
    width: 100%;
}

.left-panel {
    min-height: calc(100vh - 132px);
    background:
        radial-gradient(circle at 20% 20%, rgba(217,122,58,0.14), transparent 24%),
        radial-gradient(circle at 80% 18%, rgba(41, 33, 35, 0.1), transparent 24%),
        linear-gradient(180deg, #f7f2ea 0%, var(--left-panel-bg) 100%);
    padding: 2rem 2rem 0;
}

.right-panel {
    min-height: calc(100vh - 132px);
    background: linear-gradient(180deg, #fffdfa 0%, #fff 100%);
    border-left: 1px solid var(--border-color);
}

.stage-tools .btn,
.stage-switch .btn,
.btn-white {
    border-radius: 6px;
}

.stage-switch {
    display: flex;
    align-items: center;
}

.product-image-container {
    min-height: 620px;
}

.cap-preview-stage {
    position: relative;
    width: min(100%, 900px);
    display: flex;
    justify-content: center;
    align-items: center;
    background:
        radial-gradient(circle at center, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.4) 45%, transparent 72%);
    border-radius: 44px;
}

.main-cap-img {
    width: min(100%, 740px);
    max-width: 100%;
    object-fit: contain;
    filter: drop-shadow(0 18px 32px rgba(0, 0, 0, 0.2));
}

.cap-design-zone {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.stage-grid-glow {
    position: absolute;
    top: 18%;
    left: 16%;
    width: 68%;
    height: 42%;
    border-radius: 26px;
    background:
        linear-gradient(135deg, rgba(255,255,255,0.34), transparent 60%),
        radial-gradient(circle at center, rgba(217,122,58,0.08), transparent 68%);
    filter: blur(10px);
}

.design-safe-area {
    position: absolute;
    top: 22%;
    left: 20%;
    width: 60%;
    height: 28%;
    border: 1px dashed rgba(255, 255, 255, 0.38);
    background: rgba(255, 255, 255, 0.03);
}

.design-item-box {
    position: absolute;
    top: 28%;
    left: 32%;
    width: 34%;
    min-height: 124px;
    border: 2px solid rgba(217,122,58,0.95);
    background: rgba(255, 255, 255, 0.02);
    box-shadow:
        0 20px 34px rgba(0, 0, 0, 0.14),
        0 0 0 1px rgba(255, 255, 255, 0.06);
    pointer-events: auto;
}

.design-action {
    position: absolute;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 50%;
    background: var(--accent-color);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 18px rgba(242, 138, 67, 0.28);
}

.design-delete { top: -16px; left: -16px; }
.design-rotate { top: -16px; right: -16px; }
.design-resize { right: -16px; bottom: -16px; }

.design-item-content {
    width: 100%;
    height: 100%;
}

.embroidery-surface {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 124px;
    overflow: hidden;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.1), transparent 30%),
        repeating-linear-gradient(135deg, rgba(255,255,255,0.06) 0 1px, rgba(0,0,0,0.03) 1px 4px),
        transparent;
}

.embroidery-sheen {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.18), transparent 38%);
    pointer-events: none;
}

.embroidered-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font: 700 72px Georgia, serif;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #fff;
    text-shadow:
        0 1px 0 rgba(255,255,255,0.2),
        0 2px 0 rgba(0,0,0,0.24),
        1px 0 0 rgba(255,255,255,0.15),
        -1px 0 0 rgba(255,255,255,0.15),
        0 0 6px rgba(255,255,255,0.2);
    mix-blend-mode: screen;
}

.embroidered-image {
    width: 100%;
    height: 100%;
    display: block;
    filter: drop-shadow(0 8px 14px rgba(0,0,0,0.18));
}

.is-hidden {
    display: none !important;
}

.thumbnail-item {
    border-radius: 2px;
    overflow: hidden;
    border: 2px solid transparent;
}

.active-thumb {
    border-color: var(--accent-color) !important;
}

.panel-screen {
    display: none;
    min-height: 100%;
}

.panel-screen.is-active {
    display: block;
}

.panel-header {
    background: transparent;
}

.technique-card {
    border-radius: 18px !important;
    border: 1px solid #efe4d8 !important;
    background: linear-gradient(180deg, rgba(255,255,255,0.95), rgba(249,244,237,0.95));
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.technique-card:hover:not(.technique-disabled),
.technique-card-active {
    border-color: var(--accent-color) !important;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
}

.technique-disabled {
    opacity: 0.65;
}

.icon-box {
    width: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.editor-topbar {
    height: 64px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
    background: linear-gradient(180deg, #fff8f2, #fff);
}

.icon-nav {
    width: 38px;
    height: 38px;
    border: 0;
    background: transparent;
    font-size: 22px;
    color: #2d2d2d;
}

.editor-body {
    background: transparent;
}

.add-grid-wrap {
    position: relative;
    border: 2px dashed #dac8b3;
    border-radius: 24px;
    padding: 12px;
    background: linear-gradient(180deg, rgba(255,250,244,0.9), rgba(255,255,255,0.9));
}

.add-grid-wrap::before {
    content: "+";
    position: absolute;
    top: -18px;
    left: -8px;
    color: var(--accent-color);
    font-size: 42px;
    line-height: 1;
}

.add-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.add-option-card {
    min-height: 106px;
    border: 0;
    border-radius: 16px;
    background: linear-gradient(180deg, #f7efe5, #fff);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 700;
    color: #3a3a3a;
}

.add-option-card i {
    font-size: 34px;
    color: var(--accent-color);
}

.editor-input,
.editor-select {
    border-color: #efefef;
    border-radius: 4px;
}

.editor-input:focus,
.editor-select:focus {
    box-shadow: none;
    border-color: #d6cfc7;
}

.font-preview-row {
    display: grid;
    grid-template-columns: 76px 1fr;
    gap: 10px;
}

.font-badge {
    border-radius: 4px;
    background: #171717;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font: 700 18px Georgia, serif;
}

.stepper-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 16px;
}

.stepper-btn {
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 4px;
    background: #f3f3f3;
    font-size: 28px;
    line-height: 1;
}

.control-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tool-btn {
    width: 40px;
    height: 40px;
    border: 1px solid #ececec;
    border-radius: 4px;
    background: #fff;
    color: #343434;
}

.tool-btn.is-active {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.slider-wrap .form-range {
    accent-color: #2f2f2f;
}

.color-palette {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.color-palette.compact {
    gap: 8px;
}

.thread-swatch {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 2px solid transparent;
    background-size: cover;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.thread-swatch.is-active {
    border-color: #20b569;
    box-shadow: 0 0 0 4px rgba(32, 181, 105, 0.12);
}

.chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.chip {
    border: 0;
    border-radius: 2px;
    padding: 6px 10px;
    background: #efefef;
    font-size: 13px;
}

.chip.is-active {
    background: #242424;
    color: #fff;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.gallery-card {
    border: 1px solid #ececec;
    background: #f7f7f7;
    min-height: 100px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.gallery-mark {
    font-size: 52px;
    line-height: 1;
    color: #111;
}

.gallery-label {
    font-size: 12px;
    color: #7a7a7a;
}

.upload-hero {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 146px;
    height: 38px;
    border-radius: 0;
    background: var(--accent-color);
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    cursor: pointer;
}

.upload-meta {
    font-size: 12px;
    color: #8b8b8b;
}

.panel-footer {
    background: linear-gradient(180deg, rgba(255,255,255,0.3), #fff 30%);
}

.btn-add-cart {
    background: linear-gradient(135deg, #2f2623, #1a1718);
    border: 0;
    border-radius: 14px !important;
    box-shadow: 0 18px 26px rgba(0,0,0,0.16);
}

.custom-scrollbar::-webkit-scrollbar { width: 7px; }
.custom-scrollbar::-webkit-scrollbar-thumb { background: #d5d1ca; }

@media (max-width: 1199.98px) {
    .design-item-box {
        top: 30%;
        left: 30%;
        width: 40%;
    }
}

@media (max-width: 991.98px) {
    .left-panel,
    .right-panel {
        min-height: auto;
    }

    .product-image-container {
        min-height: 420px;
    }

    .right-panel {
        border-left: 0;
        border-top: 1px solid var(--border-color);
    }

    .design-safe-area {
        top: 23%;
        left: 14%;
        width: 72%;
        height: 30%;
    }

    .design-item-box {
        top: 30%;
        left: 24%;
        width: 52%;
    }
}

@media (max-width: 767.98px) {
    .wrapper-area {
        padding: 0;
    }

    .left-panel {
        padding: 1rem 1rem 0;
    }

    .stage-switch {
        position: static !important;
        margin: 0 0 1rem auto !important;
        justify-content: flex-end;
    }

    .stage-tools {
        position: static !important;
        margin: 0 0 1rem 0 !important;
    }

    .add-grid,
    .gallery-grid {
        grid-template-columns: 1fr;
    }
}
