/* ==========================================================
   PRODUCTS.CSS
   Shared styles untuk product-detail, product-main, dan
   product-other-order-form. Bundling tetap terpisah.
   ========================================================== */

/* ----------------------------------------------------------
   1. SHARED INPUT & FORM STYLES
   ---------------------------------------------------------- */
.input-style {
    min-height: 42px !important;
    padding: 0.5rem 1rem !important;
}

.custom-btn-min,
.custom-btn-plus {
    padding: 0 0.5rem !important;
    border-radius: 25px !important;
}

.qty-form-control {
    width: 60px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    text-align: center;
}

.custom-error {
    color: #dc3545;
    font-size: 0.8rem;
    min-height: 1rem;
}

/* ----------------------------------------------------------
   2. IMAGE UPLOAD (shared: order-form + other-order-form)
   ---------------------------------------------------------- */
.image-upload-container {
    margin-top: 1rem;
    border: 1px solid #ea480a;
    border-radius: 6px;
}

.image-upload-container .upload-section-title {
    font-size: 1.25rem;
    font-weight: bold;
    text-align: center;
    color: #6c757d;
    padding: 0.5rem 0;
}

.image-container {
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
}

.custom-file-upload {
    position: relative;
    width: 100%;
    height: 120px;
    border: 2px dashed #ccc;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
    transition: border-color 0.3s ease;
}

.custom-file-upload:hover {
    border-color: #ea480a;
}

.custom-file-upload img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

.custom-file-upload.has-preview .upload-label {
    display: none;
}

.custom-file-upload.has-preview .file-input-hidden {
    display: none !important;
}

.upload-label {
    text-align: center;
    color: #666;
}

.upload-label i {
    font-size: 1.5rem;
    margin-bottom: 0.3rem;
}

.label-text {
    font-size: 0.9rem;
    font-weight: bold;
}

.image-category-label {
    font-size: 0.8rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 0.4rem;
    text-align: center;
}

.edit-btn,
.delete-btn {
    position: absolute;
    top: 5px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid #ccc;
    z-index: 2;
}

.edit-btn {
    left: 5px;
    color: #28a745;
}

.delete-btn {
    right: 5px;
    color: #dc3545;
}

.edit-btn:hover,
.delete-btn:hover {
    background: rgba(255, 255, 255, 1);
}

.upload-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: #f0f0f0;
}

.progress-bar-upload {
    width: 0;
    height: 100%;
    background: #ea480a;
    transition: width 0.3s ease;
}

/* ----------------------------------------------------------
   3. ORDER FORM CARD (performa-list-order)
   ---------------------------------------------------------- */
.performa-list-order {
    border-radius: 0 !important;
    border: 1px solid #ea4909 !important;
}

.performa-list-order .card-header {
    background-color: #f8f0ec;
    border-bottom: 1px solid #ea4909;
    border-radius: 0 !important;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
}

.performa-list-order .card-header .card-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #ea480a;
    margin: 0;
}

.performa-list-order .card-header .card-btn-action {
    display: flex;
    gap: 4px;
}

.performa-list-order .card-body {
    padding: 0.75rem;
}

/* ----------------------------------------------------------
   4. PRICE SUMMARY CARD
   ---------------------------------------------------------- */
.order-price-summary-card {
    border: 1px solid #ea480a;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    transition: box-shadow 0.2s ease;
    padding: 0.75rem 1rem;
    margin-top: 0.75rem;
}

.order-price-summary-card:hover {
    box-shadow: 0 2px 8px rgba(234, 72, 10, 0.2);
}

.order-price-summary-card .summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.order-price-summary-card .summary-label {
    font-size: 0.85rem;
    color: #6c757d;
}

.order-price-summary-card .summary-total {
    font-size: 0.9rem;
    font-weight: 600;
    color: #212529;
}

.order-price-summary-card .summary-grand-total {
    font-size: 1rem;
    font-weight: 700;
    color: #ea480a;
}

.order-price-summary-card .summary-hint {
    font-size: 0.75rem;
    color: #aaa;
    text-align: right;
    margin-top: 2px;
}

/* Price detail popup */
.price-detail-popup .modal-header {
    background-color: #ea480a;
    color: #fff;
    border-radius: 0;
}

.price-detail-popup .price-detail-row {
    display: flex;
    justify-content: space-between;
    padding: 0.4rem 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.875rem;
}

.price-detail-popup .price-detail-row:last-child {
    border-bottom: none;
}

.price-detail-popup .price-detail-grand {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0 0;
    font-size: 1rem;
    font-weight: 700;
    color: #ea480a;
    border-top: 2px solid #ea480a;
    margin-top: 0.25rem;
}

/* ----------------------------------------------------------
   5. HCC CUSTOM PHOTO UPLOAD (dalam form order)
   ---------------------------------------------------------- */
.hcc-upload-wrapper {
    background: #fff9f7;
    margin-bottom: 0.75rem;
}

.hcc-upload-wrapper .hcc-upload-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: rgba(var(--dark), 0.8);
    margin-bottom: 0.5rem;
    display: block;
}

/* ----------------------------------------------------------
   6. PRODUCT MAIN — FILTER BAR (dropdown fixed)
   ---------------------------------------------------------- */
.filter-bar-wrap {
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
}

.filter-bar {
    display: inline-flex;
    gap: 10px;
    align-items: center;
}

/* Dropdown menu pakai position:fixed agar tidak terpotong
   overflow-x pada filter-bar-wrap (diset via JS) */
.dropdown-menu.dropdown-fixed {
    position: fixed !important;
    z-index: 9999 !important;
}

/* ----------------------------------------------------------
   7. COLOR SWATCH
   ---------------------------------------------------------- */
.option-color-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 0.25rem;
    justify-content: center;
    min-height: 30px;
    padding: 0 0.5rem;
}

.option-color-list .check-box {
    position: relative;
    margin-bottom: 0 !important;
}

.option-color-list input[type="radio"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.option-color-list .color-swatch {
    display: block;
    width: 24px;
    height: 24px;
    border: 2px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.2s;
}

.option-color-list input:checked+.color-swatch {
    border-color: #000;
    transform: scale(1.2);
}

/* ----------------------------------------------------------
   8. SELECTED STYLE ITEMS
   ---------------------------------------------------------- */
.selected-items {
    min-height: 42px;
    border: 1px solid #ea480a;
    border-radius: 25px;
    padding: 5px;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 5px;
}

.selected-item {
    background-color: #e9ecef;
    padding: 5px 10px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.85rem;
}

.selected-item .remove-item {
    cursor: pointer;
    color: red;
    font-weight: bold;
}

/* ----------------------------------------------------------
   9. SCROLLABLE QUANTITY CHOICES
   ---------------------------------------------------------- */
.custom-slider-choice {
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
}

.custom-slider-choice::-webkit-scrollbar {
    height: 4px;
}

.custom-slider-choice::-webkit-scrollbar-thumb {
    background: rgba(234, 72, 10, 0.4);
    border-radius: 3px;
}

.custom-choice {
    flex: 0 0 auto;
    cursor: pointer;
    padding: 4px 14px;
    font-size: 0.85rem;
    user-select: none;
    transition: background-color 0.15s, color 0.15s;
}

.custom-choice.active,
.custom-choice input:checked~span {
    background-color: #ea480a !important;
    color: #fff !important;
    border-color: #ea480a !important;
}

/* ----------------------------------------------------------
   10. PRODUCT DETAIL — MISC
   ---------------------------------------------------------- */
#main-product-image-order {
    transition: opacity 0.3s ease-in-out;
}

.price-table {
    border: 1px solid #212529;
    padding: 0.8rem 0.75rem;
}

.product-header-sticky {
    position: sticky;
    top: 44px;
    z-index: 1020;
    background-color: #fff;
    padding: 10px 4px;
    width: 100%;
}

.background-card-order {
    padding-top: 1rem;
    padding-bottom: 0.25rem;
    border-radius: 0 0 20px 20px;
    max-width: 100% !important;
}