/* Color + quantity picker (product page and add-to-cart modal) */
.clr-picker { width: 100%; text-align: start; }

.clr-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; margin-bottom: 16px; }
.clr-head h3 { margin: 0; font-size: 18px; font-family: "font_medium"; color: var(--color-black); }
.clr-head small { color: var(--color-gray); font-size: 13px; }

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

.clr-item { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 16px 8px 10px; border: 1px solid var(--color-border); border-radius: 16px; background: var(--color-white); transition: border-color .2s, background-color .2s, box-shadow .2s; }
.clr-item:hover { border-color: var(--color-Primary1); }
.clr-item.is-on { border-color: var(--color-Primary1); background: var(--color-Primary3); box-shadow: 0 6px 18px rgba(0, 0, 0, .06); }

.clr-swatch { position: relative; width: 46px; height: 46px; padding: 0; border: 0; border-radius: 50%; background: var(--c); cursor: pointer; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .14), inset 0 -8px 12px rgba(0, 0, 0, .10), inset 0 6px 10px rgba(255, 255, 255, .28); transition: transform .2s, outline-color .2s; outline: 2px solid transparent; outline-offset: 4px; }
.clr-swatch:hover { transform: scale(1.06); }
.clr-item.is-on .clr-swatch { outline-color: var(--color-Primary1); }
.clr-swatch i { position: absolute; inset-inline-end: -6px; top: -6px; display: flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%; background: var(--color-Primary1); color: #fff; font-size: 12px; border: 2px solid #fff; transform: scale(0); transition: transform .2s; }
.clr-item.is-on .clr-swatch i { transform: scale(1); }

.clr-step { display: flex; direction: ltr; align-items: center; justify-content: space-between; width: 100%; max-width: 116px; padding: 3px; border-radius: 999px; background: var(--color-Primary5); }
.clr-item.is-on .clr-step { background: var(--color-white); }
.clr-step button { flex: 0 0 30px; width: 30px; height: 30px; padding: 0; display: flex; align-items: center; justify-content: center; border: 0; border-radius: 50%; background: transparent; color: var(--color-Primary1); font-size: 18px; cursor: pointer; transition: background-color .2s, color .2s; }
.clr-step button:hover:not(:disabled) { background: var(--color-Primary1); color: #fff; }
.clr-step button:disabled { color: #cfcfcf; cursor: not-allowed; }
.clr-step input.color-qty { flex: 1 1 auto; min-width: 0; width: 100% !important; height: 30px; padding: 0; border: 0; background: transparent; text-align: center; font-family: "font_medium"; font-size: 16px; color: var(--color-black); -moz-appearance: textfield; appearance: textfield; }
.clr-step input::-webkit-outer-spin-button, .clr-step input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.clr-swatch:focus-visible, .clr-step button:focus-visible, .clr-step input:focus-visible { outline: 2px solid var(--color-Primary2); outline-offset: 2px; border-radius: 999px; }

.clr-empty { grid-column: 1 / -1; margin: 0; padding: 18px; text-align: center; color: var(--color-gray); }

.clr-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 16px; padding: 12px 16px; border-radius: 14px; background: var(--color-Primary5); }
.clr-dots { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--color-gray); font-size: 14px; }
.clr-dot { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px 3px 5px; border-radius: 999px; background: #fff; color: var(--color-black); font-size: 13px; direction: ltr; }
.clr-dot b { width: 16px; height: 16px; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .14); }
.clr-total { display: flex; align-items: baseline; gap: 10px; color: var(--color-gray); font-size: 14px; white-space: nowrap; }
.clr-total strong { color: var(--color-Primary1); font-size: 18px; font-family: "font_bold"; font-weight: normal; }
.clr-stock { flex-basis: 100%; margin: 0; color: #c0392b; font-size: 13px; display: none; }
.clr-picker.is-max .clr-stock { display: block; }

/* product page */
.clr-box { margin-top: 24px; padding: 28px; border: 1px solid var(--color-border); border-radius: 15px; background: var(--color-white); }
.btns-product-details .ctm-btn.clr-submit { width: 100%; }
.clr-submit { transition: opacity .2s; }
.clr-submit.is-empty { opacity: .6; }

/* modal */
#exampleModal .modal-content { border: 0; border-radius: 24px; overflow: hidden; }
#exampleModal .modal-header { align-items: center; padding: 20px 24px; border-bottom: 1px solid var(--color-border); }
#exampleModal .modal-title { font-family: "font_medium"; font-size: 19px; }
#exampleModal .modal-header .close { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; padding: 0; margin: 0; border-radius: 50%; background: var(--color-Primary5); opacity: 1; font-size: 22px; color: var(--color-black2); text-shadow: none; }
#exampleModal .modal-body { padding: 20px 24px; max-height: calc(100vh - 250px); min-height: 220px; overflow-y: auto; justify-content: flex-start; }
#exampleModal .clr-summary { position: sticky; bottom: -8px; z-index: 2; box-shadow: 0 -8px 16px #fff; }
#exampleModal .modal-footer { padding: 16px 24px 22px; border-top: 1px solid var(--color-border); }
#exampleModal .modal-footer > * { margin: 0; }
#exampleModal a.btn-cart { width: 100%; height: 54px; border-radius: 999px; gap: 10px; background: var(--color-Primary1); color: #fff; font-family: "font_medium"; font-size: 17px; }
#exampleModal a.btn-cart:hover { filter: brightness(.94); }
#exampleModal a.btn-cart svg { width: 26px; height: 26px; }
#exampleModal a.btn-cart svg path { stroke: #fff; }
.clr-product { display: flex; align-items: center; gap: 14px; text-align: start; }
.clr-product img { width: 68px; height: 68px; object-fit: cover; border-radius: 14px; background: var(--color-Primary5); }
.clr-product h6 { margin: 0 0 4px; font-size: 16px; font-family: "font_medium"; color: var(--color-black); }
.clr-product span { color: var(--color-Primary1); font-family: "font_bold"; }

@media (max-width: 575px) {
    .clr-box { padding: 18px; }
    .clr-grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
    #exampleModal .modal-header, #exampleModal .modal-body, #exampleModal .modal-footer { padding-inline: 16px; }
}
@media (prefers-reduced-motion: reduce) {
    .clr-item, .clr-swatch, .clr-swatch i, .clr-step button { transition: none; }
}
