/* Quick Shop Page Styles */

/* CSS Variables */
:root {
    --light-sky-blue: #87CEEB;
    --pale-pastel-pink: #F8BBD9;
    --soft-mint-green: #B8E6B8;
    --light-peach-orange: #FFCBA4;
    --gentle-lavender-purple: #DDA0DD;
    --white: #ffffff;
    --light-gray: #f8f9fa;
    --dark-gray: #6c757d;
    --text-dark: #2c3e50;
    --border-color: #e9ecef;
    --shadow-light: 0 2px 10px rgba(0, 0, 0, 0.1);
    --shadow-medium: 0 5px 20px rgba(0, 0, 0, 0.15);
    --shadow-heavy: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* Age Popup */
.age-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(5px);
}

.age-popup {
    background: var(--white);
    border-radius: 25px;
    padding: 40px;
    max-width: 600px;
    width: 90%;
    box-shadow: var(--shadow-heavy);
    animation: popupAppear 0.5s ease-out;
    position: relative;
}

@keyframes popupAppear {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(-50px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.popup-header {
    text-align: center;
    margin-bottom: 30px;
}

.popup-header h3 {
    color: var(--text-dark);
    font-weight: 700;
    font-size: 28px;
    margin-bottom: 10px;
}

.popup-header p {
    color: var(--dark-gray);
    font-size: 16px;
    margin: 0;
}

.age-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.age-option {
    background: var(--white);
    border: 2px solid var(--border-color);
    border-radius: 20px;
    padding: 25px 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.age-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--light-sky-blue), var(--pale-pastel-pink));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.age-option:hover::before {
    transform: scaleX(1);
}

.age-option:hover {
    border-color: var(--light-sky-blue);
    background: rgba(135, 206, 235, 0.05);
    transform: translateY(-5px);
    box-shadow: var(--shadow-medium);
}

.age-option.selected {
    border-color: var(--light-sky-blue);
    background: linear-gradient(135deg, rgba(135, 206, 235, 0.1), rgba(248, 187, 217, 0.05));
    box-shadow: var(--shadow-light);
}

.age-option.selected::before {
    transform: scaleX(1);
}

.age-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--light-sky-blue), var(--pale-pastel-pink));
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    color: var(--white);
    font-size: 24px;
    transition: all 0.3s ease;
}

.age-option:hover .age-icon {
    transform: scale(1.1);
}

.age-option h4 {
    color: var(--text-dark);
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 5px;
}

.age-option p {
    color: var(--dark-gray);
    font-size: 14px;
    margin: 0;
}

.popup-footer {
    text-align: center;
}

/* Quick Shop Section */
.quick-shop-section {
    background: var(--light-gray);
    min-height: 100vh;
    padding: 40px 0;
}

/* Page Header */
.page-header {
    background: var(--white);
    border-radius: 20px;
    padding: 30px;
    box-shadow: var(--shadow-light);
    border: 1px solid var(--border-color);
    margin-bottom: 30px;
}

.page-title {
    color: var(--text-dark);
    font-weight: 700;
    font-size: 36px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.page-title i {
    color: var(--light-sky-blue);
}

.page-subtitle {
    color: var(--dark-gray);
    font-size: 18px;
    margin-bottom: 20px;
}

.selected-age {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.age-badge {
    background: linear-gradient(135deg, var(--light-sky-blue), var(--pale-pastel-pink));
    color: var(--white);
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
}

/* Shopping Controls */
.shopping-controls {
    display: flex;
    gap: 15px;
    align-items: center;
    background: var(--white);
    padding: 20px;
    border-radius: 15px;
    box-shadow: var(--shadow-light);
    border: 1px solid var(--border-color);
}

.search-filter {
    display: flex;
    gap: 10px;
    flex: 1;
}

.search-filter .form-control {
    border-radius: 10px;
    border: 2px solid var(--border-color);
    padding: 10px 15px;
    transition: all 0.3s ease;
}

.search-filter .form-control:focus {
    border-color: var(--light-sky-blue);
    box-shadow: 0 0 0 0.2rem rgba(135, 206, 235, 0.25);
}

.category-filter .form-select {
    border-radius: 10px;
    border: 2px solid var(--border-color);
    padding: 10px 15px;
    min-width: 200px;
    transition: all 0.3s ease;
}

.category-filter .form-select:focus {
    border-color: var(--light-sky-blue);
    box-shadow: 0 0 0 0.2rem rgba(135, 206, 235, 0.25);
}

/* Cart Summary */
.cart-summary {
    background: var(--white);
    padding: 20px;
    border-radius: 15px;
    box-shadow: var(--shadow-light);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.selected-items {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.item-count,
.total-price {
    font-weight: 600;
    font-size: 14px;
}

.item-count {
    color: var(--text-dark);
}

.total-price {
    color: var(--light-sky-blue);
}

#addToCartBtn {
    background: linear-gradient(135deg, var(--soft-mint-green), #20c997);
    border: none;
    border-radius: 10px;
    padding: 10px 20px;
    font-weight: 600;
    transition: all 0.3s ease;
    white-space: nowrap;
}

#addToCartBtn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(32, 201, 151, 0.3);
}

#addToCartBtn:disabled {
    background: var(--dark-gray);
    opacity: 0.6;
}

/* Products Table */
.products-table-container {
    background: var(--white);
    border-radius: 20px;
    box-shadow: var(--shadow-light);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.products-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}

.products-table thead {
    background: linear-gradient(135deg, var(--light-sky-blue), var(--pale-pastel-pink));
    color: var(--white);
}

.products-table th {
    padding: 20px;
    font-weight: 600;
    font-size: 18px;
    text-align: left;
    border: none;
}

.category-column {
    width: 200px;
    min-width: 200px;
}

.products-column {
    width: auto;
}

.products-table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.products-table tbody tr:hover {
    background: rgba(135, 206, 235, 0.05);
}

.products-table td {
    padding: 25px 20px;
    vertical-align: top;
    border: none;
}

/* Category Cell */
.category-cell {
    background: var(--light-gray);
    border-right: 3px solid var(--light-sky-blue);
    position: relative;
}

.category-name {
    color: var(--text-dark);
    font-weight: 700;
    font-size: 18px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.category-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--light-sky-blue), var(--pale-pastel-pink));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 16px;
}

.category-description {
    color: var(--dark-gray);
    font-size: 14px;
    line-height: 1.4;
}

.category-count {
    background: var(--light-sky-blue);
    color: var(--white);
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    margin-top: 10px;
    display: inline-block;
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
    padding: 10px;
}

.product-item {
    background: var(--white);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 12px;
    transition: all 0.3s ease;
    position: relative;
    cursor: pointer;
    min-height: 200px;
}

.product-item:hover {
    border-color: var(--light-sky-blue);
    background: rgba(135, 206, 235, 0.05);
    transform: translateY(-3px);
    box-shadow: var(--shadow-light);
}

.product-item.selected {
    border-color: var(--soft-mint-green);
    background: rgba(184, 230, 184, 0.1);
    box-shadow: var(--shadow-medium);
}

.product-checkbox {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 20px;
    height: 20px;
    accent-color: var(--soft-mint-green);
}

.product-image {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    overflow: hidden;
    margin: 0 auto 10px;
    background: var(--light-gray);
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-item:hover .product-image img {
    transform: scale(1.1);
}

.product-name {
    color: var(--text-dark);
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 6px;
    text-align: center;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price {
    color: var(--light-sky-blue);
    font-weight: 700;
    font-size: 14px;
    text-align: center;
    margin-bottom: 8px;
}

.product-features {
    display: none; /* Hide features in compact view */
}

.feature-tag {
    background: var(--light-gray);
    color: var(--dark-gray);
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 9px;
    font-weight: 500;
}

.age-suitable {
    background: rgba(184, 230, 184, 0.2);
    color: var(--soft-mint-green);
    padding: 3px 6px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 600;
    text-align: center;
    margin-top: 6px;
    border: 1px solid rgba(184, 230, 184, 0.5);
}

.product-item .age-suitable:not(.suitable) {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
    border-color: rgba(220, 53, 69, 0.3);
}

/* Bulk Actions */
.bulk-actions {
    background: var(--white);
    padding: 25px;
    border-radius: 15px;
    box-shadow: var(--shadow-light);
    border: 1px solid var(--border-color);
}

.bulk-actions .btn {
    border-radius: 10px;
    padding: 10px 20px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.bulk-actions .btn:hover {
    transform: translateY(-2px);
}

/* Recommendations Modal */
.modal-content {
    border-radius: 20px;
    border: none;
    box-shadow: var(--shadow-heavy);
}

.modal-header {
    background: linear-gradient(135deg, var(--light-sky-blue), var(--pale-pastel-pink));
    color: var(--white);
    border-radius: 20px 20px 0 0;
    padding: 20px 30px;
}

.modal-title {
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-body {
    padding: 30px;
}

.recommendation-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: var(--light-gray);
    border-radius: 12px;
    margin-bottom: 15px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.recommendation-item:hover {
    background: rgba(135, 206, 235, 0.1);
    border-color: var(--light-sky-blue);
}

.recommendation-checkbox {
    width: 18px;
    height: 18px;
    accent-color: var(--light-sky-blue);
}

.recommendation-image {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    overflow: hidden;
    background: var(--white);
}

.recommendation-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.recommendation-details {
    flex: 1;
}

.recommendation-name {
    color: var(--text-dark);
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 3px;
}

.recommendation-reason {
    color: var(--dark-gray);
    font-size: 12px;
}

.recommendation-price {
    color: var(--light-sky-blue);
    font-weight: 700;
    font-size: 16px;
}

/* Loading States */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 15px;
    z-index: 10;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--light-sky-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Mobile Responsive for Product Detail Popup */
@media (max-width: 575.98px) {
    .product-detail-popup {
        padding: 25px;
        max-width: 95%;
        max-height: 90vh;
    }
    
    .product-detail-image {
        width: 150px;
        height: 150px;
    }
    
    .product-detail-name {
        font-size: 20px;
    }
    
    .product-detail-price {
        font-size: 24px;
    }
}

@media (max-width: 767.98px) {
    .product-detail-popup {
        padding: 30px;
        max-width: 90%;
    }
    
    .product-detail-image {
        width: 180px;
        height: 180px;
    }
}

/* Mobile Responsive */
@media (max-width: 991.98px) {
    .age-popup {
        padding: 30px 20px;
    }
    
    .age-options {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .page-title {
        font-size: 28px;
        flex-direction: column;
        gap: 10px;
    }
    
    .shopping-controls {
        flex-direction: column;
        gap: 15px;
    }
    
    .cart-summary {
        flex-direction: column;
        text-align: center;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 12px;
    }
    
    .category-column {
        width: 150px;
        min-width: 150px;
    }
}

@media (max-width: 767.98px) {
    .age-options {
        grid-template-columns: 1fr;
    }
    
    .page-title {
        font-size: 24px;
    }
    
    .products-table-container {
        overflow-x: auto;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
    }
    
    .product-item {
        padding: 10px;
        min-height: 160px;
    }
    
    .product-image {
        width: 40px;
        height: 40px;
    }
    
    .product-name {
        font-size: 12px;
    }
    
    .product-price {
        font-size: 13px;
    }
    
    .category-cell {
        text-align: center;
    }
    
    .category-name {
        justify-content: center;
    }
    
    .bulk-actions .btn {
        display: block;
        width: 100%;
        margin-bottom: 10px;
    }
}

@media (max-width: 575.98px) {
    .age-popup {
        padding: 20px 15px;
        margin: 20px;
    }
    
    .page-header {
        padding: 20px;
    }
    
    .shopping-controls,
    .cart-summary,
    .bulk-actions {
        padding: 15px;
    }
    
    .products-table th,
    .products-table td {
        padding: 15px 10px;
    }
    
    .category-column {
        width: 120px;
        min-width: 120px;
    }
    
    .product-item {
        padding: 15px;
    }
}

/* Product Detail Popup */
.product-detail-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(5px);
}

.product-detail-popup {
    background: var(--white);
    border-radius: 25px;
    padding: 40px;
    max-width: 600px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: var(--shadow-heavy);
    animation: popupAppear 0.3s ease-out;
    position: relative;
}

.popup-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--dark-gray);
    cursor: pointer;
    transition: color 0.3s ease;
}

.popup-close:hover {
    color: var(--text-dark);
}

.product-detail-header {
    text-align: center;
    margin-bottom: 25px;
}

.product-detail-image {
    width: 200px;
    height: 200px;
    border-radius: 20px;
    overflow: hidden;
    margin: 0 auto 25px;
    background: var(--light-gray);
    border: 4px solid var(--border-color);
    box-shadow: var(--shadow-medium);
}

.product-detail-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

.product-detail-image .image-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--light-gray), #e9ecef);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--dark-gray);
    font-size: 48px;
    border-radius: 16px;
    transition: all 0.3s ease;
}

.product-detail-image:hover .image-placeholder {
    background: linear-gradient(135deg, var(--light-sky-blue), var(--pale-pastel-pink));
    color: var(--white);
    transform: scale(1.02);
}

.image-placeholder .placeholder-text {
    font-size: 14px;
    margin-top: 10px;
    font-weight: 500;
    text-align: center;
    line-height: 1.2;
}

.product-detail-name {
    color: var(--text-dark);
    font-weight: 700;
    font-size: 24px;
    margin-bottom: 10px;
}

.product-detail-price {
    color: var(--light-sky-blue);
    font-weight: 700;
    font-size: 28px;
    margin-bottom: 20px;
}

.product-detail-body {
    margin-bottom: 25px;
}

.detail-section {
    margin-bottom: 20px;
}

.detail-section h6 {
    color: var(--text-dark);
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.detail-section h6 i {
    color: var(--light-sky-blue);
}

.product-description {
    color: var(--dark-gray);
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 15px;
}

.feature-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.feature-list .feature-tag {
    display: inline-block;
    background: var(--light-gray);
    color: var(--dark-gray);
    padding: 5px 10px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
}

.age-groups {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.age-group-tag {
    background: rgba(135, 206, 235, 0.1);
    color: var(--light-sky-blue);
    padding: 5px 10px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid rgba(135, 206, 235, 0.3);
}

.product-detail-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.btn-add-to-selection {
    background: linear-gradient(135deg, var(--soft-mint-green), #20c997);
    color: var(--white);
    border: none;
    border-radius: 10px;
    padding: 12px 24px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-add-to-selection:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(32, 201, 151, 0.3);
}

.btn-add-to-selection.selected {
    background: var(--dark-gray);
}

/* Print Styles */
@media print {
    .age-popup-overlay,
    .product-detail-overlay,
    .shopping-controls,
    .cart-summary,
    .bulk-actions {
        display: none !important;
    }
    
    .quick-shop-section {
        background: white;
    }
    
    .products-table-container {
        box-shadow: none;
        border: 1px solid #000;
    }
}