/* Store page styling - complements styles.css (dark + cyan theme) */

.store-hero {
    padding: 6rem 1rem 3rem;
    background: linear-gradient(135deg, #1e1e1e, #0f0f0f);
    text-align: center;
}
.store-hero h1 { color: #00ffff; font-size: 2.5rem; margin-bottom: 0.5rem; }
.store-hero p  { color: #bbbbbb; }

.store { background-color: #1e1e1e; padding: 3rem 0 5rem; min-height: 50vh; }
.store-status { color: #bbbbbb; margin-bottom: 1.5rem; }
.store-status.error { color: #ff3c3c; }

/* Product grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
}
.product-card {
    background-color: #2a2a2a;
    border-radius: 8px;
    padding: 1rem;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex; flex-direction: column; align-items: center;
}
.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 255, 255, 0.2);
}
.product-card img {
    width: 100%; max-width: 240px; aspect-ratio: 1 / 1; object-fit: contain;
    background-color: #1a1a1a; border-radius: 6px; margin-bottom: 0.75rem;
}
.product-card h3 { font-size: 1rem; color: #ffffff; margin-bottom: 0.5rem; }

.cart-toggle { color: #00ffff !important; font-weight: bold; }

/* Modal */
.modal { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 2000; }
.modal.hidden { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.75); }
.modal-dialog {
    position: relative; background-color: #1e1e1e; border: 1px solid #2a2a2a;
    border-radius: 10px; max-width: 720px; width: calc(100% - 2rem);
    max-height: 90vh; overflow-y: auto; padding: 2rem; text-align: left;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}
.modal-close {
    position: absolute; top: 0.5rem; right: 0.75rem; background: transparent;
    border: none; color: #ffffff; font-size: 2rem; line-height: 1; cursor: pointer;
}
.modal-close:hover { color: #00ffff; }

/* Product detail */
.product-detail { display: grid; grid-template-columns: 1fr; gap: 1.25rem; }
@media (min-width: 640px) { .product-detail { grid-template-columns: 1fr 1fr; } }
.product-detail img {
    width: 100%; aspect-ratio: 1 / 1; object-fit: contain;
    background-color: #121212; border-radius: 6px;
}
.product-detail h2 { color: #00ffff; margin-bottom: 0.5rem; text-align: left; }

.variant-row { margin: 0.75rem 0; text-align: left; }
.variant-row label { display: block; color: #bbbbbb; margin-bottom: 0.25rem; font-size: 0.9rem; }
.variant-row select, .variant-row input[type="number"] {
    width: 100%; padding: 0.6rem; background-color: #2a2a2a; color: #ffffff;
    border: 1px solid #333; border-radius: 5px; font-size: 1rem;
}
.variant-price { font-size: 1.4rem; color: #00ffff; font-weight: bold; margin: 0.5rem 0 1rem; text-align: left; }

.add-to-cart-btn {
    background-color: #00ffff; color: #121212; padding: 0.75rem 1.5rem;
    border: none; border-radius: 5px; font-weight: bold; cursor: pointer;
    width: 100%; transition: background-color 0.3s ease;
}
.add-to-cart-btn:hover { background-color: #00e6e6; }
.add-to-cart-btn:disabled { background-color: #666; cursor: not-allowed; }


/* Cart drawer */
.cart-drawer {
    position: fixed; top: 0; right: 0; height: 100vh; width: 360px; max-width: 100vw;
    background-color: #1a1a1a; border-left: 1px solid #2a2a2a;
    display: flex; flex-direction: column; z-index: 2500;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.6);
    transform: translateX(0); transition: transform 0.3s ease;
}
.cart-drawer.hidden { transform: translateX(100%); pointer-events: none; }
.cart-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 1rem 1.25rem; border-bottom: 1px solid #2a2a2a;
}
.cart-header h3 { color: #00ffff; margin: 0; }
.cart-header .modal-close { position: static; font-size: 1.75rem; }
.cart-items { flex: 1; overflow-y: auto; padding: 1rem 1.25rem; }
.cart-empty { color: #777; text-align: center; margin-top: 2rem; }
.cart-item {
    display: flex; gap: 0.75rem; padding: 0.75rem 0;
    border-bottom: 1px solid #2a2a2a; text-align: left; align-items: center;
}
.cart-item img {
    width: 56px; height: 56px; object-fit: contain;
    background: #121212; border-radius: 4px; flex-shrink: 0;
}
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-info .name {
    display: block; font-weight: 600; color: #fff; font-size: 0.9rem;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cart-item-info .variant { display: block; font-size: 0.8rem; color: #999; }
.cart-item-info .price { display: block; color: #00ffff; font-size: 0.9rem; margin-top: 0.25rem; }
.cart-item-controls { display: flex; flex-direction: column; align-items: flex-end; gap: 0.25rem; }
.cart-item-controls input {
    width: 56px; padding: 0.25rem; background: #2a2a2a; color: #fff;
    border: 1px solid #333; border-radius: 4px; text-align: center;
}
.cart-item-controls button {
    background: transparent; color: #ff3c3c; border: none;
    cursor: pointer; font-size: 0.8rem; padding: 0.1rem 0.25rem;
}
.cart-footer { padding: 1rem 1.25rem; border-top: 1px solid #2a2a2a; }
.cart-subtotal {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 0.75rem; color: #fff;
}
.cart-subtotal strong { color: #00ffff; font-size: 1.25rem; }
.cart-footer .cta-button {
    display: inline-block; width: 100%; text-align: center;
    border: none; cursor: pointer; font-size: 1rem;
}
.cart-footer .cta-button:disabled { background-color: #666; cursor: not-allowed; opacity: 0.7; }

/* Checkout */
.checkout-form { text-align: left; }
.checkout-note { color: #bbbbbb; margin-bottom: 1rem; font-size: 0.9rem; text-align: left; }
#checkoutTitle { color: #00ffff; margin-bottom: 0.75rem; text-align: left; }

.spinner {
    display: inline-block; width: 1em; height: 1em;
    border: 2px solid rgba(255,255,255,0.3); border-top-color: #00ffff;
    border-radius: 50%; animation: spin 0.8s linear infinite;
    vertical-align: middle; margin-right: 0.4rem;
}
@keyframes spin { to { transform: rotate(360deg); } }
