/* ==========================================================================
   DAGANDA Service Hub Module CSS
   ========================================================================== */

/* 1. Layout & Common */
.main-container {
    display: flex;
    gap: 30px;
    max-width:var(--cont);
    width:100%;
    margin: 0 auto;
    padding: 0 20px;
}

.booking-flow { flex: 1; min-width: 0; }
.sticky-wrapper {
    width: 440px; /* 늘어난 폼 너비 수용 */
    position: sticky;
    top: 100px;
    height: fit-content;
}

/* 1.1 Page Title Area */
.page-title-area h1 {
    font-size: 32px; font-weight: 900; color: #0F172A;
    letter-spacing: -1px;
}
.page-title-area p {
    font-size: 16px; color: #64748B; line-height: 1.6;
}

.admin-only-section {
    background: #F8FAFC;
    border: 2px dashed #CBD5E1;
    transition: 0.3s;
    padding:.5rem
}
.admin-only-section:hover {
    border-color: var(--primary);
    background: #F1F5F9;
}
.border-dashed { border-style: dashed !important; }

/* 2. Step Sections */
.step-section {
    background: #fff;
    border-radius:var(--radius-sm);
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
    margin-bottom: 30px;
}

.step-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 30px;
}

.step-badge {
    width: 32px; height: 32px;
    background: var(--brand-dark); color: #fff;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 16px;
}

.step-title {
    font-size: 22px; font-weight: 800; color: var(--text-main);
}

/* 3. Category Tabs */
.sub-cat-tabs {
    display: flex;
    gap: 12px;
    margin-bottom: 30px;
    overflow-x: auto;
    padding-bottom: 5px;
}

.sub-tab {
    padding: 12px 28px;
    border: 1px solid var(--border);
    border-radius: 30px;
    font-size: 15px;
    font-weight: 700;
    color: var(--text-muted);
    background: #fff;
    white-space: nowrap;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.sub-tab:hover {
    border-color: #CBD5E1;
    background: var(--bg-pale);
}

.sub-tab.active {
    background: var(--brand-dark);
    border-color: var(--brand-dark);
    color: white;
    box-shadow: 0 8px 20px rgba(11, 40, 96, 0.2);
}

/* 4. Service Cards Grid */
.service-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.service-card {
    position: relative;
    padding: 30px;
    border: 2px solid var(--border-light);
    border-radius: 20px;
    background: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.service-card:hover {
    border-color: var(--border);
    transform: translateY(-4px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.05);
}

.service-card.selected {
    border-color: var(--secondary);
    background: var(--secondary-light);
}

.check-circle {
    position: absolute; top: 20px; right: 20px;
    width: 24px; height: 24px;
    border: 2px solid var(--border);
    border-radius: 50%;
    transition: all 0.3s;
}

.service-card.selected .check-circle {
    background: var(--secondary);
    border-color: var(--secondary);
}
.service-card.selected .check-circle::after {
    content: '✓'; color: #fff; font-size: 14px;
    display: flex; align-items: center; justify-content: center; height: 100%;
}

.srv-icon { font-size: 32px; margin-bottom:0px; }
.srv-title { font-size: 18px; font-weight: 800; color: var(--text-main); margin-bottom: 8px; }
.srv-desc { font-size: 14px; color: var(--text-muted); line-height: 1.5; margin-bottom: 20px; }
.srv-price { display:none;font-size: 17px; font-weight: 800; color: var(--secondary); }

/* 4.1 ACF Form Area Refinement (Now inside Sidebar) */
.dgd-apply-form-area {
    background: #fff;
    border-top: 1px dashed var(--border);
    padding-top: 20px;
}

/* 선택 서비스 필드 강제 숨김 */
.acf-field[data-name="linked_service"],
.acf-field[data-key="field_inquiry_linked_service"] {
    display: none !important;
}

.form-mini-title {
    font-size: 15px; font-weight: 800; color: var(--brand-dark);
    display: flex; align-items: center; gap: 6px;
}

.acf-field {
    border: none !important;
    padding: 8px 0 !important;
}

.acf-label label {
    font-size: 13px !important;
    font-weight: 700 !important;
    color: var(--text-main) !important;
    margin-bottom: 6px !important;
}

.acf-input input, .acf-input select, .acf-input textarea {
    border-radius: 8px !important;
    border: 1px solid var(--border) !important;
    padding: 10px 14px !important;
    font-size: 14px !important;
    background: var(--bg-pale) !important;
}

.acf-input input:focus, .acf-input textarea:focus {
    border-color: var(--secondary) !important;
    box-shadow: 0 0 0 3px rgba(0, 86, 255, 0.1) !important;
    background: #fff !important;
}

/* 4.2 Dynamic Service Guide Area */
.guide-area-wrap {
    display: flex; flex-direction: column; gap: 20px;
}

.guide-item {
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding:0px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.02);
}

.guide-item-title {
    font-size: 18px; font-weight: 800; color: var(--text-main);
    margin-bottom: 15px;
    display: flex; align-items: center; gap: 8px;
}
.guide-item-title i { color: var(--secondary); }

.guide-content-flex {
    display: flex; gap: 20px;
    align-items: flex-start;
}

.guide-img {
    flex:1;
    border-radius: 12px; overflow: hidden;
}

.guide-desc {
    flex: 1; font-size: 15px; color: var(--text-muted); line-height: 1.6;
}

.empty-guide {
    background: var(--bg-pale); text-align: center; padding: 40px 20px;
}

@media (max-width: 768px) {
    .guide-content-flex { flex-direction: column; }
    .guide-img { flex: none; width: 100%; }
}

/* 4.3 Affiliate Mini Cards in Guide */
.aff-section {
    border-top: 1px solid var(--border-light);
    padding-top: 20px;
    margin-top: 25px;
}
.aff-title {
    font-size: 15px; font-weight: 800; color: var(--text-main);
    margin-bottom: 15px; display: flex; align-items: center; gap: 6px;
}
.aff-title i { color: var(--secondary); }

.aff-mini-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

.aff-mini-card {
    background: var(--bg-pale);
    border-radius: 12px;
    padding: 15px;
    transition: all 0.2s;
}
.aff-mini-card:hover { transform: translateY(-3px); box-shadow: 0 4px 10px rgba(0,0,0,0.05); }

.aff-region {
    display: inline-block;
    font-size: 11px; font-weight: 700; color: var(--secondary);
    background: rgba(0, 86, 255, 0.1);
    padding: 2px 8px; border-radius: 4px; margin-bottom: 6px;
}

.aff-name { font-size: 14px; font-weight: 800; color: var(--text-main); margin-bottom: 4px; }
.aff-contact { font-size: 12px; color: var(--text-muted); }
.aff-contact i { font-size: 14px; vertical-align: middle; }

.summary-card {
    background: #fff;
    border-radius:var(--radius-sm);
    padding: 35px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.06);
    border: 1px solid rgba(0,0,0,0.05);
}

.summary-title {
    font-size: 20px; font-weight: 800; color: var(--text-main);
    margin-bottom: 25px; padding-bottom: 15px;
    border-bottom: 2px solid var(--border-light);
}

.sum-row {
    display: flex; justify-content: space-between; align-items: flex-start;
    margin-bottom: 15px; gap: 15px;
}
.sum-label { font-size: 14px; color: #94A3B8; font-weight: 600; }
.sum-val { font-size: 15px; color: var(--text-main); font-weight: 700; text-align: right; }

.membership-promo {
    margin: 25px 0;
    padding: 20px;
    background: var(--bg-pale);
    border-radius: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s;
}
.membership-promo:hover { background: var(--border-light); }
.membership-promo.active { background: var(--primary-light); border: 1px solid #7DD3FC; }

.promo-text h4 { font-size: 14px; font-weight: 800; color: var(--primary); margin-bottom: 4px; }
.promo-text p { font-size: 13px; color: var(--text-muted); }

.toggle-switch {
    width: 44px; height: 24px;
    background: #CBD5E1;
    border-radius: 20px;
    position: relative;
    transition: all 0.3s;
}
.toggle-switch::after {
    content: ''; position: absolute; top: 2px; left: 2px;
    width: 20px; height: 20px; background: #fff;
    border-radius: 50%; transition: all 0.3s;
}
.membership-promo.active .toggle-switch { background: var(--secondary); }
.membership-promo.active .toggle-switch::after { left: 22px; }

.total-row {
    display:none;
    margin-top: 25px;
    padding-top: 25px;
    border-top: 1px dashed var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.total-label { font-size: 16px; font-weight: 800; color: var(--text-main); }
.original-price { font-size: 14px; color: #94A3B8; text-decoration: line-through; text-align: right; }
.total-price { font-size: 26px; font-weight: 900; color: var(--secondary); text-align: right; }
.total-price span { font-size: 16px; font-weight: 500; margin-left: 2px; }

/* 6. Buttons */
.btn-submit {
    display: block; width: 100%;
    padding: 18px;
    background: #E2E8F0;
    color: #94A3B8;
    border-radius: 16px;
    text-align: center;
    font-size: 16px;
    font-weight: 800;
    border: none;
    transition: all 0.3s;
    cursor: default;
}

.btn-submit.ready {
    background: var(--secondary);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(0, 86, 255, 0.2);
}
.btn-submit.ready:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 15px 25px rgba(0, 86, 255, 0.3);
}

/* 7. Responsive */
@media (max-width: 1024px) {
    .main-container { flex-direction: column; }
    .sticky-wrapper { width: 100%; position: static; }
    .service-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .step-section { padding: 25px; }
    .trust-title { font-size: 28px; }
}

/* 6. Service List Shortcode [service_list] */
.dgd-service-list-wrapper { width: 100%; margin: 40px 0; }

.dgd-service-grid {
    display: grid;
    gap: 20px;
}
.dgd-service-grid.col-2 { grid-template-columns: repeat(2, 1fr); }
.dgd-service-grid.col-3 { grid-template-columns: repeat(3, 1fr); }
.dgd-service-grid.col-4 { grid-template-columns: repeat(4, 1fr); }

.dgd-service-item {
    display: block;
    text-decoration: none;
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    border: 1px solid var(--border);
}

.dgd-service-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(11, 40, 96, 0.08);
    border-color: #0056FF;
}

.dgd-service-item .item-inner {
    padding: 30px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Icon Type Style */
.dgd-service-item.type-icon .item-icon {
    width: 60px;
    height: 60px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #F8FAFC;
    border-radius: 16px;
    transition: 0.3s;
}

.dgd-service-item:hover .item-icon {
    background: #EEF2FF;
}

.dgd-service-item.type-icon .item-icon img {
    max-width: 32px;
    max-height: 32px;
    object-fit: contain;
}

/* Image Type Style */
.dgd-service-item.type-image {
    position: relative;
    height: 240px;
    border: none;
}

.dgd-service-item.type-image .item-inner {
    height: 100%;
    padding: 0;
    justify-content: flex-end;
}

.dgd-service-item.type-image .item-image {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-size: cover;
    background-position: center;
    transition: 0.5s;
}

.dgd-service-item.type-image:hover .item-image {
    transform: scale(1.1);
}

.dgd-service-item.type-image .item-image::after {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to bottom, transparent 0%, rgba(11, 40, 96, 0.8) 100%);
}

.dgd-service-item.type-image .item-info {
    position: relative;
    z-index: 2;
    padding: 30px;
    text-align: left;
    width: 100%;
}

.dgd-service-item.type-image .item-title { color: #fff; }
.dgd-service-item.type-image .item-desc { color: rgba(255,255,255,0.7); }

/* Typography */
.item-title {
    font-size: 18px;
    font-weight: 800;
    color: #0F172A;
    margin-bottom: 8px;
    transition: 0.3s;
}

.dgd-service-item:hover .item-title {
    color: #0056FF;
}

.item-desc {
    font-size: 14px;
    color: #64748B;
    line-height: 1.5;
    margin: 0;
}

/* Responsive */
@media (max-width: 992px) {
    .dgd-service-grid.col-3, .dgd-service-grid.col-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 576px) {
    .dgd-service-grid.col-2, .dgd-service-grid.col-3, .dgd-service-grid.col-4 { grid-template-columns: 1fr; }
}
