:root {
    --swatch-red: #e31837;
    --dark: #111;
    --light: #f4f4f4;
    --white: #ffffff;
    --gray: #888;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 96px;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--light);
    color: var(--dark);
    overflow-x: hidden;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    background-color: var(--white);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.logo {
    font-weight: 800;
    font-size: 24px;
    letter-spacing: 2px;
}

.collab {
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 1px;
    color: var(--gray);
}

.cart-icon {
    font-size: 24px;
    cursor: pointer;
}

.discount-banner {
    background-color: var(--swatch-red);
    color: var(--white);
    text-align: center;
    padding: 10px;
    font-weight: 600;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    position: sticky;
    top: 68px;
    z-index: 99;
}

.timer {
    font-variant-numeric: tabular-nums;
    font-weight: 800;
    background: var(--white);
    color: var(--swatch-red);
    padding: 4px 12px;
    border-radius: 4px;
    animation: pulse 1s infinite alternate;
}

@keyframes pulse {
    from { transform: scale(1); }
    to { transform: scale(1.05); }
}

.hero {
    height: 80vh;
    background-color: var(--dark);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 20px;
    background-image: linear-gradient(rgba(0,0,0,0.7), rgba(0,0,0,0.7)), url('static/popstrap.shop_691714110_18106246318787759_2012931321731506303_n.jpg');
    background-size: cover;
    background-position: center;
}

.hero-content h1 {
    font-size: 4rem;
    font-weight: 800;
    margin-bottom: 20px;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.hero-content p {
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto 40px;
    line-height: 1.6;
    color: #ccc;
}

.btn {
    display: inline-block;
    background-color: var(--swatch-red);
    color: var(--white);
    padding: 15px 30px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    border-radius: 30px;
    transition: background-color 0.3s, transform 0.3s;
}

.btn:hover {
    background-color: #c1122a;
    transform: translateY(-2px);
}

.collection {
    padding: 80px 20px;
    max-width: 1400px;
    margin: 0 auto;
}

.collection h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 50px;
    font-weight: 800;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 40px;
}

.product-card {
    background: var(--white);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
}

.product-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.1);
}

.product-image {
    width: 100%;
    height: 350px;
    object-fit: cover;
    border-bottom: 1px solid #eee;
}

.product-info {
    padding: 20px;
}

.product-title {
    font-size: 1.2rem;
    font-weight: 800;
    margin-bottom: 10px;
}

.product-price {
    font-size: 1.1rem;
    color: var(--swatch-red);
    font-weight: 600;
    margin-bottom: 15px;
}

.product-price .old-price {
    color: var(--gray);
    text-decoration: line-through;
    font-size: 0.9rem;
    margin-left: 10px;
}

.stock-status {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--swatch-red);
    margin-bottom: 20px;
}

.stock-dot {
    width: 10px;
    height: 10px;
    background-color: var(--swatch-red);
    border-radius: 50%;
    animation: blink 1s infinite;
}

@keyframes blink {
    0% { opacity: 1; }
    50% { opacity: 0.4; }
    100% { opacity: 1; }
}

.stock-number {
    font-size: 1.1rem;
    font-weight: 800;
    padding: 2px 6px;
    background: #ffe5e5;
    border-radius: 4px;
    transition: all 0.3s;
}

.stock-number.changed {
    background: var(--swatch-red);
    color: white;
    transform: scale(1.2);
}

.buy-btn {
    width: 100%;
    padding: 12px;
    background: var(--dark);
    color: var(--white);
    border: none;
    border-radius: 5px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.buy-btn:hover {
    background: var(--swatch-red);
}

/* Purchase Popup */
.purchase-popup {
    position: fixed;
    bottom: 30px;
    left: 30px;
    background: var(--white);
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 1000;
    transform: translateX(-150%);
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    max-width: 350px;
    border-left: 4px solid var(--swatch-red);
}

.purchase-popup.show {
    transform: translateX(0);
}

.purchase-popup img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 5px;
}

.popup-text {
    font-size: 0.9rem;
}

#popup-name {
    font-weight: 800;
    margin-bottom: 2px;
}

.popup-action {
    color: var(--gray);
    margin-bottom: 4px;
}

#popup-model {
    color: var(--dark);
    font-weight: 600;
}

.popup-time {
    font-size: 0.75rem;
    color: var(--swatch-red);
    font-weight: 600;
}

footer {
    background: var(--dark);
    color: var(--gray);
    text-align: center;
    padding: 40px 20px;
    margin-top: 50px;
}

@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 2.5rem;
    }
    .header {
        padding: 15px 20px;
    }
    .collab {
        display: none;
    }
    .purchase-popup {
        bottom: 20px;
        left: 20px;
        right: 20px;
        max-width: none;
    }
}

/* Cart Sidebar */
.cart-sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: var(--white);
    box-shadow: -5px 0 15px rgba(0,0,0,0.1);
    z-index: 1000;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
}

.cart-sidebar.open {
    right: 0;
}

.cart-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.close-cart, .close-checkout {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--gray);
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.cart-item {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
}

.cart-item img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 5px;
}

.cart-item-details {
    flex: 1;
}

.cart-item-title {
    font-weight: 600;
    margin-bottom: 5px;
}

.cart-item-price {
    color: var(--swatch-red);
    font-weight: 800;
}

.cart-item-remove {
    background: none;
    border: none;
    color: var(--gray);
    cursor: pointer;
    text-decoration: underline;
    font-size: 0.8rem;
    margin-top: 5px;
}

.cart-footer {
    padding: 20px;
    border-top: 1px solid #eee;
}

.cart-total {
    font-size: 1.2rem;
    font-weight: 800;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
}

.checkout-btn {
    width: 100%;
    padding: 15px;
    background: var(--swatch-red);
    color: var(--white);
    border: none;
    border-radius: 5px;
    font-weight: 800;
    cursor: pointer;
    text-align: center;
}

.cart-overlay, .checkout-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    display: none;
}

.cart-overlay.show, .checkout-overlay.show {
    display: block;
}

/* Checkout Modal */
.checkout-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--white);
    border-radius: 10px;
    z-index: 1001;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    display: none;
}

.checkout-modal.show {
    display: block;
}

.checkout-content {
    padding: 30px;
}

.checkout-content h2 {
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.close-checkout {
    position: absolute;
    top: 20px;
    right: 20px;
}

.checkout-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

@media (max-width: 768px) {
    .checkout-layout {
        grid-template-columns: 1fr;
    }
    .cart-sidebar {
        width: 100%;
        right: -100%;
    }
}

.order-summary {
    background: var(--light);
    padding: 20px;
    border-radius: 5px;
}

.order-summary h3, .checkout-step h3 {
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.checkout-step.hidden {
    display: none;
}

.checkout-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 0.95rem;
}

.checkout-total {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #ddd;
    font-weight: 800;
    font-size: 1.2rem;
    display: flex;
    justify-content: space-between;
}

.checkout-form .form-group {
    margin-bottom: 15px;
}

.checkout-form label {
    display: block;
    margin-bottom: 5px;
    font-size: 0.9rem;
    font-weight: 600;
}

.checkout-form input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

.checkout-form select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    background-color: var(--white);
    cursor: pointer;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.payment-error {
    display: none;
    margin: 0 0 12px;
    padding: 10px 12px;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.35;
    color: #b91c1c;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 5px;
}

.payment-error.is-visible {
    display: block;
}

.action-btn {
    width: 100%;
    padding: 15px;
    background: var(--swatch-red);
    color: var(--white);
    border: none;
    border-radius: 5px;
    font-weight: 800;
    cursor: pointer;
    margin-top: 10px;
}

.action-btn:hover {
    background: #c1122a;
}

.back-btn {
    width: 100%;
    padding: 10px;
    background: none;
    color: var(--gray);
    border: none;
    font-weight: 600;
    cursor: pointer;
    margin-top: 5px;
    text-decoration: underline;
}

.back-btn:hover {
    color: var(--dark);
}

.security-badges {
    margin-top: 15px;
    text-align: center;
}

.security-badges img {
    max-width: 100%;
    height: auto;
}
