/* ==========================================================================
   Online Store — Clean & Minimal Shop Styles
   by ideaBoss (ideaboss.io)
   ========================================================================== */

/* ---------- Reset & Variables ---------- */
.os-shop *, .os-single-product *, .os-checkout *, .os-cart-drawer * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.os-shop, .os-single-product, .os-checkout {
    font-family: var(--os-font, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
    color: var(--os-primary, #111);
    line-height: 1.6;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ---------- Test Banner ---------- */
.os-test-banner {
    background: #FEF3C7;
    color: #92400E;
    text-align: center;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    border-radius: 6px;
    margin-bottom: 24px;
}

/* ---------- Buttons ---------- */
.os-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: var(--os-radius, 8px);
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    line-height: 1.4;
}

.os-btn-primary {
    background: var(--os-accent, #4F46E5);
    color: #fff;
}
.os-btn-primary:hover { opacity: 0.9; transform: translateY(-1px); }

.os-btn-secondary {
    background: #f4f4f5;
    color: var(--os-primary, #111);
}
.os-btn-secondary:hover { background: #e4e4e7; }

.os-btn-lg { padding: 14px 32px; font-size: 15px; }
.os-btn-full { width: 100%; }

.os-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ---------- Toolbar ---------- */
.os-toolbar {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.os-toolbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}

.os-search { flex: 1; max-width: 400px; }
.os-search form { display: flex; position: relative; }
.os-search-input {
    width: 100%;
    padding: 10px 16px;
    padding-right: 44px;
    border: 1px solid #e4e4e7;
    border-radius: var(--os-radius, 8px);
    font-size: 14px;
    background: #fafafa;
    transition: border-color 0.2s;
}
.os-search-input:focus { outline: none; border-color: var(--os-accent); background: #fff; }
.os-search-btn {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: #71717A;
}

.os-filter-cats select, .os-sort select {
    padding: 10px 32px 10px 12px;
    border: 1px solid #e4e4e7;
    border-radius: var(--os-radius, 8px);
    font-size: 13px;
    background: #fafafa url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="%2371717a" stroke-width="2"><path d="M6 9l6 6 6-6"/></svg>') no-repeat right 10px center;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}

.os-view-toggle { display: flex; gap: 4px; }
.os-view-btn {
    padding: 8px;
    border: 1px solid #e4e4e7;
    background: #fff;
    cursor: pointer;
    color: #a1a1aa;
    border-radius: 6px;
    transition: all 0.2s;
}
.os-view-btn.active { background: var(--os-primary); color: #fff; border-color: var(--os-primary); }

.os-results-count { font-size: 13px; color: #71717A; margin-bottom: 24px; }

/* ---------- Product Grid ---------- */
.os-products-grid {
    display: grid;
    grid-template-columns: repeat(var(--os-grid-cols, 3), 1fr);
    gap: 24px;
}
.os-shop[data-columns="2"] .os-products-grid { --os-grid-cols: 2; }
.os-shop[data-columns="3"] .os-products-grid { --os-grid-cols: 3; }
.os-shop[data-columns="4"] .os-products-grid { --os-grid-cols: 4; }

/* Product List View */
.os-products-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.os-products-list .os-product-card {
    display: flex;
    flex-direction: row;
}
.os-products-list .os-product-card .os-product-link {
    display: flex;
    flex-direction: row;
    gap: 20px;
}
.os-products-list .os-product-image {
    width: 200px;
    min-width: 200px;
    aspect-ratio: auto;
}
.os-products-list .os-product-info {
    padding: 16px 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* ---------- Product Card ---------- */
.os-product-card {
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.os-product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.08);
}

.os-product-link { text-decoration: none; color: inherit; display: block; }

.os-product-image {
    aspect-ratio: 1;
    overflow: hidden;
    background: #f4f4f5;
}
.os-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}
.os-hover-zoom:hover .os-product-image img { transform: scale(1.08); }
.os-hover-fade:hover .os-product-image img { opacity: 0.85; }

.os-product-info { padding: 16px; }
.os-product-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
    line-height: 1.3;
    color: var(--os-primary);
}
.os-product-price {
    font-size: 15px;
    font-weight: 500;
    color: #52525b;
}

/* Swatches on cards */
.os-product-swatches { display: flex; gap: 4px; margin-top: 8px; }
.os-swatch-dot {
    width: 16px; height: 16px; border-radius: 50%;
    display: inline-block; border: 2px solid #fff;
    box-shadow: 0 0 0 1px #d4d4d8;
}
.os-swatch-more { font-size: 11px; color: #a1a1aa; line-height: 16px; }

/* ---------- Single Product ---------- */
.os-product-container { max-width: 1200px; margin: 0 auto; padding: 32px 24px; }

.os-breadcrumb { font-size: 13px; color: #71717A; margin-bottom: 24px; }
.os-breadcrumb a { color: #71717A; text-decoration: none; }
.os-breadcrumb a:hover { color: var(--os-accent); }
.os-breadcrumb-sep { margin: 0 8px; }

.os-product-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: start;
}

/* Gallery */
.os-gallery-main {
    border-radius: 12px;
    overflow: hidden;
    background: #f4f4f5;
    aspect-ratio: 1;
}
.os-gallery-main img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s;
}
.os-gallery-thumbs {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    overflow-x: auto;
}
.os-gallery-thumb {
    width: 72px; height: 72px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid transparent;
    cursor: pointer;
    flex-shrink: 0;
    background: none;
    padding: 0;
}
.os-gallery-thumb.active { border-color: var(--os-accent); }
.os-gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* Product Details */
.os-product-detail-title { font-size: 28px; font-weight: 700; margin-bottom: 12px; line-height: 1.2; }
.os-product-detail-price { font-size: 22px; font-weight: 600; margin-bottom: 24px; color: #18181b; }
.os-product-sku { font-size: 12px; color: #a1a1aa; margin-bottom: 16px; }

/* Option Groups */
.os-option-group { margin-bottom: 24px; }
.os-option-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #52525b;
    margin-bottom: 10px;
}
.os-option-selected { font-weight: 400; text-transform: none; letter-spacing: 0; color: #71717a; margin-left: 4px; }

/* Color Swatches */
.os-color-swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.os-color-swatch {
    width: 36px; height: 36px;
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 0 0 1px #d4d4d8;
    cursor: pointer;
    transition: all 0.2s;
    padding: 0;
}
.os-color-swatch.selected,
.os-color-swatch:hover {
    box-shadow: 0 0 0 2px var(--os-accent);
    transform: scale(1.1);
}
.os-color-swatch.disabled { opacity: 0.3; cursor: not-allowed; }

/* Size Buttons */
.os-size-options { display: flex; flex-wrap: wrap; gap: 8px; }
.os-size-btn {
    padding: 10px 18px;
    border: 1px solid #d4d4d8;
    border-radius: var(--os-radius, 8px);
    background: #fff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}
.os-size-btn:hover { border-color: var(--os-primary); }
.os-size-btn.selected {
    background: var(--os-primary);
    color: #fff;
    border-color: var(--os-primary);
}
.os-size-btn.disabled { opacity: 0.3; cursor: not-allowed; text-decoration: line-through; }

/* Quantity */
.os-quantity-selector {
    display: inline-flex;
    align-items: center;
    border: 1px solid #d4d4d8;
    border-radius: var(--os-radius, 8px);
    overflow: hidden;
}
.os-qty-btn {
    width: 40px; height: 40px;
    border: none;
    background: #f4f4f5;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.os-qty-btn:hover { background: #e4e4e7; }
.os-qty-input {
    width: 48px; height: 40px;
    text-align: center;
    border: none;
    border-left: 1px solid #d4d4d8;
    border-right: 1px solid #d4d4d8;
    font-size: 15px;
    font-weight: 600;
    -moz-appearance: textfield;
}
.os-qty-input::-webkit-outer-spin-button,
.os-qty-input::-webkit-inner-spin-button { -webkit-appearance: none; }

/* Accordion */
.os-accordion { border-top: 1px solid #e4e4e7; margin-top: 24px; }
.os-accordion-btn {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border: none;
    background: none;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    color: var(--os-primary);
}
.os-accordion-content { padding-bottom: 16px; font-size: 14px; color: #52525b; line-height: 1.7; }

/* Share */
.os-product-share { margin-top: 24px; display: flex; gap: 12px; align-items: center; font-size: 13px; color: #71717a; }
.os-share-link { color: #52525b; text-decoration: none; font-weight: 500; }
.os-share-link:hover { color: var(--os-accent); }

/* Related */
.os-related-section { margin-top: 64px; padding-top: 48px; border-top: 1px solid #e4e4e7; }
.os-related-title { font-size: 22px; font-weight: 700; margin-bottom: 24px; }
.os-related-grid { grid-template-columns: repeat(4, 1fr); }

/* ---------- Cart Drawer ---------- */
.os-cart-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 99998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}
.os-cart-overlay.open { opacity: 1; visibility: visible; }

.os-cart-drawer {
    position: fixed;
    top: 0; right: -420px;
    width: 400px; max-width: 90vw;
    height: 100vh;
    background: #fff;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    transition: right 0.3s ease;
    box-shadow: -4px 0 24px rgba(0,0,0,0.1);
}
.os-cart-drawer.open { right: 0; }

.os-cart-drawer-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e4e4e7;
}
.os-cart-drawer-header h3 { font-size: 18px; font-weight: 700; }
.os-cart-close {
    background: none; border: none;
    font-size: 28px; cursor: pointer; color: #71717a;
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}
.os-cart-close:hover { background: #f4f4f5; }

.os-cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 16px 24px;
}
.os-cart-empty { text-align: center; color: #a1a1aa; padding: 48px 0; }

.os-cart-item {
    display: flex;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid #f4f4f5;
}
.os-cart-item-img {
    width: 72px; height: 72px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    background: #f4f4f5;
}
.os-cart-item-img img { width: 100%; height: 100%; object-fit: cover; }
.os-cart-item-details { flex: 1; }
.os-cart-item-title { font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.os-cart-item-variant { font-size: 12px; color: #71717a; margin-bottom: 8px; }
.os-cart-item-bottom { display: flex; justify-content: space-between; align-items: center; }
.os-cart-item-price { font-weight: 600; font-size: 14px; }
.os-cart-item-qty {
    display: flex; align-items: center; gap: 4px;
}
.os-cart-item-qty button {
    width: 28px; height: 28px;
    border: 1px solid #e4e4e7; background: #fff;
    border-radius: 4px; cursor: pointer;
    font-size: 14px;
    display: flex; align-items: center; justify-content: center;
}
.os-cart-item-qty span { min-width: 20px; text-align: center; font-size: 13px; font-weight: 600; }
.os-cart-item-remove {
    background: none; border: none;
    color: #a1a1aa; cursor: pointer; font-size: 12px;
    text-decoration: underline;
}
.os-cart-item-remove:hover { color: var(--os-sale); }

.os-cart-footer {
    padding: 20px 24px;
    border-top: 1px solid #e4e4e7;
    background: #fafafa;
}
.os-cart-subtotal {
    display: flex; justify-content: space-between;
    font-size: 16px; font-weight: 700;
    margin-bottom: 8px;
}
.os-cart-shipping-note { font-size: 12px; color: #71717a; margin-bottom: 16px; }
.os-cart-footer .os-btn { margin-bottom: 8px; }

/* Floating Cart Button */
.os-cart-fab {
    position: fixed;
    bottom: 24px; right: 24px;
    width: 56px; height: 56px;
    border-radius: 50%;
    background: var(--os-accent, #4F46E5);
    color: #fff;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    z-index: 9999;
    display: flex; align-items: center; justify-content: center;
    transition: transform 0.2s;
}
.os-cart-fab:hover { transform: scale(1.1); }
.os-cart-badge {
    position: absolute;
    top: -4px; right: -4px;
    background: var(--os-sale, #DC2626);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    width: 22px; height: 22px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    line-height: 1;
}

/* ---------- Checkout ---------- */
.os-checkout { max-width: 1100px; padding: 32px 24px; }

.os-checkout-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 40px;
}
.os-step {
    display: flex; align-items: center; gap: 8px;
    opacity: 0.4;
    transition: opacity 0.3s;
}
.os-step.active, .os-step.completed { opacity: 1; }
.os-step-num {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: #e4e4e7;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700;
}
.os-step.active .os-step-num { background: var(--os-accent); color: #fff; }
.os-step.completed .os-step-num { background: var(--os-success); color: #fff; }
.os-step-label { font-size: 14px; font-weight: 600; }
.os-step-line { width: 48px; height: 2px; background: #e4e4e7; margin: 0 12px; }

.os-checkout-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 48px;
    align-items: start;
}

.os-checkout-panel h2 { font-size: 20px; font-weight: 700; margin-bottom: 24px; }

.os-form-row { margin-bottom: 16px; }
.os-form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.os-form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

.os-form-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}
.os-form-field input, .os-form-field select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d4d4d8;
    border-radius: var(--os-radius, 8px);
    font-size: 14px;
    transition: border-color 0.2s;
}
.os-form-field input:focus, .os-form-field select:focus {
    outline: none;
    border-color: var(--os-accent);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Shipping Options */
.os-shipping-options { margin-bottom: 24px; }
.os-shipping-option {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px;
    border: 1px solid #e4e4e7;
    border-radius: var(--os-radius, 8px);
    margin-bottom: 8px;
    cursor: pointer;
    transition: border-color 0.2s;
}
.os-shipping-option:hover, .os-shipping-option.selected {
    border-color: var(--os-accent);
}
.os-shipping-loading { text-align: center; padding: 32px; color: #71717a; }
.os-spinner {
    width: 24px; height: 24px;
    border: 3px solid #e4e4e7;
    border-top-color: var(--os-accent);
    border-radius: 50%;
    animation: os-spin 0.6s linear infinite;
    margin: 0 auto 12px;
}
@keyframes os-spin { to { transform: rotate(360deg); } }

/* Payment */
.os-payment-methods { margin-bottom: 24px; }
.os-payment-method {
    display: flex; align-items: center; gap: 12px;
    padding: 16px;
    border: 1px solid #e4e4e7;
    border-radius: var(--os-radius, 8px);
    margin-bottom: 8px;
    cursor: pointer;
    transition: border-color 0.2s;
}
.os-payment-method:has(input:checked) {
    border-color: var(--os-accent);
    background: rgba(79, 70, 229, 0.02);
}
.os-payment-label {
    display: flex; justify-content: space-between; align-items: center; flex: 1;
}
.os-payment-name { font-weight: 600; font-size: 14px; }
.os-payment-icons { display: flex; gap: 6px; }

.os-stripe-element {
    padding: 16px;
    border: 1px solid #e4e4e7;
    border-radius: var(--os-radius, 8px);
    margin-bottom: 16px;
    background: #fafafa;
}

.os-payment-errors { color: var(--os-sale); font-size: 13px; margin-bottom: 16px; }

.os-terms-agree { margin-bottom: 16px; font-size: 13px; }
.os-terms-agree a { color: var(--os-accent); }

.os-checkout-nav {
    display: flex; justify-content: space-between; gap: 16px;
    margin-top: 24px;
}

/* Order Summary Sidebar */
.os-order-summary {
    background: #fafafa;
    border: 1px solid #e4e4e7;
    border-radius: 12px;
    padding: 24px;
    position: sticky;
    top: 24px;
}
.os-order-summary h3 { font-size: 16px; font-weight: 700; margin-bottom: 16px; }

.os-checkout-item {
    display: flex; gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #f4f4f5;
}
.os-checkout-item-img {
    width: 56px; height: 56px;
    border-radius: 8px; overflow: hidden;
    background: #e4e4e7; flex-shrink: 0;
    position: relative;
}
.os-checkout-item-img img { width: 100%; height: 100%; object-fit: cover; }
.os-checkout-item-qty-badge {
    position: absolute; top: -6px; right: -6px;
    background: #52525b; color: #fff;
    font-size: 10px; font-weight: 700;
    width: 20px; height: 20px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
}
.os-checkout-item-info { flex: 1; }
.os-checkout-item-title { font-size: 13px; font-weight: 600; }
.os-checkout-item-variant { font-size: 11px; color: #71717a; }
.os-checkout-item-price { font-size: 13px; font-weight: 600; white-space: nowrap; }

.os-summary-totals { margin-top: 16px; padding-top: 16px; border-top: 1px solid #e4e4e7; }
.os-summary-row {
    display: flex; justify-content: space-between;
    padding: 6px 0;
    font-size: 14px;
    color: #52525b;
}
.os-summary-total {
    padding-top: 12px;
    margin-top: 8px;
    border-top: 1px solid #e4e4e7;
    font-size: 17px;
    font-weight: 700;
    color: var(--os-primary);
}

/* Success */
.os-checkout-success { text-align: center; padding: 64px 24px; }
.os-success-icon { margin-bottom: 24px; }
.os-checkout-success h2 { font-size: 28px; margin-bottom: 12px; }
.os-checkout-success p { color: #52525b; margin-bottom: 8px; }
.os-order-number { margin-bottom: 32px !important; }

/* ---------- Pagination ---------- */
.os-pagination {
    display: flex; justify-content: center; gap: 4px;
    margin-top: 48px;
}
.os-pagination a, .os-pagination span {
    display: flex; align-items: center; justify-content: center;
    width: 40px; height: 40px;
    border-radius: var(--os-radius, 8px);
    font-size: 14px; font-weight: 500;
    text-decoration: none;
    color: #52525b;
    border: 1px solid #e4e4e7;
    transition: all 0.2s;
}
.os-pagination a:hover { border-color: var(--os-accent); color: var(--os-accent); }
.os-pagination .current {
    background: var(--os-accent); color: #fff; border-color: var(--os-accent);
}

/* No products */
.os-no-products {
    grid-column: 1 / -1;
    text-align: center;
    padding: 64px 24px;
    color: #71717a;
}

/* ---------- Notices ---------- */
.os-notice { padding: 12px 16px; border-radius: var(--os-radius, 8px); font-size: 14px; margin-bottom: 16px; }
.os-notice-error { background: #FEF2F2; color: #991B1B; border: 1px solid #FECACA; }
.os-notice-success { background: #F0FDF4; color: #166534; border: 1px solid #BBF7D0; }

/* Toast */
.os-toast {
    position: fixed;
    bottom: 90px; right: 24px;
    background: #18181b; color: #fff;
    padding: 12px 20px;
    border-radius: var(--os-radius, 8px);
    font-size: 14px; font-weight: 500;
    z-index: 100000;
    animation: os-toast-in 0.3s ease, os-toast-out 0.3s ease 2.7s forwards;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}
@keyframes os-toast-in { from { opacity: 0; transform: translateY(12px); } }
@keyframes os-toast-out { to { opacity: 0; transform: translateY(12px); } }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
    .os-products-grid { grid-template-columns: repeat(2, 1fr) !important; }
    .os-related-grid { grid-template-columns: repeat(2, 1fr); }
    .os-checkout-layout { grid-template-columns: 1fr; }
    .os-product-layout { grid-template-columns: 1fr; gap: 32px; }
}

@media (max-width: 640px) {
    .os-products-grid { grid-template-columns: 1fr !important; }
    .os-related-grid { grid-template-columns: repeat(2, 1fr); }
    .os-toolbar { flex-direction: column; align-items: stretch; }
    .os-toolbar-right { justify-content: space-between; flex-wrap: wrap; }
    .os-search { max-width: none; }
    .os-form-row-2, .os-form-row-3 { grid-template-columns: 1fr; }
    .os-product-detail-title { font-size: 22px; }
    .os-product-detail-price { font-size: 18px; }
    .os-checkout-steps { display: none; }
    .os-products-list .os-product-image { width: 120px; min-width: 120px; }
}
