/* ===================================
       1. CSS VARIABLES / ROOT STYLES
    =================================== */
:root {
    --primary-color: #E63E30;
    --secondary-color: #F68B24;
    --dark-color: #333333;
    --light-color: #F8F9FA;
    --text-color: #333333;
    --text-muted: #6c757d;
    --border-color: #E1E1E1;
    --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 10px 25px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.1);
}

/* ===================================
       2. LAYOUT COMPONENTS
    =================================== */

/* Hero Banner */
.hero-banner {
    position: relative;
    background-size: cover;
    background-position: center;
    padding: 4rem 0;
    margin-bottom: 2rem;
}

/* Section Title Styling */
.section-title {
    text-align: center;
    margin-bottom: 2.5rem;
}

.section-title h6 {
    color: var(--primary-color);
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.section-title h2 {
    font-weight: 700;
    margin-bottom: 1rem;
}

.section-title p {
    color: var(--text-muted);
    max-width: 700px;
    margin: 0 auto;
}

/* CTA Section */
.cta-section {
    background: linear-gradient(rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.8)),
    url('../images/product-cta-bg.jpg') center/cover;
    color: white;
    padding: 4rem 0;
    margin-top: 3rem;
}

.cta-section h2 {
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.cta-section .lead {
    margin-bottom: 2rem;
}

/* ===================================
       3. CATEGORY CARDS
    =================================== */
.category-card-container {
    transition: all 0.3s ease;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    height: 100%;
}

.category-card-container:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-md);
}

.category-card {
    position: relative;
    height: 220px;
    overflow: hidden;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

.category-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.category-card-container:hover .category-img {
    transform: scale(1.08);
}

.category-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 15px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    color: white;
}

.category-title {
    font-weight: 600;
    margin-bottom: 5px;
    font-size: 1.25rem;
    color: #fff;
}

.category-count {
    font-size: 0.875rem;
    opacity: 0.9;
    color: #fff;
}

/* ===================================
       4. PRODUCT CARDS
    =================================== */
.product-card {
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
    border: none;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.product-img-wrapper {
    position: relative;
    overflow: hidden;
    padding-top: 100%;
    /* 1:1 Aspect Ratio */
}

.product-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.product-card:hover .product-img {
    transform: scale(1.05);
}

.product-info {
    padding: 15px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.product-category {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 5px;
}

.product-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 10px 0;
    line-height: 1.3;
    min-height: 42px;
}

.product-title a {
    color: var(--dark-color);
    text-decoration: none;
}

.product-title a:hover {
    color: var(--primary-color);
}

.product-rating {
    color: #FFB800;
    font-size: 14px;
    margin-bottom: 8px;
}

.rating-count {
    color: var(--text-muted);
    font-size: 13px;
}

.product-price {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 15px;
    display: flex;
    align-items: baseline;
}

.original-price {
    text-decoration: line-through;
    color: var(--text-muted);
    font-size: 14px;
    margin-left: 8px;
    font-weight: 400;
}

/* ===================================
       5. BADGES & ACTION BUTTONS
    =================================== */
.product-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: var(--primary-color);
    color: white;
    font-size: 14px;
    font-weight: 600;
    padding: 5px 15px;
    border-radius: 20px;
    z-index: 5;
}

.product-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 5px;
}

.action-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: white;
    border-radius: 50%;
    color: #333;
    text-decoration: none;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: all 0.2s;
}

.action-btn:hover {
    background-color: var(--primary-color);
    color: white;
}

.btn-add-to-cart {
    width: 100%;
    padding: 10px;
    background-color: #E63E30;
    color: white;
    border: none;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
    transition: all 0.3s;
    font-size: 14px;
    text-align: center;
    text-decoration: none;
    margin-top: auto;
    cursor: pointer;
    display: block;
}

.btn-add-to-cart:hover {
    background-color: #d63226;
    color: white;
    text-decoration: none;
}

.btn-pressed {
    transform: scale(0.95);
}

/* ===================================
       6. STOCK INDICATORS
    =================================== */
.out-of-stock-badge {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 600;
    font-size: 14px;
    z-index: 10;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.product-card.out-of-stock .product-img-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.7);
    z-index: 5;
}

.btn-secondary:disabled {
    background-color: #ff8c00 !important;
    border-color: #ff8c00 !important;
    color: white !important;
    cursor: not-allowed;
    opacity: 1;
}

/* ===================================
       7. NOTIFICATIONS & TOASTS
    =================================== */
.toast-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: white;
    box-shadow: var(--shadow-lg);
    border-radius: 8px;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 9999;
    max-width: 350px;
    transition: all 0.3s ease;
    transform: translateY(100px);
    opacity: 0;
    border-left: 4px solid #28a745;
}

.toast-notification.error {
    border-left-color: #dc3545;
}

.toast-content {
    display: flex;
    align-items: center;
}

.toast-content i {
    font-size: 18px;
    margin-right: 10px;
}

.toast-close {
    background: none;
    border: none;
    padding: 0;
    margin-left: 10px;
    font-size: 16px;
    cursor: pointer;
}

@keyframes bounce {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.3);
    }
}

/* Loading spinner for buttons */
.fa-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* ===================================
       8. RESPONSIVE STYLES
    =================================== */
@media (max-width: 991px) {
    .category-card {
        height: 200px;
    }

    .product-title {
        font-size: 15px;
        min-height: 38px;
    }

    .product-price {
        font-size: 16px;
        margin-bottom: 10px;
    }

    .btn-add-to-cart {
        padding: 8px;
        font-size: 13px;
    }
}

@media (max-width: 767px) {
    .category-card {
        height: 180px;
    }

    .category-title {
        font-size: 1.1rem;
    }

    .product-title {
        font-size: 14px;
        min-height: 36px;
        margin-bottom: 5px;
    }

    .action-btn {
        width: 32px;
        height: 32px;
    }
}