.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    padding: 2rem 0;
}

@media (max-width: 640px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
        padding: 1rem 0;
    }
}

@media (max-width: 380px) {
    .products-grid {
        grid-template-columns: 1fr;
    }
}

/* Compact mode for Artist Pages (Sliding Display) */
.products-grid.compact {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 1.5rem;
    padding: 1.5rem 0.5rem;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

.products-grid.compact::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.products-grid.compact .product-card {
    flex: 0 0 260px; /* Fixed width for sliding items */
    width: 260px;
    max-width: 260px;
    scroll-snap-align: start;
    padding: 0.5rem;
    background: transparent !important;
    border: none !important;
    backdrop-filter: none !important;
    box-shadow: none !important;
    overflow: hidden;
}

@media (max-width: 480px) {
    .products-grid.compact .product-card {
        flex: 0 0 220px;
        width: 220px;
        max-width: 220px;
    }
}

.products-grid.compact .product-image-wrapper {
    width: 100%;
    height: 260px; /* Fixed height for consistency */
    background: radial-gradient(circle at center, rgba(255,255,255,0.03) 0%, transparent 80%);
    border-radius: 20px;
    margin-bottom: 1.25rem;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.products-grid.compact .product-image-wrapper img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.products-grid.compact .product-name {
    font-size: 1rem;
}

.products-grid.compact .product-price {
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.products-grid.compact .variant-selector {
    margin-bottom: 1rem;
    gap: 8px;
}

.products-grid.compact .variant-dot {
    width: 18px;
    height: 18px;
}

.products-grid.compact .paypal-button-container {
    min-height: 40px;
}

.product-card {
    background: transparent;
    border: none;
    border-radius: 32px;
    padding: 1.25rem;
    transition: all 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
    display: flex;
    flex-direction: column;
    position: relative;
    text-align: left;
}

.product-card:hover {
    transform: translateY(-8px);
    border-color: rgba(139, 63, 204, 0.3);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

.product-image-wrapper {
    width: 100%;
    aspect-ratio: 1;
    background: radial-gradient(circle at center, rgba(255,255,255,0.03) 0%, transparent 70%);
    border-radius: 24px;
    margin-bottom: 1.25rem;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 1.5rem;
}

.product-image-wrapper img {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: all 0.5s ease;
    filter: drop-shadow(0 10px 20px rgba(0,0,0,0.2));
}

.product-card:hover .product-image-wrapper img {
    transform: scale(1.05);
    filter: drop-shadow(0 15px 30px rgba(0,0,0,0.4));
}

.variant-selector {
    display: flex;
    gap: 12px;
    margin-bottom: 1.5rem;
    align-items: center;
}

.variant-dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid transparent;
    padding: 2px;
    cursor: pointer;
    transition: all 0.3s;
    background-clip: content-box;
}

.variant-dot.active {
    border-color: #8B3FCC;
}

.product-meta {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.product-tag {
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #8B3FCC;
    margin-bottom: 0.4rem;
    display: block;
}

.product-name {
    font-size: 1.3rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: -0.5px;
    margin-bottom: 0.5rem;
    color: #fff;
    line-height: 1.1;
}

.product-price {
    font-size: 1.6rem;
    font-weight: 900;
    color: #fff;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.product-price small {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 400;
}

.paypal-button-container {
    width: 100%;
    min-height: 48px;
}

/* Add to Cart Button */
.add-to-cart-btn {
    width: 100%;
    padding: 14px;
    background: #300359;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 0.8rem;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    margin-top: auto;
}

.add-to-cart-btn:hover {
    background: #8B3FCC;
    transform: scale(1.02);
}

/* Floating Cart Button */
.floating-cart-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 70px;
    height: 70px;
    background: #300359;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 15000;
    cursor: pointer;
    box-shadow: none;
    transition: all 0.3s;
}

.floating-cart-btn:hover {
    background: #8B3FCC;
    transform: scale(1.02);
}

@media (max-width: 640px) {
    .floating-cart-btn {
        width: 56px;
        height: 56px;
        bottom: 20px;
        right: 20px;
    }
    .floating-cart-btn svg {
        width: 22px;
        height: 22px;
    }
    .cart-count {
        width: 20px;
        height: 20px;
        font-size: 0.65rem;
        top: 2px;
        right: 2px;
    }
}

.cart-count {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #ff3e3e;
    color: #fff;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #050505;
}

/* Cart Drawer */
.cart-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 450px;
    height: 100%;
    background: #0a0a0a;
    z-index: 21000;
    box-shadow: -20px 0 60px rgba(0,0,0,0.8);
    transition: all 0.5s cubic-bezier(0.77, 0, 0.175, 1);
    display: flex;
    flex-direction: column;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    transform: translateX(100%);
    visibility: hidden;
}

.cart-drawer.open {
    transform: translateX(0);
    visibility: visible;
}

@media (max-width: 600px) {
    .cart-drawer {
        width: 100%;
        height: 100dvh;
        height: 100vh; /* fallback */
        border-left: none;
        border-radius: 0;
    }
    .cart-header {
        padding: 1.25rem 1rem;
    }
    .cart-items {
        padding: 1rem;
    }
    .cart-footer {
        padding: 1.25rem 1rem;
    }
}

.cart-header {
    padding: 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
}

.cart-footer {
    padding: 2rem;
    background: rgba(255,255,255,0.02);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.cart-item {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
    align-items: center;
}

.cart-item-img {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    background: rgba(255,255,255,0.03);
    object-fit: contain;
}

.cart-item-info {
    flex: 1;
}

.cart-item-name {
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 2px;
}

.cart-item-variant {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 4px;
}

.cart-item-price {
    font-weight: 800;
    color: #8B3FCC;
}

.remove-item {
    color: rgba(255, 62, 62, 0.7);
    cursor: pointer;
    font-size: 0.65rem;
    text-transform: uppercase;
    font-weight: 700;
    margin-left: auto;
}

.shipping-form {
    margin-top: 1.5rem;
}

.shipping-form h3 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 1rem;
    color: rgba(255, 255, 255, 0.5);
}

.address-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.address-grid .full {
    grid-column: 1 / -1;
}

.cart-input {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 10px 12px;
    color: #fff;
    font-family: 'Outfit';
    font-size: 0.8rem;
    width: 100%;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    font-size: 1.2rem;
    font-weight: 900;
    margin: 1.5rem 0;
}

@media (max-width: 500px) {
    .cart-drawer {
        width: 100%;
    }
    .address-grid {
        grid-template-columns: 1fr;
    }
    .cart-input {
        font-size: 16px; /* Prevent iOS auto-zoom */
    }
    .product-card {
        padding: 0.75rem;
        border-radius: 20px;
    }
    .product-image-wrapper {
        border-radius: 16px;
        padding: 1rem;
    }
    .product-name {
        font-size: 1rem;
    }
    .product-price {
        font-size: 1.3rem;
        margin-bottom: 1rem;
    }
    .add-to-cart-btn {
        padding: 12px;
        font-size: 0.75rem;
        min-height: 44px; /* Touch target */
    }
}
