/* SP Elline Shop - frontend styles (canvas styles live in canvas.css) */

.sp-elline-shop {
    direction: rtl;
    font-family: 'Heebo', 'Assistant', system-ui, sans-serif;
    color: #4a2c3f;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 2;
}

.sp-elline-shop * {
    box-sizing: border-box;
}

/* ===== Themed (used inside canvas) ===== */
.sp-elline-shop--themed {
    padding: 0 18px 60px;
}

/* Hero with logo */
.sp-shop-hero {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 24px 0 18px;
    position: relative;
}
.sp-logo-trigger {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: transform 0.2s ease;
    font-family: inherit;
}
.sp-logo-trigger:hover { transform: scale(1.04); }
.sp-logo-trigger:active { transform: scale(0.98); }
.sp-shop-logo {
    max-width: min(360px, 70vw);
    max-height: 160px;
    object-fit: contain;
    filter: drop-shadow(0 8px 24px rgba(236, 72, 153, 0.25));
    animation: sp-logo-float 4s ease-in-out infinite;
    display: inline-block;
}
@keyframes sp-logo-float {
    0%, 100% { transform: translateY(0) rotate(-1deg); }
    50%      { transform: translateY(-6px) rotate(1deg); }
}
.sp-shop-logo--placeholder {
    background: rgba(255,255,255,0.7);
    padding: 16px 26px;
    border-radius: 999px;
    font-family: 'Suez One', 'Heebo', serif;
    font-size: 28px;
    color: #ec4899;
    border: 3px solid #f9a8d4;
    text-align: center;
}

/* ===== Greeting bubble (logo click) ===== */
.sp-greeting-bubble {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translate(-50%, 12px);
    background: #fff;
    border: 3px solid #fbcfe8;
    border-radius: 22px;
    padding: 16px 44px 16px 22px;
    box-shadow: 0 14px 32px rgba(236, 72, 153, 0.28);
    z-index: 50;
    max-width: min(360px, 88vw);
    animation: sp-bubble-in 0.28s cubic-bezier(.34,1.56,.64,1);
}
.sp-greeting-bubble[hidden] { display: none; }
.sp-greeting-bubble p {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    color: #4a2c3f;
    text-align: center;
    line-height: 1.4;
}
.sp-greeting-bubble::before {
    content: "";
    position: absolute;
    top: -10px;
    left: 50%;
    width: 16px;
    height: 16px;
    background: #fff;
    border-left: 3px solid #fbcfe8;
    border-top: 3px solid #fbcfe8;
    transform: translateX(-50%) rotate(45deg);
}
.sp-greeting-close {
    position: absolute;
    top: 6px;
    left: 8px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #fdf2f8;
    border: none;
    color: #9d6c84;
    cursor: pointer;
    font-size: 13px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
}
.sp-greeting-close:hover { background: #fce7f3; color: #831843; }

@keyframes sp-bubble-in {
    0%   { opacity: 0; transform: translate(-50%, 28px) scale(0.85); }
    100% { opacity: 1; transform: translate(-50%, 12px) scale(1); }
}

@media (max-width: 480px) {
    .sp-greeting-bubble { padding: 14px 38px 14px 18px; }
    .sp-greeting-bubble p { font-size: 15px; }
}

/* Floating decorations */
.sp-bg-decor {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}
.sp-bg-heart {
    position: absolute;
    font-size: 28px;
    opacity: 0.7;
    animation: sp-float 8s ease-in-out infinite;
    filter: drop-shadow(0 3px 6px rgba(236, 72, 153, 0.25));
}
.sp-bg-heart-1 { top: 8%;  left: 6%;  animation-delay: 0s;   font-size: 30px; }
.sp-bg-heart-2 { top: 18%; right: 9%; animation-delay: 1.2s; font-size: 24px; }
.sp-bg-heart-3 { top: 38%; left: 4%;  animation-delay: 2.4s; font-size: 32px; }
.sp-bg-heart-4 { top: 50%; right: 5%; animation-delay: 0.8s; font-size: 26px; }
.sp-bg-heart-5 { top: 68%; left: 8%;  animation-delay: 3s;   font-size: 22px; }
.sp-bg-heart-6 { top: 78%; right: 7%; animation-delay: 1.8s; font-size: 30px; }
.sp-bg-heart-7 { top: 28%; left: 50%; animation-delay: 2.2s; font-size: 20px; }
.sp-bg-heart-8 { top: 88%; left: 45%; animation-delay: 4s;   font-size: 24px; }
@keyframes sp-float {
    0%, 100% { transform: translateY(0) rotate(0); }
    50%      { transform: translateY(-18px) rotate(8deg); }
}

/* Floating cart button */
.sp-cart-toggle {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 9999;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #a855f7, #ec4899);
    color: #fff;
    font-size: 32px;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(168, 85, 247, 0.4);
    transition: transform 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}
.sp-cart-toggle:hover { transform: scale(1.1) rotate(-5deg); }
.sp-cart-count {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #fbbf24;
    color: #1f2937;
    font-size: 14px;
    font-weight: 800;
    min-width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid #fff;
    padding: 0 6px;
}

/* Products grid */
.sp-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
}

.sp-product-card {
    background: #fff;
    border-radius: 20px;
    padding: 16px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 12px;
    border: 3px solid #fdf2f8;
}
.sp-product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(236, 72, 153, 0.18);
    border-color: #fbcfe8;
}

.sp-product-image {
    aspect-ratio: 1 / 1;
    border-radius: 14px;
    overflow: hidden;
    background: linear-gradient(135deg, #fce7f3, #ede9fe);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}
.sp-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.sp-product-image--zoomable {
    padding: 0;
    border: none;
    cursor: zoom-in;
    transition: transform 0.2s ease;
    width: 100%;
    font-family: inherit;
}
.sp-product-image--zoomable:hover { transform: scale(1.02); }
.sp-product-image--zoomable:hover .sp-zoom-hint,
.sp-product-image--zoomable:focus-visible .sp-zoom-hint {
    opacity: 1;
    transform: translate(0, 0) scale(1);
}
.sp-zoom-hint {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(255, 255, 255, 0.92);
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    opacity: 0;
    transform: translate(-4px, -4px) scale(0.85);
    transition: opacity 0.2s ease, transform 0.2s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    pointer-events: none;
}
/* On touch devices (no hover), keep the hint always visible but subtle */
@media (hover: none) {
    .sp-zoom-hint { opacity: 0.75; transform: none; }
}
.sp-no-image {
    font-size: 60px;
    opacity: 0.5;
}

.sp-product-name {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
    text-align: center;
}

.sp-product-price {
    text-align: center;
    font-size: 22px;
    font-weight: 800;
    color: #ec4899;
}

.sp-stock-badge {
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    color: #166534;
    background: #dcfce7;
    border-radius: 999px;
    padding: 4px 12px;
    align-self: center;
}
.sp-stock-badge strong { font-variant-numeric: tabular-nums; }
.sp-stock-badge--low {
    background: #fef3c7;
    color: #92400e;
}
.sp-stock-badge--out {
    background: #fee2e2;
    color: #991b1b;
}

.sp-product-card.is-out-of-stock {
    opacity: 0.72;
}
.sp-product-card.is-out-of-stock .sp-product-image {
    filter: grayscale(0.5);
}
.sp-add-to-cart:disabled,
.sp-add-to-cart[disabled] {
    background: linear-gradient(135deg, #d1d5db, #9ca3af);
    cursor: not-allowed;
    opacity: 0.85;
}
.sp-add-to-cart:disabled:hover,
.sp-add-to-cart[disabled]:hover {
    transform: none;
    box-shadow: none;
}

.sp-add-to-cart {
    background: linear-gradient(135deg, #60a5fa, #a855f7);
    color: #fff;
    border: none;
    padding: 12px 16px;
    border-radius: 22px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: center;
    line-height: 1.25;
    min-height: 48px;
    width: 100%;
}
.sp-add-to-cart .sp-btn-icon {
    font-size: 22px;
    line-height: 1;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.22);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.sp-add-to-cart .sp-btn-text { flex: 1; }
.sp-add-to-cart:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(96, 165, 250, 0.4);
}
.sp-add-to-cart:active { transform: scale(0.97); }

/* Empty state */
.sp-empty-state {
    text-align: center;
    padding: 60px 20px;
    background: #fdf4ff;
    border-radius: 24px;
    border: 3px dashed #f0abfc;
}
.sp-empty-emoji {
    font-size: 80px;
    margin-bottom: 12px;
}

/* Cart panel */
.sp-cart-panel {
    position: fixed;
    inset: 0;
    z-index: 10000;
}
.sp-cart-panel[hidden] { display: none; }

.sp-cart-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(2px);
}

.sp-cart-drawer {
    position: absolute;
    top: 0;
    bottom: 0;
    right: 0;
    width: 100%;
    max-width: 420px;
    background: #fff;
    box-shadow: -10px 0 40px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    padding: 20px;
    overflow-y: auto;
    animation: sp-slide-in 0.25s ease;
}

@keyframes sp-slide-in {
    from { transform: translateX(-100%); }
    to   { transform: translateX(0); }
}

.sp-cart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 12px;
    border-bottom: 2px solid #fce7f3;
    margin-bottom: 12px;
}
.sp-cart-header h2 { margin: 0; font-size: 24px; color: #a855f7; }
.sp-cart-close {
    background: #fce7f3;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    color: #831843;
}

.sp-cart-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sp-cart-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fdf2f8;
    padding: 12px;
    border-radius: 14px;
}
.sp-cart-item img {
    width: 60px;
    height: 60px;
    border-radius: 10px;
    object-fit: cover;
}
.sp-cart-item-info { flex: 1; }
.sp-cart-item-name { font-weight: 700; font-size: 15px; }
.sp-cart-item-price { color: #ec4899; font-weight: 600; font-size: 14px; }
.sp-qty-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}
.sp-qty-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    background: #fff;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    color: #a855f7;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
.sp-qty-btn:hover { background: #a855f7; color: #fff; }
.sp-qty-value { min-width: 24px; text-align: center; font-weight: 700; }
.sp-remove-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
}

.sp-cart-empty {
    text-align: center;
    padding: 40px 20px;
}
.sp-cart-empty[hidden] { display: none; }

.sp-cart-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: #fef3c7;
    border-radius: 14px;
    font-size: 20px;
    margin-top: 16px;
}
.sp-cart-total strong { color: #d97706; font-size: 22px; }
.sp-cart-total[hidden] { display: none; }

.sp-cart-form {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.sp-cart-form[hidden] { display: none; }
.sp-cart-form h3 { margin: 0; color: #a855f7; }
.sp-cart-form label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-weight: 600;
    font-size: 15px;
}
.sp-cart-form input,
.sp-cart-form textarea {
    padding: 12px 14px;
    border-radius: 12px;
    border: 2px solid #e5e7eb;
    font-size: 16px;
    font-family: inherit;
    background: #fff;
}
.sp-cart-form input:focus,
.sp-cart-form textarea:focus {
    outline: none;
    border-color: #a855f7;
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.2);
}

.sp-submit-btn {
    background: linear-gradient(135deg, #ec4899, #f97316);
    color: #fff;
    border: none;
    padding: 16px 24px;
    border-radius: 999px;
    font-size: 18px;
    font-weight: 800;
    cursor: pointer;
    margin-top: 8px;
    font-family: inherit;
    transition: transform 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    line-height: 1.25;
}
.sp-submit-btn .sp-btn-icon {
    font-size: 22px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.sp-submit-btn:hover { transform: translateY(-2px); }
.sp-submit-btn:disabled { opacity: 0.6; cursor: wait; }

.sp-form-message {
    text-align: center;
    font-weight: 700;
    margin-top: 8px;
}
.sp-form-message.is-error { color: #dc2626; }
.sp-form-message.is-success { color: #16a34a; }

.sp-cart-success {
    text-align: center;
    padding: 40px 20px;
}
.sp-cart-success[hidden] { display: none; }
.sp-success-emoji { font-size: 80px; animation: sp-pop 0.4s ease; }
@keyframes sp-pop {
    from { transform: scale(0); }
    to   { transform: scale(1); }
}

/* ===== Lightbox ===== */
.sp-lightbox {
    position: fixed;
    inset: 0;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    animation: sp-fade-in 0.18s ease;
}
.sp-lightbox[hidden] { display: none; }
@keyframes sp-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}
.sp-lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(36, 8, 25, 0.85);
    backdrop-filter: blur(6px);
    cursor: zoom-out;
}
.sp-lightbox-close {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 2;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: #4a2c3f;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    transition: transform 0.15s ease;
}
.sp-lightbox-close:hover { transform: scale(1.08); }
.sp-lightbox-figure {
    position: relative;
    z-index: 1;
    margin: 0;
    max-width: 100%;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    animation: sp-zoom-in 0.22s ease;
}
@keyframes sp-zoom-in {
    from { transform: scale(0.92); opacity: 0; }
    to   { transform: scale(1);    opacity: 1; }
}
.sp-lightbox-figure img {
    max-width: 100%;
    max-height: calc(100vh - 120px);
    object-fit: contain;
    border-radius: 18px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    background: #fff;
}
.sp-lightbox-figure figcaption {
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    text-align: center;
    background: rgba(255, 255, 255, 0.12);
    padding: 8px 18px;
    border-radius: 999px;
    backdrop-filter: blur(8px);
}
.sp-lightbox-figure figcaption:empty { display: none; }

@media (max-width: 480px) {
    .sp-lightbox { padding: 12px; }
    .sp-lightbox-close { width: 42px; height: 42px; font-size: 18px; top: 10px; left: 10px; }
    .sp-lightbox-figure img { max-height: calc(100vh - 100px); }
    .sp-lightbox-figure figcaption { font-size: 16px; }
}

/* Mobile */
@media (max-width: 480px) {
    .sp-cart-toggle { width: 60px; height: 60px; font-size: 26px; bottom: 16px; left: 16px; }
    .sp-products-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
    .sp-product-card { padding: 12px; }
    .sp-product-name { font-size: 15px; }
    .sp-product-price { font-size: 18px; }
    .sp-add-to-cart { padding: 10px 12px; font-size: 14px; gap: 6px; border-radius: 18px; }
    .sp-add-to-cart .sp-btn-icon { width: 30px; height: 30px; font-size: 20px; }
    .sp-zoom-hint { width: 28px; height: 28px; font-size: 14px; }
}
