:root {
    --bg: #f8f9fb;
    --panel: #ffffff;
    --border: #e3e7ee;
    --text: #1e2433;
    --muted: #6f7891;
    --accent: #4285F4;
    --radius: 14px;
    --shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
}

body {
    background-color: var(--bg);
}

.product-detail-page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px 0;
}

/* Main Section: Thumbnail + Order Info */
.product-main-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: start;
    padding: 24px;
    background-color: var(--panel);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.product-thumbnail-container .main-thumbnail {
    width: 100%;
    border-radius: var(--radius);
}

.product-order-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.product-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.product-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
    margin: 0;
}

.best-seller-badge {
    background-color: var(--accent);
    color: white;
    font-size: 12px;
    font-weight: bold;
    padding: 4px 8px;
    border-radius: 6px;
}

.product-description {
    font-size: 16px;
    color: var(--muted);
    line-height: 1.6;
}

.price-tier-card, .order-card {
    background: var(--bg); /* Slightly different background for cards inside */
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
}

.price-tier-card h2 {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 16px 0;
    color: var(--text);
}

.price-tier-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.price-tier-table th, .price-tier-table td {
    text-align: left;
    padding: 10px;
    border-bottom: 1px solid var(--border);
}

.price-tier-table th {
    color: var(--muted);
    font-weight: 500;
}

.price-tier-table tr:last-child td {
    border-bottom: none;
}

.price-tier-table td:last-child {
    text-align: right;
    font-weight: 600;
}

.quantity-selector {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.quantity-selector label {
    font-size: 16px;
    font-weight: 500;
}

.quantity-input-wrapper {
    display: flex;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 8px;
}

.quantity-input-wrapper button {
    background: transparent;
    border: none;
    color: var(--accent);
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    padding: 8px 12px;
}

.quantity-input-wrapper input {
    width: 60px;
    text-align: center;
    border: none;
    font-size: 16px;
    font-weight: 500;
    background: transparent;
    -moz-appearance: textfield;
}

.quantity-input-wrapper input::-webkit-outer-spin-button,
.quantity-input-wrapper input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.total-price-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    margin-top: 10px;
}

.total-price-section span:first-child {
    font-size: 16px;
    font-weight: 600;
}

.total-price-section span:last-child {
    font-size: 24px;
    font-weight: bold;
    color: var(--accent);
}

.action-buttons {
    margin-top: 12px;
}

.btn.primary {
    width: 100%;
    background: var(--accent);
    color: #fff;
    display: block;
    text-align: center;
    padding: 14px 0;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background-color 0.2s;
}
.btn.primary:hover {
    background:#357AE8;
}

/* Content Section: Detail Images */
.product-content-section {
    margin-top: 48px;
    text-align: center;
}

.content-divider {
    border-top: 1px solid var(--border);
    margin: 48px auto;
    width: 80%;
}

.product-content-section h2 {
    font-size: 24px;
    margin-bottom: 32px;
    color: var(--text);
}

.product-detail-images {
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center;
}

.product-detail-images img {
    max-width: 800px; /* Limit width of detail images */
    width: 100%;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

/* Responsive Styles */
@media(max-width: 900px) {
    .product-main-section {
        grid-template-columns: 1fr;
        gap: 32px;
    }
}

/* Product Options Section */
.product-options-section {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-top: 24px;
    padding: 22px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.option-group-header {
    margin-bottom: 16px;
}

.option-group-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 4px 0;
}

.option-group-header p {
    font-size: 14px;
    color: var(--muted);
    margin: 0;
}

.attribute-selector {
    margin-bottom: 20px;
}
.attribute-selector:last-child {
    margin-bottom: 0;
}

.option-quantity-selector {
    margin-top: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background-color: #f0f2f5; /* A slightly different background */
    border-radius: 10px;
}

.option-quantity-selector .attribute-label {
    margin-bottom: 10px; /* Override default margin */
}

/* Reuse existing quantity input styles, but make sure they apply */
.option-quantity-selector .quantity-input-wrapper {
    border: 1px solid var(--border);
    border-radius: 8px;
    display: flex;
    align-items: center;
    background-color: #fff;
}

.option-quantity-selector .quantity-input-wrapper button {
    background: transparent;
    border: none;
    color: var(--accent);
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    padding: 8px 12px;
}

.option-quantity-selector .quantity-input-wrapper input {
    width: 50px;
    text-align: center;
    border: none;
    font-size: 16px;
    font-weight: 500;
    background: transparent;
    -moz-appearance: textfield;
}

.option-quantity-selector .quantity-input-wrapper input::-webkit-outer-spin-button,
.option-quantity-selector .quantity-input-wrapper input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Image Select Style */
.image-select-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
    margin-top:10px;
}

.image-select-item {
    border: 2px solid var(--border);
    border-radius: 10px;
    padding: 10px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    background-color: var(--panel);
}

.image-select-item:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.image-select-item.selected {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent);
}

.image-select-item img {
    width: 100%;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 8px;
}

.image-select-item .item-info {
    text-align: center;
}

.image-select-item .item-value {
    font-size: 14px;
    font-weight: 600;
    display: block;
}

.image-select-item .item-description {
    font-size: 12px;
    color: var(--muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-top: 4px;
}


/* Dropdown Style */
.dropdown-container {
    position: relative;
    margin-top:10px;
}

.dropdown-select {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background-color: var(--panel);
    font-size: 15px;
    color: var(--text);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 6L8 10L12 6' stroke='%236F7891' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

/* Input Box Style */
.input-box-container {
    position: relative;
    margin-top:10px;
}

.input-box-text {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background-color: var(--panel);
    font-size: 15px;
    color: var(--text);
}

.input-box-text::placeholder {
    color: var(--muted);
}

/* Helper class to hide conditional options */
.hidden {
    display: none;
}

/* Styling for nested (child) options */
.child-attribute-container {
    margin-top: 20px;
    margin-left: 20px;
    padding-left: 20px;
    border-left: 3px solid var(--border);
}

/* 디자인 방법 선택하기 레이어 팝업 */
.layer-popup-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}
.inner-popup {
    display:flex;
    flex-direction: column;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    position: relative;
    max-width: 757px;
}
.inner-popup .popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    padding:20px 30px;
    background:#F8F8F8;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
}
.inner-popup .popup-header .pop-title {
    font-size:16px;
    font-weight:500;
    color:#252525;
}
.inner-popup .popup-header img {
    cursor: pointer;
}
.inner-popup .popup-content {
    display: flex;
    justify-content: space-around;
    padding: 20px 30px 30px 30px;
    gap:20px;
    background:#F2F2F2;
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
}
.inner-popup .popup-content.pd5 {
    padding:5px;
}
.inner-popup .popup-content .content-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    cursor: pointer;
    text-align: left;
    padding:19px 26px;
    background:#FFFFFF;
    border-radius: 10px;
    border:1px solid #D9D9D9;
}
.inner-popup .popup-content .content-item img {
    margin-bottom: 50px;
}
.inner-popup .popup-content .content-item .content-title {
    font-size:18px;
    font-weight:700;
    color:#4285F4;
    margin-bottom:5px;
}
.inner-popup .popup-content .content-item .content-description {
    font-size:16px;
    font-weight: 500;
    color:#555555;
    line-height:1.5;
}

/* 디자인 파일 업로드 레이어 팝업 */
.inner-popup .popup-content .content-job-info {
    display:flex;
    flex-direction: column;
}
.inner-popup .popup-content .content-job-info .job-info-header {
    padding-bottom:13px;
    margin-bottom:13px;
    border-bottom:1px solid #D9D9D9;
}
.inner-popup .popup-content .content-job-info .job-info-header .job-title {
    font-size:16px;
    font-weight:700;
    color:#555;
}
.inner-popup .popup-content .content-job-info .job-notes {
    font-size:14px;
    font-weight:500;
    color:#555;
    line-height: 1.5;
}
.inner-popup .popup-content .file-upload-area {
    padding:40px 50px;
    border-radius: 10px;
    background:#fff;
    display:flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.inner-popup .popup-content .file-upload-area .btn-file-upload {
    background: var(--accent);
    color: #fff !important;
    padding:10px 60px;
    font-size:16px;
    font-weight:700;
    border-radius: 100px;
    margin-top:10px;
    margin-bottom:13px;
}
.inner-popup .popup-content .file-upload-area .btn-file-upload:hover {
    background:#357AE8;
}
.inner-popup .popup-content .file-upload-area .file-type-notice {
    font-size:14px;
    font-weight: 500;
    color:#AEAEAE;
}

/* 내 디자인 불러오기 레이어 팝업 */
.inner-popup .popup-content .tab-wrap {
    display: flex;
    flex-direction: column;
    width:100%;
}
.inner-popup .popup-content .tab-wrap .tab-menu {
    display: flex;
    align-items: center;
}
.inner-popup .popup-content .tab-wrap .tab-menu .tab-item {
    padding:10px;
    width:50%;
    text-align: center;
    font-size:16px;
    font-weight:500;
    color:#AEAEAE;
    width:373px;
    cursor: pointer;
    border-bottom:2px solid #D9D9D9;
}
.inner-popup .popup-content .tab-wrap .tab-menu .tab-item.on {
    color:#4285F4;
    border-bottom: 2px solid #4285F4;
    background:#fff;
}
.inner-popup .popup-content .tab-wrap .tab-content {
    padding:5px;
    width:100%;
    max-width: 747px;
    height: 275px;
    background:#fff;
}
.inner-popup .popup-content .tab-wrap .tab-content .no-design {
    font-size:16px;
    font-weight:500;
    color:#787A7D;
    text-align: center;
    line-height: 275px;
}
.inner-popup .popup-content .tab-wrap .tab-content .design-list {
    display: flex;
    flex-wrap: wrap;
    gap:10px;
    padding:10px;
    overflow-y: auto;
    height: 275px;
}
.inner-popup .popup-content .tab-wrap .tab-content .design-list .design-item {
    width: 130px;
    height: 163px;
    padding: 10px;
    cursor: pointer;
    display:flex;
    flex-direction: column;
    align-items: flex-start;
}
.inner-popup .popup-content .tab-wrap .tab-content .design-list .design-item .design-thumb {
    position:relative;
    border-radius: 5px;
    margin-bottom:5px;
    width:110px;
    height:110px;
    display:flex;
    justify-content: center;
    align-items: center;
}
.inner-popup .popup-content .tab-wrap .tab-content .design-list .design-item .design-thumb .img-thumb {
    width:110px;
    height:110px;
    /* border-radius: 5px; */
    object-fit:contain;
    border:1px solid #d9d9d9;
}
.inner-popup .popup-content .tab-wrap .tab-content .design-list .design-item .design-thumb .check-icon {
    position:absolute;
    top:0;
    left:0;
    width:110px;
    height:110px;
    background: rgba(66, 133, 244, 0.25);
    display:none;
    justify-content: center;
    align-items: center;
    border-radius: 5px;
    outline: 2px solid var(--accent);
    outline-offset: -1px;
}
.inner-popup .popup-content .tab-wrap .tab-content .design-list .design-item .design-thumb .check-icon.on {
    display:flex;
}
.inner-popup .popup-content .tab-wrap .tab-content .design-list .design-item .design-title {
    font-size:11px;
    font-weight: 600;
    color:#aeaeae;
}
.inner-popup .popup-content .tab-wrap .tab-content .design-list .design-item .design-date {
    font-size:11px;
    font-weight: 600;
    color:#aeaeae;
    line-height: 1.3;
}
.inner-popup .popup-content .tab-wrap .tab-bottom {
    padding: 10px;
    text-align: right;
}
.inner-popup .popup-content .tab-wrap .tab-bottom .btn-edit-design {
    padding:10px 27px;
    background:#AEAEAE;
    font-size:16px;
    font-weight:700;
    color:#fff !important;
    border-radius: 10px;
}
.inner-popup .popup-content .tab-wrap .tab-bottom .btn-edit-design.on {
    background: var(--accent);
}
.inner-popup .popup-content .tab-wrap .tab-bottom .btn-edit-design.on:hover {
    background:#357AE8;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}