/* ============================================================
   Print Shop — Cart + Modal Styles
   ============================================================ */

/* Buy Print button on header image */
.buy-print-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 5;
    background: rgba(255, 255, 255, 0.9);
    color: #222;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease;
    font-weight: 600;
}

.buy-print-btn:hover {
    background: white;
    transform: scale(1.03);
}

/* Cart toggle button in header */
.cart-toggle-btn {
    position: relative;
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
}

.cart-badge {
    position: absolute;
    top: -6px;
    right: -8px;
    background: #e74c3c;
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Shop Modal (size/frame selection) */
.shop-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    visibility: hidden;
}

.shop-modal.active {
    visibility: visible;
}

/* Shop page modal — wider, uses .open class instead of .active */
.shop-modal.open {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

.shop-modal.open .shop-modal-content {
    display: flex;
    border-radius: 2px;
    width: min(1100px, 95vw);
    max-width: none;
    max-height: 90vh;
    overflow-y: auto;
}

.shop-modal-content {
    background: #2a2a2a;
    border-radius: 16px;
    padding: 2rem;
    max-width: 420px;
    width: 90%;
    color: white;
    position: relative;
    animation: shopModalIn 0.3s ease-out;
}

@keyframes shopModalIn {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.shop-modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    color: #aaa;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 4px 8px;
}

.shop-modal-close:hover {
    color: white;
}

.shop-modal-content h2 {
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

/* Shop image preview */
.shop-image-preview {
    text-align: center;
    margin-bottom: 1.5rem;
}

.shop-image-preview img {
    max-width: 100%;
    max-height: 200px;
    object-fit: contain;
    border-radius: 8px;
}

.shop-image-preview p {
    margin-top: 0.5rem;
    color: #ccc;
    font-size: 0.9rem;
}

/* Shop form */
.shop-form label {
    margin-bottom: 0.25rem;
    font-size: 0.85rem;
    color: #aaa;
}

.shop-form select {
    width: 100%;
    padding: 0.6rem;
    margin-bottom: 1rem;
    background: #333;
    color: white;
    border: 1px solid #444;
    border-radius: 6px;
    font-size: 0.95rem;
}

.shop-form select:focus {
    outline: none;
    border-color: #888;
}

.shop-total {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: white;
}

/* Quantity selector in modal */
.quantity-selector {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: 1rem;
}

.quantity-selector button {
    width: 2.5rem;
    height: 2.5rem;
    border: 1px solid #444;
    background: #333;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.quantity-selector button:hover {
    background: #444;
}

.quantity-selector input[type="number"] {
    width: 3rem;
    height: 2.5rem;
    border: 1px solid #444;
    border-left: none;
    border-right: none;
    background: #222;
    color: white;
    text-align: center;
    font-size: 1rem;
    font-weight: 600;
    -moz-appearance: textfield;
}

.quantity-selector input[type="number"]::-webkit-inner-spin-button,
.quantity-selector input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
}

/* Quantity controls in cart panel */
.cart-item-qty {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.cart-item-qty button {
    width: 1.5rem;
    height: 1.5rem;
    border: 1px solid #444;
    background: #333;
    color: white;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    transition: background 0.15s;
}

.cart-item-qty button:hover {
    background: #444;
}

.cart-item-qty span {
    min-width: 1.5rem;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 600;
}

.shop-btn {
    width: 100%;
    padding: 0.75rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
}

.shop-btn-primary {
    background: white;
    color: #222;
    font-weight: 600;
}

.shop-btn-primary:hover:not(:disabled) {
    background: #eee;
    transform: scale(1.01);
}

.shop-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Cart overlay */
.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1999;
    display: none;
}

/* Cart panel */
.cart-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 380px;
    max-width: 90vw;
    height: 100%;
    background: #2a2a2a;
    color: white;
    z-index: 2001;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s ease-out;
    overflow-y: auto;
}

.cart-panel.active {
    transform: translateX(0);
}

/* Shop page uses .open instead of .active */
.cart-panel.open {
    right: 0;
}

.cart-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #333;
    position: sticky;
    top: 0;
    background: #2a2a2a;
    z-index: 1;
}

.cart-panel-header h2 {
    font-size: 1.2rem;
    margin: 0;
}

.cart-close-btn {
    background: none;
    border: none;
    color: #aaa;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 4px 8px;
}

.cart-close-btn:hover {
    color: white;
}

/* Cart items */
.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.5rem;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #333;
}

.cart-item-info {
    flex: 1;
    min-width: 0;
}

.cart-item-info strong {
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cart-item-info span {
    font-size: 0.8rem;
    color: #aaa;
}

.cart-item-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: 0.5rem;
}

.cart-item-price {
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
}

.cart-remove-btn {
    background: none;
    border: none;
    color: #888;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}

.cart-remove-btn:hover {
    color: #e74c3c;
}

.cart-empty {
    text-align: center;
    padding: 3rem 1.5rem;
    color: #888;
}

/* Cart footer */
.cart-footer {
    padding: 1.5rem;
    border-top: 1px solid #333;
    background: #222;
}

.cart-total {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-align: center;
}

#checkoutForm {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

#checkoutForm label {
    font-size: 0.8rem;
    color: #aaa;
}

#checkoutForm input {
    padding: 0.6rem;
    background: #333;
    color: white;
    border: 1px solid #444;
    border-radius: 6px;
    font-size: 0.95rem;
}

#checkoutForm input:focus {
    outline: none;
    border-color: #888;
}

.checkout-btn {
    margin-top: 0.5rem;
}

/* ============================================================
   Shop Page — Grid, Cards, Header
   ============================================================ */

.shop-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 2rem;
    background: rgba(26,26,26,0.95);
    border-bottom: 1px solid #333;
    position: sticky;
    top: 0;
    z-index: 10;
}

.shop-header h1 {
    font-size: 1.2rem;
    font-family: "Google Sans Flex", sans-serif;
}

.shop-header a {
    color: #aaa;
    text-decoration: none;
    font-size: 0.9rem;
}

.shop-header a:hover {
    color: white;
}

.shop-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

.shop-hero {
    text-align: center;
    margin-bottom: 3rem;
}

.shop-hero h2 {
    font-size: 1.8rem;
    font-weight: 400;
    color: #ddd;
    margin-bottom: 1rem;
    letter-spacing: -0.01em;
}

.shop-hero p {
    max-width: 640px;
    margin: 0 auto;
    color: #999;
    font-size: 1rem;
    line-height: 1.7;
}

.shop-divider {
    width: 60px;
    height: 1px;
    background: #333;
    margin: 0 auto 3rem;
}

.shop-features {
    display: flex;
    justify-content: center;
    gap: 2.5rem;
    margin-bottom: 3rem;
    padding: 1.25rem 0;
    border-top: 1px solid #333;
    border-bottom: 1px solid #333;
}

.shop-feature {
    text-align: center;
    font-size: 0.8rem;
    color: #777;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.shop-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 768px) {
    .shop-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1921px) {
    .shop-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.shop-card {
    border-radius: 2px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.25s ease;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    position: relative;
    opacity: 0;
    animation: cardFadeIn 0.4s ease forwards;
}

@keyframes cardFadeIn {
    to { opacity: 1; }
}

.shop-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.shop-card-image {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
}

.shop-card-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.75rem 1rem;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    height: 0;
    overflow: hidden;
    opacity: 0;
    transition: height 0.25s ease, opacity 0.25s ease, padding 0.25s ease;
}

.shop-card:hover .shop-card-info {
    height: auto;
    opacity: 1;
    padding: 0.75rem 1rem;
}

.shop-empty {
    color: #888;
    text-align: center;
    padding: 4rem 2rem;
    font-size: 1.1rem;
}

/* Shop modal — wider variant (shop_page.html) */
.shop-modal-content {
    display: flex;
}

.shop-image-section {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    min-width: 0;
}

.shop-image-section img {
    max-width: 100%;
    max-height: 75vh;
    object-fit: contain;
    border-radius: 2px;
}

.shop-form-section {
    width: 300px;
    min-width: 260px;
    padding: 2rem;
    border-left: 1px solid #444;
    display: flex;
    flex-direction: column;
}

.shop-form-section p.title {
    font-size: 1rem;
    color: #ddd;
    margin-bottom: 1.5rem;
    line-height: 1.4;
}

.shop-modal-close {
    position: fixed;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: #aaa;
    font-size: 2rem;
    cursor: pointer;
    z-index: 1002;
    line-height: 1;
}

.shop-modal-close:hover {
    color: white;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .cart-panel {
        width: 100%;
        max-width: 100vw;
    }

    .shop-modal-content {
        padding: 1.5rem;
        margin: 1rem;
    }

    .buy-print-btn {
        top: 8px;
        right: 8px;
        padding: 0.4rem 0.75rem;
        font-size: 0.8rem;
    }

    .shop-form-section {
        width: 100%;
        min-width: 0;
    }

    .shop-header { padding: 0.75rem 1rem; }
    .shop-content { padding: 1rem; }
    .shop-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 1rem; }
    .shop-card-info { height: auto; opacity: 0.8; padding: 0.75rem 1rem; }
}

/* ============================================================
   Shop Page Overrides (overrides gallery_list.css base styles)
   ============================================================ */
body {
    background: #1a1a1a;
    color: white;
}

.shop-subtitle {
    max-width: 640px;
    margin: 0 auto 3rem;
    color: #999;
    font-size: 1rem;
    line-height: 1.7;
    text-align: center;
}

.shop-card-prices {
    font-size: 0.85rem;
    color: #ddd;
}

/* Shop page cart toggle — white icon on dark header */
.shop-header .cart-toggle-btn {
    background: none;
    border: none;
    color: #aaa;
    cursor: pointer;
    font-size: 1.3rem;
    padding: 0.25rem;
    position: relative;
}

.shop-header .cart-toggle-btn:hover {
    color: white;
}

/* Buy Print button on shop page header images */
.buy-print-btn {
    cursor: pointer;
}
