/* 
 * product-card.css 
 * Premium UI Standardization for Product Catalog
 */

:root {
    --primary-color: #19AA6D;
    --primary-light: #f0fafa;
}

/* Premium Modal Buttons (Ultra) */
.btn-primary-custom {
    height: 58px;
    background: linear-gradient(135deg, #19AA6D 0%, #15945d 100%);
    color: #ffffff !important;
    border: none;
    border-radius: 14px;
    font-size: 1.15rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 6px 20px rgba(25, 170, 109, 0.3);
    cursor: pointer;
    letter-spacing: -0.01em;
    text-decoration: none !important;
}

.btn-primary-custom:hover {
    background: linear-gradient(135deg, #1dc17c 0%, #19AA6D 100%);
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 12px 35px rgba(25, 170, 109, 0.45);
}

.btn-outline-primary-custom {
    height: 58px;
    background: #ffffff;
    color: #19AA6D !important;
    border: 2px solid #19AA6D !important;
    border-radius: 14px;
    font-size: 1.15rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    cursor: pointer;
    letter-spacing: -0.01em;
    text-decoration: none !important;
}

.btn-outline-primary-custom:hover {
    background: #f0fdf4;
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(25, 170, 109, 0.15);
}

.imweb-container { width: 94%; max-width: none; margin: 0 auto; }

/* Category Header Section */
.category-header {
    background-color: #f8fafc;
    padding: 60px 0;
    margin-bottom: 2rem;
    border-bottom: 1px solid #f1f5f9;
}

/* Filter Buttons */
.filter-btn {
    display: inline-block;
    padding: 0.7rem 1.8rem;
    border-radius: 50px;
    background-color: #fff;
    border: 1.5px solid #e2e8f0;
    color: #475569;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none !important;
    transition: all 0.3s ease;
    cursor: pointer;
}

.filter-btn:hover {
    background-color: #f1f5f9;
    color: #1a1a1a;
    border-color: #cbd5e1;
    transform: translateY(-2px);
}

.filter-btn.active {
    background-color: #19AA6D;
    color: #fff !important;
    border-color: #19AA6D;
    box-shadow: 0 4px 12px rgba(25, 170, 109, 0.25);
}

/* Flex Gap Utility (Bootstrap 4 fallback) */
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 0.75rem; }
.gap-3 { gap: 1rem; }

/* Category Header Section */
.category-header {
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
    padding: 80px 0 60px;
    margin-bottom: 40px;
    border-bottom: 1px solid #f1f5f9;
    text-align: center;
}

.category-header h1 {
    font-weight: 900;
    font-size: 3rem;
    letter-spacing: -2px;
    color: #111;
    margin-bottom: 15px;
}

.category-header p {
    font-size: 1.15rem;
    color: #64748b;
    font-weight: 500;
}

/* Filter Buttons Wrapper */
.filter-container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 60px;
    padding: 0 20px;
}

/* Filter Buttons */
.filter-btn {
    display: inline-flex;
    align-items: center;
    padding: 10px 24px;
    border-radius: 50px;
    background-color: #fff;
    border: 1.5px solid #e2e8f0;
    color: #64748b;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.filter-btn:hover {
    background-color: #f8fafc;
    color: #1e293b;
    border-color: #cbd5e1;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.filter-btn.active {
    background-color: #19AA6D;
    color: #fff !important;
    border-color: #19AA6D;
    box-shadow: 0 8px 20px rgba(25, 170, 109, 0.3);
}

/* Gap Utilities (Bootstrap 4 Fallback) */
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 0.75rem; }
.gap-3 { gap: 1rem; }
.gap-4 { gap: 1.5rem; }

.product-card-premium { 
    background: transparent; border: none; border-radius: 0; overflow: visible; 
    height: 100%; display: flex; flex-direction: column; cursor: pointer; 
    position: relative; text-align: left; margin-bottom: 0; 
}

.card-img-panel { 
    background-color: #fff; 
    position: relative; 
    aspect-ratio: 1 / 1; 
    width: 100%;
    display: flex; 
    align-items: center; 
    justify-content: center; 
    overflow: hidden; 
    border: 1px solid #e5e5e5; 
    border-radius: 0;
    margin-bottom: 15px;
    transition: all 0.3s ease;
    padding: 3%;
}

.product-card-premium:hover .card-img-panel { border-color: #bbb; opacity: 0.85; }
.card-img-panel img { width: 100%; height: 100%; object-fit: contain; }

.card-content { padding: 0; background: transparent; display: flex; flex-direction: column; align-items: flex-start; }
.card-title { 
    color: #333; 
    font-size: 1.125rem; /* 18px */
    font-weight: 700; 
    margin-bottom: 8px; 
    line-height: 1.45;
    word-break: keep-all;
    letter-spacing: -0.6px;
    height: 2.9em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.card-price { 
    display: flex;
    align-items: baseline;
    gap: 4px;
    margin-top: 2px;
    white-space: nowrap; /* 가격정보 전체 한 줄 고정 */
}

.price-label {
    font-size: 1rem;
    font-weight: 800;
    color: #475569;
    white-space: nowrap; /* '급여가' 텍스트 한 줄 고정 */
}

.price-value {
    font-size: 1.4rem;
    font-weight: 900;
    color: #1a1a1a;
    letter-spacing: -0.7px;
    white-space: nowrap;
}

.price-unit {
    font-size: 1rem;
    font-weight: 700;
    color: #1a1a1a;
    white-space: nowrap;
}

/* Backwards compatibility for plain span inside card-price */
.card-price span:not(.price-label):not(.price-value):not(.price-unit) { 
    font-weight: 500; 
    font-size: 14px; 
    margin-left: 1px; 
    white-space: nowrap;
}

/* Premium Card Footer Buttons */
.card-footer-btns {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    width: 100%;
}

.btn-detail-sm {
    flex: 1;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-light);
    border: 1.5px solid var(--primary-color);
    border-radius: 10px; /* 둥근 캡슐에서 원래의 세련된 둥근 네모(10px)로 롤백 */
    color: var(--primary-color);
    font-size: 0.92rem; /* 14.72px */
    font-weight: 700;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    text-decoration: none !important;
    white-space: nowrap; /* 원천적으로 강제 한 줄 정렬 */
}

.btn-detail-sm:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(25, 170, 109, 0.25);
}

.btn-apply-sm {
    flex: 1.4;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #19AA6D 0%, #15945d 100%);
    border: none;
    border-radius: 10px; /* 둥근 캡슐에서 원래의 세련된 둥근 네모(10px)로 롤백 */
    color: #fff !important;
    font-size: 0.95rem; /* 15.2px */
    font-weight: 800;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(25, 170, 109, 0.25);
    cursor: pointer;
    text-decoration: none !important;
    white-space: nowrap; /* 원천적으로 강제 한 줄 정렬 */
}

.btn-apply-sm:hover {
    background: linear-gradient(135deg, #1dc17c 0%, #19AA6D 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(25, 170, 109, 0.4);
}

.btn-apply-sm i {
    margin-right: 6px;
    font-size: 0.85rem;
    opacity: 0.9;
}

/* 모바일용 프리미엄 버튼 및 컨텐츠 최적화 (768px 이하로 타겟 범위 확장) */
@media (max-width: 768px) {
    .card-footer-btns {
        gap: 5px !important;
        margin-top: 15px !important;
    }
    
    .btn-detail-sm {
        height: 38px !important;
        border-radius: 8px !important; /* 모바일 모서리 둥근 네모(8px)로 통일 */
        font-size: 0.74rem !important; /* 텍스트 크기 미세 축소 */
        padding: 0 4px !important;
        white-space: nowrap !important;
        flex: 1 !important; /* 1대1.1 비율 유지 */
    }
    
    .btn-apply-sm {
        height: 38px !important;
        border-radius: 8px !important; /* 모바일 모서리 둥근 네모(8px)로 통일 */
        font-size: 0.76rem !important; /* 텍스트 크기 미세 축소 */
        padding: 0 4px !important;
        white-space: nowrap !important;
        flex: 1.1 !important; /* 1대1.1 비율 유지 */
    }
    
    .btn-detail-sm i, .btn-apply-sm i {
        font-size: 0.72rem !important;
        margin-right: 3px !important;
    }

    /* 모바일용 카드 본문 리사이징 */
    .product-card-premium {
        margin-bottom: 10px;
    }
    
    .card-img-panel {
        margin-bottom: 10px !important;
        border-radius: 8px !important; /* 모바일 모서리 둥글게 */
    }
    
    .card-content {
        padding: 5px !important;
    }
    
    .card-title {
        font-size: 0.95rem !important;
        line-height: 1.35 !important;
        margin-bottom: 6px !important;
        height: 2.7em !important;
    }
    
    .card-subtitle {
        font-size: 0.82rem !important;
        margin-bottom: 8px !important;
    }
    
    .card-price {
        font-size: 1rem !important;
        margin-top: 4px !important;
    }
    
    .price-label {
        font-size: 0.8rem !important;
    }
    
    .price-value {
        font-size: 1.15rem !important;
    }
    
    .price-unit {
        font-size: 0.8rem !important;
    }
}

/* ============================================================
   Premium Modal Styles (Consolidated & Upgraded)
   ============================================================ */

:root {
    --modal-primary: #19AA6D;
    --modal-primary-hover: #15945d;
    --modal-accent: #29abbd;
    --modal-bg-light: #f8fafc;
    --modal-price-color: #ff5252;
}

/* Modal Core Overrides */
#productModal .modal-content, 
#detailModal .modal-content { 
    border-radius: 20px !important; 
    border: none !important; 
    box-shadow: 0 25px 60px rgba(0,0,0,0.15) !important; 
    overflow: hidden; 
}
#productModal .modal-body { padding: 0 !important; }

/* 2-Column Split Layout */
.modal-split-container { display: flex; flex-wrap: wrap; }

.modal-left-panel { 
    flex: 0 0 45%; 
    background: #f8f9fa; 
    padding: 40px; 
    border-right: 1px solid #edf2f7; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    max-height: 85vh;
    overflow-y: auto;
}

.modal-right-panel { 
    flex: 0 0 55%; 
    padding: 40px; 
    display: flex; 
    flex-direction: column; 
    max-height: 85vh; 
    overflow-y: auto;
}

@media (max-width: 991px) {
    .modal-left-panel, .modal-right-panel { flex: 0 0 100%; border-right: none; max-height: none; }
    .modal-left-panel { padding: 30px; border-bottom: 1px solid #edf2f7; }
    .modal-right-panel { padding: 30px; }
}

/* Left Panel Content */
.modal-product-img { 
    max-width: 100%; 
    max-height: 320px; 
    object-fit: contain; 
    border-radius: 12px;
    transition: transform 0.3s ease;
}
.modal-product-img:hover { transform: scale(1.02); }

.modal-badge { 
    display: inline-block; 
    padding: 5px 14px; 
    background: #ebf5ff; 
    color: #3182ce; 
    border-radius: 6px; 
    font-size: 0.75rem; 
    font-weight: 800; 
    margin-bottom: 15px; 
    letter-spacing: -0.2px;
}

.modal-title { 
    font-size: 1.75rem; 
    font-weight: 900; 
    color: #1a1a1a; 
    margin-bottom: 8px; 
    line-height: 1.25; 
    word-break: keep-all;
}

.modal-brand { 
    font-size: 1rem; 
    color: #888; 
    font-weight: 600; 
    margin-bottom: 25px; 
    display: block; 
}

/* Price Box */
.modal-price-box { 
    background: #fff; 
    border: 1px solid #e2e8f0; 
    border-radius: 14px; 
    padding: 16px 20px; 
    margin-bottom: 20px; 
    width: 100%;
}

.modal-price-label { 
    font-size: 0.85rem; 
    color: #64748b; 
    font-weight: 700; 
    margin-bottom: 4px; 
    display: block; 
}

.modal-price-value { 
    font-size: 1.85rem; 
    font-weight: 900; 
    color: var(--modal-price-color); 
    letter-spacing: -1px; 
}
.modal-price-unit { font-size: 1.1rem; margin-left: 2px; }

/* Section Titles */
.modal-section-title { 
    font-size: 1rem; 
    font-weight: 800; 
    color: #1a202c; 
    margin: 24px 0 12px 0; 
    display: flex; 
    align-items: center; 
}
.modal-section-title::before { 
    content: ''; 
    width: 4px; 
    height: 16px; 
    background: var(--modal-primary); 
    border-radius: 2px; 
    margin-right: 10px; 
}

/* Recipient Grid & Forms */
.recipient-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}
.grid-full { grid-column: span 2; }

.input-field { 
    height: 48px; 
    border-radius: 10px !important; 
    border: 1.5px solid #e2e8f0 !important; 
    padding: 0 16px !important; 
    font-size: 0.95rem !important; 
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); 
    background-color: #fff !important;
}
.input-field:focus { 
    border-color: var(--modal-primary) !important; 
    box-shadow: 0 0 0 4px rgba(25, 170, 109, 0.1) !important; 
    outline: none; 
}

.form-control::placeholder { color: #cbd5e1; font-weight: 400; }

/* Option Chips */
.option-chips-container { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 5px; }
.option-chip { 
    padding: 10px 18px; 
    border-radius: 10px; 
    border: 1.5px solid #edf2f7; 
    background: #fff; 
    color: #4a5568; 
    font-size: 0.9rem; 
    font-weight: 700; 
    cursor: pointer; 
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}
.option-chip:hover { 
    border-color: var(--modal-primary); 
    background: #f0fff4; 
}
.option-chip.active { 
    background: #f0fff4; 
    color: var(--modal-primary); 
    border-color: var(--modal-primary); 
    box-shadow: 0 4px 12px rgba(25, 170, 109, 0.12); 
    transform: translateY(-1px);
}

.color-preview-swatch {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1px solid rgba(0,0,0,0.1);
    display: inline-block;
}

/* Quantity Control */
.quantity-row { 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    padding: 15px 5px;
}
.quantity-control { 
    display: flex; 
    align-items: center; 
    border: 1.5px solid #e2e8f0; 
    border-radius: 12px; 
    background: #fff; 
    overflow: hidden; 
}
.quantity-btn { 
    width: 44px; 
    height: 44px; 
    border: none; 
    background: #fff; 
    font-size: 1.25rem; 
    font-weight: 400; 
    color: #64748b; 
    transition: 0.2s; 
    cursor: pointer;
}
.quantity-btn:hover { background: #f8fafc; color: #1a202c; }
.quantity-input { 
    width: 50px; 
    text-align: center; 
    border: none; 
    border-left: 1px solid #f1f5f9; 
    border-right: 1px solid #f1f5f9; 
    font-weight: 800; 
    font-size: 1.1rem; 
    color: #1a202c;
    background: transparent;
}

/* Summary Row */
.total-price-row { 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    padding: 20px 5px;
    border-top: 1.5px dashed #edf2f7;
    margin-top: 10px;
}
.total-label { font-size: 1.1rem; font-weight: 800; color: #1a202c; }
.total-value { 
    font-size: 2.3rem; 
    font-weight: 900; 
    color: var(--modal-price-color); 
    letter-spacing: -1.5px; 
}

/* Footer & Buttons */
.modal-footer-custom { 
    padding: 30px 40px; 
    background: #fff; 
    border-top: 1px solid #f1f5f9; 
}

.btn-action { 
    height: 60px; 
    border-radius: 14px; 
    font-weight: 800; 
    font-size: 1.15rem; 
    border: none; 
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    cursor: pointer;
}

.btn-primary-custom { 
    background: linear-gradient(135deg, #19AA6D 0%, #15945d 100%); 
    color: #fff; 
    box-shadow: 0 8px 20px rgba(25, 170, 109, 0.2);
}
.btn-primary-custom:hover { 
    transform: translateY(-3px); 
    box-shadow: 0 12px 25px rgba(25, 170, 109, 0.35); 
}

.btn-outline-primary-custom {
    background: #fff;
    color: var(--modal-primary) !important;
    border: 2px solid var(--modal-primary) !important;
}
.btn-outline-primary-custom:hover {
    background: #f0fff4;
    transform: translateY(-3px);
    box-shadow: 0 12px 25px rgba(25, 170, 109, 0.1);
}

/* Close Button */
.modal-close-floating {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 26px;
    color: #fff;
    cursor: pointer;
    z-index: 100;
    border: none;
    background: #19AA6D;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    font-weight: 700;
    box-shadow: 0 3px 10px rgba(25,170,109,0.3);
    transition: all 0.25s ease;
}
.modal-close-floating:hover {
    background: #222;
    transform: rotate(90deg);
    box-shadow: 0 3px 12px rgba(0,0,0,0.3);
}

/* Sub-components */
.btn-copy-applicant {
    margin-left: auto;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 8px;
    padding: 6px 12px;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    color: #64748b;
    transition: all 0.2s;
}
.btn-copy-applicant:hover {
    background: #edf2f7;
    color: #1a202c;
    border-color: #cbd5e1;
}

.delivery-info-box {
    padding: 15px 20px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #edf2f7;
    font-size: 0.85rem;
    line-height: 1.6;
    color: #475569;
    margin-bottom: 20px;
}

/* Premium Custom File Upload */
#certification_file_container .custom-file { height: 48px; }
#file_name_label_container {
    height: 48px;
    border-radius: 12px;
    border: 2px dashed #e2e8f0;
    background: #fff;
    font-weight: 600;
    font-size: 0.85rem;
    color: #64748b;
    padding: 0 16px;
    cursor: pointer;
    transition: all 0.2s ease;
}
#certification_file_container .custom-file-input:hover + #file_name_label_container {
    border-color: var(--modal-primary);
    background: #f0fff4;
}
#file_name_label_container i {
    color: var(--modal-primary);
    font-size: 1rem;
}

/* Final Layout Fixes for Modals */
.btn-address-search {
    border-radius: 0 10px 10px 0 !important;
    font-weight: 700;
    font-size: 0.85rem;
    padding: 0 18px;
    height: 48px;
    background: #1a202c;
    color: #fff;
    border: none;
    transition: background 0.2s;
}
.btn-address-search:hover {
    background: #2d3748;
    color: #fff;
}

.quantity-row-label {
    font-size: 1rem;
    font-weight: 800;
    color: #1a202c;
}

.modal-action-footer {
    display: flex;
    gap: 12px;
    margin-top: 15px;
}
.modal-action-footer .btn-action {
    flex: 1;
}


/* 상세 설명 영역 이미지 최적화 */
.summernote-view-area img {
    max-width: 100% !important;
    height: auto !important;
    display: block;
    margin: 0 auto;
}
