/* ========================================
   SHOP PAGE STYLES
   ======================================== */

/* Shop Hero Section */
.shop-hero {
    padding: 5rem 0 4rem 0;
    background-color: #fff;
}

.shop-hero .section_title h1 {
    text-align: center;
    margin: 1rem 0 2rem 0;
}

.shop-hero .subtitle_description {
    text-align: center;
    margin: 0 auto;
}

/* Products Section */
.products-section {
    padding: 3rem 0 5rem 0;
    background-color: #fff;
}

/* Loading State */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    gap: 1.5rem;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f0f0f0;
    border-top: 4px solid var(--hello-hope-red);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-state p {
    font-size: 1.1rem;
    color: var(--text-secondary);
}

/* Error State */
.error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
    gap: 1rem;
}

.error-state svg {
    width: 64px;
    height: 64px;
    color: var(--hello-hope-red);
}

.error-state h3 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin: 0;
}

.error-state p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin: 0.5rem 0;
}

.btn-retry {
    margin-top: 1rem;
    padding: 0.875rem 2rem;
    background: linear-gradient(90deg, black 50%, var(--hello-hope-red) 50%);
    background-size: 200% 100%;
    background-position: 100% 0;
    color: white;
    border: none;
    border-radius: 25px;
    font-family: var(--font-primary);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-retry:hover {
    background-position: 0 0;
    transform: translateY(-2px);
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2.5rem;
    margin-top: 2rem;
    padding-inline: 2rem;
}

/* Product Card */
.product-card {
    background-image: url('../logos/pattern/light_gray_hello_hope_patterns.png');
    background-size: cover;
    background-position: center;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-5px);
    border-color: var(--hello-hope-red);
    box-shadow: 0 8px 20px rgba(190, 30, 45, 0.15);
}

.product-image {
    position: relative;
    width: 100%;
    padding-top: 100%; /* 1:1 Aspect Ratio */
    background-color: #ffffff;
    overflow: hidden;
}

.product-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.sold-out-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    z-index: 10;
}

.product-info {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-title {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--hello-hope-red);
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.product-description {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1rem;
    flex: 1;
}

.product-footer {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: auto;
}

.product-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.size-selector {
    display: flex;
    align-items: center;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    background-color: #f9f9f9;
    flex: 1;
    min-width: 80px;
}

.size-input {
    border: none;
    background-color: #f9f9f9;
    height: 36px;
    width: 100%;
    padding: 0 0.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    font-family: var(--font-primary);
}

.size-input:focus {
    outline: none;
    background-color: #f0f0f0;
}

.quantity-selector {
    display: flex;
    align-items: center;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    background-color: #f9f9f9;
}

.qty-btn {
    background-color: #f9f9f9;
    border: none;
    color: var(--text-primary);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.qty-btn:hover {
    background-color: var(--hello-hope-red);
    color: white;
}

.qty-input {
    border: none;
    background-color: #f9f9f9;
    width: 50px;
    height: 36px;
    text-align: center;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    -moz-appearance: textfield;
}

.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.qty-input:focus {
    outline: none;
    background-color: #f0f0f0;
}

.product-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--hello-hope-red);
}

.btn-add-to-cart {
    background: #BE1E2D;
    background-size: 200% 100%;
    background-position: 100% 0;
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 25px;
    font-family: var(--font-primary);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.btn-add-to-cart:hover:not(:disabled) {
    background-position: 0 0;
    transform: translateY(-2px);
}

.btn-add-to-cart:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-add-to-cart svg {
    width: 18px;
    height: 18px;
}

.btn-add-to-cart.in-cart {
    background: linear-gradient(90deg, #28a745 50%, #218838 50%);
    background-size: 200% 100%;
    background-position: 100% 0;
}

.btn-add-to-cart.in-cart:hover {
    background-position: 0 0;
}

/* Cart Notification */
.cart-notification {
    position: fixed;
    top: 100px;
    right: -300px;
    background-color: #28a745;
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
    z-index: 10000;
    transition: right 0.3s ease;
}

.cart-notification.show {
    right: 20px;
}

.cart-notification svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 2rem;
    }
}

@media (max-width: 768px) {
    .shop-hero {
        padding: 6rem 0 3rem 0;
    }

    .products-section {
        padding: 2rem 0 3rem 0;
    }

    .products-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .product-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .product-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .quantity-selector {
        width: 100%;
        justify-content: space-between;
    }

    .btn-add-to-cart {
        width: 100%;
        justify-content: center;
    }

    .cart-notification {
        right: -250px;
        max-width: calc(100% - 40px);
    }

    .cart-notification.show {
        right: 20px;
    }
}

@media (max-width: 480px) {
    .shop-hero .section_title h1 {
        font-size: 4rem;
    }

    .product-card {
        border-radius: 10px;
    }

    .product-info {
        padding: 1.25rem;
    }

    .product-title {
        font-size: 1.25rem;
    }

    .product-price {
        font-size: 1.3rem;
    }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
