/* ===== STORE-SPECIFIC STYLES ===== */

/* Hero */
.store-hero { padding: 3rem 0 2rem; background: linear-gradient(135deg, var(--bg), var(--card), var(--muted)); text-align: center; }

/* Toolbar */
.store-toolbar { margin-bottom: 2rem; }
.store-search { width: 100%; max-width: 400px; padding: .7rem 1rem; border: 1px solid var(--border); border-radius: var(--radius); font-family: inherit; font-size: .95rem; color: var(--fg); background: var(--input); outline: none; transition: border-color .2s; }
.store-search:focus { border-color: var(--secondary); box-shadow: 0 0 0 3px rgba(184,160,208,.15); }

/* Product Grid */
.store-grid-section { padding: 0 0 4rem; }
.store-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.5rem; }
.store-loading { text-align: center; color: var(--muted-fg); padding: 3rem; grid-column: 1/-1; }

/* Product Card */
.sp-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); cursor: pointer; transition: all .3s; }
.sp-card:hover { box-shadow: 0 8px 24px rgba(0,0,0,.1); transform: translateY(-4px); }
.sp-card-img { width: 100%; aspect-ratio: 3/4; object-fit: cover; object-position: center 20%; display: block; }
.sp-card-body { padding: 1rem 1.25rem 1.25rem; }
.sp-card-tags { display: flex; gap: .3rem; margin-bottom: .5rem; flex-wrap: wrap; }
.sp-card-name { font-family: 'Playfair Display', serif; font-size: 1.05rem; font-weight: 600; margin-bottom: .3rem; }
.sp-card-desc { font-size: .85rem; color: var(--muted-fg); line-height: 1.5; margin-bottom: .75rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sp-card-bottom { display: flex; justify-content: space-between; align-items: center; }
.sp-card-price { font-size: 1.1rem; font-weight: 700; color: var(--primary-fg); }
.sp-card-cta { font-size: .8rem; font-weight: 600; color: var(--primary); }

/* Custom Request Banner */
.custom-request-banner { margin-top: 2rem; background: linear-gradient(135deg, rgba(232,180,208,.08), rgba(184,160,208,.08)); border: 2px dashed var(--border); border-radius: var(--radius); padding: 2rem; display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; }
.crb-icon { font-size: 2.5rem; }
.crb-text { flex: 1; min-width: 200px; }
.crb-text h3 { font-family: 'Dancing Script', cursive; font-size: 1.4rem; font-weight: 700; color: var(--primary); margin-bottom: .25rem; }
.crb-text p { font-size: .9rem; color: var(--muted-fg); line-height: 1.5; }

/* ===== PRODUCT DETAIL MODAL ===== */
.product-modal { max-width: 800px; width: 100%; max-height: 90vh; overflow-y: auto; }
.pm-layout { display: grid; grid-template-columns: 1fr 1fr; }
.pm-image-col { background: var(--muted); }
.pm-img { width: 100%; height: 100%; min-height: 300px; object-fit: cover; object-position: center 20%; display: block; }
.pm-info-col { padding: 2rem; }
.pm-tags { display: flex; gap: .3rem; margin-bottom: .75rem; flex-wrap: wrap; }
.pm-name { font-family: 'Dancing Script', cursive; font-size: 1.6rem; font-weight: 700; color: var(--primary); margin-bottom: .5rem; }
.pm-desc { font-size: .95rem; color: var(--muted-fg); line-height: 1.6; margin-bottom: 1rem; }
.pm-price { font-size: 1.4rem; font-weight: 700; color: var(--fg); margin-bottom: 1.5rem; }

/* Color Zone Pickers */
.pm-zones { margin-bottom: 1.25rem; }
.pm-zone { margin-bottom: 1rem; }
.pm-zone-label { font-size: .85rem; font-weight: 600; margin-bottom: .4rem; display: flex; align-items: center; gap: .5rem; }
.pm-zone-selected { font-weight: 400; color: var(--muted-fg); font-size: .8rem; }
.pm-zone-swatches { display: flex; flex-wrap: wrap; gap: .35rem; max-height: 180px; overflow-y: auto; padding: .25rem; }
.zone-swatch { border: 3px solid transparent; cursor: pointer; transition: all .2s; position: relative; background: none; padding: 0; }
.zone-swatch:hover { transform: scale(1.1); }
.zone-swatch.active { border-color: var(--fg); box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--fg); }
.zone-swatch::after { content: attr(data-name); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); background: var(--fg); color: var(--bg); font-size: .6rem; padding: .15rem .4rem; border-radius: 6px; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 10; }
.zone-swatch:hover::after { opacity: 1; }

/* Yarn ball image swatches */
.yarn-swatch { border-radius: 50%; overflow: hidden; width: 38px; height: 38px; }
.yarn-ball-img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 50%; }
.cart-yarn-dot { width: 14px; height: 14px; border-radius: 50%; object-fit: cover; display: inline-block; vertical-align: middle; margin-right: 2px; border: 1px solid var(--border); }

.pm-notes-field { margin-bottom: 1rem; }
.pm-notes-field label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: .35rem; }
.pm-notes-field textarea,
.pm-notes-field input,
.pm-notes-field select { width: 100%; padding: .6rem .8rem; border: 1px solid var(--border); border-radius: calc(var(--radius) - 4px); background: var(--input); font-family: inherit; font-size: .9rem; color: var(--fg); outline: none; transition: border-color .2s; }
.pm-notes-field textarea:focus,
.pm-notes-field input:focus,
.pm-notes-field select:focus { border-color: var(--secondary); box-shadow: 0 0 0 3px rgba(184,160,208,.15); }
.pm-notes-field textarea { resize: vertical; }
.optional { font-weight: 400; color: var(--muted-fg); font-size: .8rem; }
.pm-add-btn { margin-top: .5rem; }
.form-row-store { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

/* Custom modal */
.custom-modal-body { padding: 2rem; }

/* ===== CART DRAWER ===== */
.cart-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.3); z-index: 150; }
.cart-drawer { position: fixed; top: 0; right: 0; bottom: 0; width: 420px; max-width: 90vw; background: var(--bg); box-shadow: -4px 0 24px rgba(0,0,0,.1); z-index: 160; display: flex; flex-direction: column; transform: translateX(100%); transition: transform .3s ease; }
.cart-drawer.open { transform: translateX(0); }
.cart-header { display: flex; align-items: center; justify-content: space-between; padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--border); }
.cart-header h2 { font-family: 'Dancing Script', cursive; font-size: 1.4rem; }
.cart-items { flex: 1; overflow-y: auto; padding: 1rem 1.5rem; }
.cart-empty { text-align: center; color: var(--muted-fg); padding: 3rem 1rem; font-size: .95rem; }

/* Cart Item */
.cart-item { display: flex; gap: 1rem; padding: 1rem 0; border-bottom: 1px solid var(--border); }
.cart-item-img { width: 70px; height: 70px; border-radius: calc(var(--radius) - 4px); object-fit: cover; object-position: center 20%; flex-shrink: 0; }
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name { font-family: 'Playfair Display', serif; font-size: .9rem; font-weight: 600; margin-bottom: .15rem; }
.cart-item-colors { font-size: .75rem; color: var(--muted-fg); line-height: 1.4; }
.cart-item-colors span { display: inline-flex; align-items: center; gap: .25rem; }
.cart-item-colors .color-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; border: 1px solid var(--border); }
.cart-item-notes { font-size: .7rem; color: var(--muted-fg); font-style: italic; margin-top: .2rem; }
.cart-item-right { display: flex; flex-direction: column; align-items: flex-end; gap: .25rem; }
.cart-item-price { font-weight: 700; font-size: .95rem; }
.cart-item-remove { background: none; border: none; color: var(--muted-fg); cursor: pointer; font-size: .8rem; padding: .2rem; transition: color .2s; }
.cart-item-remove:hover { color: #e87070; }

/* Cart Footer */
.cart-footer { padding: 1.25rem 1.5rem; border-top: 1px solid var(--border); background: var(--card); }
.cart-total { display: flex; justify-content: space-between; align-items: center; margin-bottom: .5rem; font-size: 1rem; font-weight: 600; }
.cart-total-price { font-size: 1.2rem; color: var(--primary-fg); }
.cart-note { font-size: .75rem; color: var(--muted-fg); text-align: center; margin-bottom: .75rem; }

/* Cart badge */
.cart-count { background: var(--primary); color: var(--primary-fg); font-size: .7rem; font-weight: 700; padding: .1rem .45rem; border-radius: 10px; margin-left: .25rem; }
.cart-count:empty, .cart-count[data-count="0"] { display: none; }

/* ===== CHECKOUT MODAL ===== */
.checkout-modal { max-width: 560px; width: 100%; max-height: 90vh; overflow-y: auto; padding: 2rem; }
.checkout-summary { background: var(--muted); border-radius: calc(var(--radius) - 4px); padding: 1rem; margin: 1rem 0 1.5rem; max-height: 200px; overflow-y: auto; }
.checkout-item { display: flex; justify-content: space-between; align-items: center; padding: .4rem 0; font-size: .85rem; }
.checkout-item-name { font-weight: 600; }
.checkout-item + .checkout-item { border-top: 1px solid var(--border); }
.checkout-form .pm-notes-field { margin-bottom: .75rem; }
.checkout-total { display: flex; justify-content: space-between; align-items: center; padding: .75rem 0; margin: .5rem 0; border-top: 2px solid var(--border); font-weight: 700; font-size: 1.05rem; }
.checkout-fine { text-align: center; font-size: .8rem; color: var(--muted-fg); margin-top: .75rem; }

/* Prayer field */
.prayer-field { background: linear-gradient(135deg, rgba(184,160,208,.06), rgba(232,180,208,.06)); border: 1px solid rgba(184,160,208,.2); border-radius: calc(var(--radius) - 2px); padding: 1rem; }
.prayer-field label { color: var(--secondary); }

/* ===== CONFIRM MODAL ===== */
.confirm-modal { max-width: 460px; text-align: center; padding: 3rem 2rem; }
.confirm-body .confirm-icon { font-size: 3rem; margin-bottom: 1rem; }
.confirm-id { font-size: .85rem; color: var(--muted-fg); margin: 1rem 0 1.5rem; background: var(--muted); padding: .5rem 1rem; border-radius: var(--radius); display: inline-block; }

/* ===== MODAL SHARED ===== */
.modal-overlay { position: fixed; inset: 0; background: rgba(92,74,94,.5); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; z-index: 200; padding: 1.5rem; }
.modal { background: var(--bg); border-radius: var(--radius); box-shadow: 0 16px 48px rgba(0,0,0,.15); position: relative; }
.modal .modal-close { position: absolute; top: 1rem; right: 1rem; background: var(--card); border: 1px solid var(--border); width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 1rem; color: var(--muted-fg); z-index: 5; transition: all .2s; }
.modal .modal-close:hover { background: var(--border); color: var(--fg); }

/* ===== RESPONSIVE ===== */
@media (max-width: 700px) {
  .pm-layout { grid-template-columns: 1fr; }
  .pm-img { min-height: 250px; max-height: 300px; }
  .store-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 1rem; }
  .form-row-store { grid-template-columns: 1fr; }
  .custom-request-banner { flex-direction: column; text-align: center; }
  .cart-drawer { width: 100%; max-width: 100vw; }
}
