/**
 * Haneen Nemer - Products Page Styles
 * Made With Love By HOSSAM ALZYOD - Mr.Server | https://hossam.net | i@hossam.net
 * Legendary Products Display with Tiger Theme
 */

/* ===== Products Section ===== */
.products-section {
    padding: calc(70px + var(--spacing-xl)) 0 var(--spacing-xl);
    background:
        radial-gradient(ellipse at 50%   0%,   rgba(212, 175, 55, 0.10) 0%, transparent 55%),
        radial-gradient(ellipse at 0%    60%,  rgba(139, 90,  43, 0.07) 0%, transparent 45%),
        radial-gradient(ellipse at 100%  40%,  rgba(212, 175, 55, 0.06) 0%, transparent 40%),
        radial-gradient(ellipse at 50%   100%, rgba(212, 175, 55, 0.05) 0%, transparent 50%),
        linear-gradient(180deg, #0a0a0a 0%, #080808 50%, #0a0a0a 100%);
    position: relative;
    min-height: 100vh;
}

/* Subtle dot-grid overlay */
.products-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle, rgba(212, 175, 55, 0.06) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
    z-index: 0;
}

/* Slow drifting gold glow */
.products-section::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 30%, rgba(212, 175, 55, 0.07) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 70%, rgba(212, 175, 55, 0.05) 0%, transparent 45%);
    pointer-events: none;
    z-index: 0;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
    position: relative;
    z-index: 10;
}

/* ===== Page Header ===== */
.page-header {
    text-align: center;
    margin-bottom: var(--spacing-xxl);
    animation: headerFadeIn 1s ease-out;
}

@keyframes headerFadeIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page-title {
    font-size: 3rem;
    color: var(--text-white);
    margin-bottom: var(--spacing-md);
    font-weight: 900;
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    position: relative;
}

.page-title::before {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--primary-gold), transparent);
}

.page-title i {
    color: var(--primary-gold);
    filter: drop-shadow(0 0 10px rgba(212, 175, 55, 0.6));
}

.page-description {
    font-size: 1.125rem;
    color: var(--text-light);
    max-width: 700px;
    margin: var(--spacing-lg) auto 0;
    line-height: 1.8;
}

/* ===== Products Layout ===== */
.products-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-xl);
}

/* Full width products content (no sidebar) */
.products-content-full {
    width: 100%;
}

/* ===== Products Content ===== */
.products-content {
    flex: 1;
}

/* ===== Products Grid ===== */
.products-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-lg);
}

/* ===== Product Card ===== */
.product-card {
    background: rgba(26, 26, 26, 0.7);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid rgba(212, 175, 55, 0.1);
    transition: var(--transition-normal);
    position: relative;
    animation: cardFadeIn 0.6s ease-out backwards;
}

.product-card:nth-child(1) { animation-delay: 0.1s; }
.product-card:nth-child(2) { animation-delay: 0.2s; }
.product-card:nth-child(3) { animation-delay: 0.3s; }
.product-card:nth-child(4) { animation-delay: 0.4s; }
.product-card:nth-child(5) { animation-delay: 0.5s; }
.product-card:nth-child(6) { animation-delay: 0.6s; }

@keyframes cardFadeIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.product-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(212, 175, 55, 0.3);
    border-color: var(--primary-gold);
}

.product-link {
    text-decoration: none;
    display: block;
}

/* Product Image */
.product-image {
    position: relative;
    width: 100%;
    padding-top: 100%;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(0,0,0,0.5), rgba(26,26,26,0.8));
    aspect-ratio: 1 / 1; /* Prevent layout shift */
}

.product-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-slow);
    filter: brightness(0.9) contrast(1.1);
}

.product-image img.product-placeholder-svg {
    object-fit: contain;
    padding: 20%;
    filter: brightness(0) saturate(100%) invert(73%) sepia(56%) saturate(543%) hue-rotate(359deg) brightness(97%) contrast(90%);
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.05) 0%, rgba(0, 0, 0, 0.3) 100%);
}

.product-image img.product-placeholder-colored {
    filter: none;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.05) 0%, rgba(0, 0, 0, 0.2) 100%);
}

.product-card:hover .product-image img {
    transform: scale(1.15) rotate(2deg);
    filter: brightness(1.1) contrast(1.2);
}

.product-card:hover .product-image img.product-placeholder-svg {
    transform: scale(1.15) rotate(2deg);
    filter: brightness(0) saturate(100%) invert(73%) sepia(56%) saturate(543%) hue-rotate(359deg) brightness(110%) contrast(95%);
}

.product-card:hover .product-image img.product-placeholder-colored {
    transform: scale(1.15) rotate(2deg);
    filter: brightness(1.05) contrast(1.1);
}

/* Product Overlay */
.product-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        180deg,
        transparent 0%,
        rgba(0,0,0,0.2) 50%,
        rgba(0,0,0,0.6) 100%
    );
    pointer-events: none;
    z-index: 1;
}

/* Product Badge */
.product-badge {
    position: absolute;
    top: var(--spacing-sm);
    left: var(--spacing-sm);
    background: linear-gradient(135deg, var(--primary-gold), var(--accent-bronze));
    color: var(--secondary-black);
    padding: 6px 12px;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.6);
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 4px;
}

.product-badge.featured {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.6);
}

.product-badge.out-of-stock {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: var(--text-white);
}

.product-badge.low-stock {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: var(--text-white);
    animation: badgeWarn 1.5s ease-in-out infinite;
}

.product-badge.discount {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: var(--text-white);
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.5);
}

@keyframes badgeWarn {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* Product Info */
.product-info {
    padding: 14px;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.product-name {
    font-size: 1.125rem;
    color: var(--text-white);
    font-weight: 700;
    line-height: 1.4;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    overflow: hidden;
}

.product-description {
    font-size: 0.875rem;
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: var(--spacing-sm);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    overflow: hidden;
    opacity: 0.9;
}

.product-price {
    margin-bottom: var(--spacing-sm);
    position: relative;
}

.price-row {
    display: flex;
    align-items: baseline;
    gap: var(--spacing-sm);
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.price-old-row {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

.price-current {
    font-size: 1.75rem;
    color: var(--primary-gold);
    font-weight: 900;
    font-family: var(--font-english);
    text-shadow: 0 2px 8px rgba(212, 175, 55, 0.4);
    letter-spacing: 1px;
}

.price-discount {
    font-size: 1.75rem;
    color: #2ecc71;
    font-weight: 900;
    font-family: var(--font-english);
    text-shadow: 0 2px 8px rgba(46, 204, 113, 0.4);
    letter-spacing: 1px;
}

.price-original {
    font-size: 0.95rem;
    color: var(--text-light);
    text-decoration: line-through;
    font-weight: 500;
    opacity: 0.6;
    font-family: var(--font-english);
}

.savings-amount {
    font-size: 0.75rem;
    color: #2ecc71;
    font-weight: 600;
    padding: 2px 8px;
    background: rgba(46, 204, 113, 0.1);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(46, 204, 113, 0.3);
}

.discount-badge {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 50%, #c44569 100%);
    color: var(--text-white);
    padding: 5px 12px;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 800;
    box-shadow:
        0 4px 12px rgba(231, 76, 60, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
    animation: badgePulse 2s ease-in-out infinite;
}

.discount-badge::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 70%
    );
    animation: badgeShine 3s linear infinite;
}

@keyframes badgePulse {
    0%, 100% {
        transform: scale(1);
        box-shadow:
            0 4px 12px rgba(231, 76, 60, 0.4),
            inset 0 1px 0 rgba(255, 255, 255, 0.3);
    }
    50% {
        transform: scale(1.05);
        box-shadow:
            0 6px 18px rgba(231, 76, 60, 0.6),
            inset 0 1px 0 rgba(255, 255, 255, 0.3);
    }
}

@keyframes badgeShine {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }
    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

.product-rating {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.product-rating i {
    color: var(--text-light);
    font-size: 0.875rem;
    transition: var(--transition-fast);
}

.product-rating i.active {
    color: var(--primary-gold);
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.6);
}

.product-card:hover .product-rating i.active {
    animation: starTwinkle 0.6s ease-in-out;
}

@keyframes starTwinkle {
    0%, 100% {
        transform: scale(1) rotate(0deg);
    }
    50% {
        transform: scale(1.2) rotate(10deg);
    }
}

.rating-count {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-left: var(--spacing-xs);
}

/* Product Actions */
.product-actions {
    padding: 0 14px 14px;
    display: flex;
    gap: 8px;
}

.btn-add-to-cart {
    width: 100%;
    padding: var(--spacing-sm);
    background: linear-gradient(135deg, var(--primary-gold), var(--accent-bronze));
    color: var(--secondary-black);
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 800;
    cursor: pointer;
    transition: var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

.btn-add-to-cart::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-add-to-cart:hover::before {
    width: 300px;
    height: 300px;
}

.btn-add-to-cart:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 30px rgba(212, 175, 55, 0.6);
    background: linear-gradient(135deg, var(--primary-gold-light), var(--primary-gold));
}

.btn-add-to-cart:active {
    transform: scale(0.98);
}

.btn-add-to-cart i {
    font-size: 1.125rem;
    position: relative;
    z-index: 1;
}

.btn-disabled {
    width: 100%;
    padding: var(--spacing-sm);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-light);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: not-allowed;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    opacity: 0.6;
}

/* ===== Pagination ===== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-xxl);
    flex-wrap: wrap;
}

.pagination-link {
    min-width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 var(--spacing-md);
    background: rgba(26, 26, 26, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(212, 175, 55, 0.1);
    border-radius: var(--radius-md);
    color: var(--text-white);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition-normal);
}

.pagination-link:hover {
    background: rgba(212, 175, 55, 0.1);
    border-color: var(--primary-gold);
    transform: translateY(-2px);
}

.pagination-link.active {
    background: linear-gradient(135deg, var(--primary-gold), var(--accent-bronze));
    border-color: var(--primary-gold);
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
}

.page-dots {
    color: rgba(255, 255, 255, 0.4);
    padding: 0 0.5rem;
    user-select: none;
}

/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    padding: var(--spacing-xxl);
    background: rgba(26, 26, 26, 0.6);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(212, 175, 55, 0.1);
}

.empty-icon {
    font-size: 5rem;
    color: var(--primary-gold);
    margin-bottom: var(--spacing-md);
    opacity: 0.5;
}

.empty-title {
    color: var(--text-white);
    font-size: 1.75rem;
    margin-bottom: var(--spacing-sm);
}

.empty-description {
    color: var(--text-light);
    font-size: 1.125rem;
    margin-bottom: var(--spacing-lg);
}

/* ===== Responsive Design ===== */

/* Mobile First - Small Screens */
@media (max-width: 479px) {
    .products-section {
        padding: var(--spacing-lg) 0 var(--spacing-md);
    }

    .products-section {
        padding: calc(70px + var(--spacing-md)) 0 var(--spacing-lg);
    }

    .container {
        padding: 0 var(--spacing-xs);
    }

    .page-header {
        margin-bottom: var(--spacing-lg);
        padding-top: var(--spacing-sm);
    }

    .page-title {
        font-size: 1.75rem;
    }

    .page-title i {
        font-size: 1.5rem;
    }

    .page-subtitle {
        font-size: 0.9rem;
    }

    .filters-bar {
        flex-direction: column;
        gap: var(--spacing-sm);
        margin-bottom: var(--spacing-lg);
    }

    .category-filters {
        flex-wrap: wrap;
        gap: var(--spacing-xs);
        justify-content: center;
    }

    .filter-btn {
        padding: 8px 14px;
        font-size: 0.8rem;
    }

    .search-box {
        width: 100%;
    }

    .search-input {
        font-size: 0.9rem;
        padding: 10px 12px 10px 38px;
    }

    .products-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }

    .product-card {
        max-width: 100%;
    }

    .product-info {
        padding: var(--spacing-sm);
    }

    .product-name {
        font-size: 1rem;
    }

    .product-description {
        font-size: 0.85rem;
    }

    .product-price {
        font-size: 0.9rem;
    }

    .product-badge {
        padding: 4px 8px;
        font-size: 0.65rem;
    }

    .product-actions {
        padding: var(--spacing-xs) var(--spacing-sm);
        gap: var(--spacing-xs);
    }

    .product-actions .btn {
        font-size: 0.85rem;
        padding: 10px 16px;
    }

    .pagination {
        gap: var(--spacing-xs);
        margin-top: var(--spacing-lg);
    }

    .page-link {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }

    .empty-icon {
        font-size: 4rem;
    }

    .empty-title {
        font-size: 1.25rem;
    }

    .empty-description {
        font-size: 0.9rem;
    }
}

@media (min-width: 480px) {
    .products-section {
        padding: calc(70px + var(--spacing-lg)) 0 var(--spacing-xl);
    }

    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 768px) {
    .products-section {
        padding: calc(70px + var(--spacing-xl)) 0 var(--spacing-xxl);
    }

    .page-header {
        margin-bottom: var(--spacing-xxl);
    }

    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-xl);
    }

    .page-title {
        font-size: 3.5rem;
    }
}

@media (min-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1280px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ============================================
   Enhanced Card Design — Global Improvements
   ============================================ */

/* Gold accent line that reveals on hover */
.product-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, var(--primary-gold) 50%, transparent 100%);
    opacity: 0;
    transform: scaleX(0.5);
    transition: opacity 0.35s ease, transform 0.35s ease;
    z-index: 10;
}
.product-card:hover::before {
    opacity: 1;
    transform: scaleX(1);
}

/* Improved hover shadow */
.product-card:hover {
    box-shadow:
        0 20px 50px rgba(212, 175, 55, 0.25),
        0 0 0 1px rgba(212, 175, 55, 0.3);
}

/* ===== Badge Container (stacks badges vertically) ===== */
.product-badges {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    z-index: 5;
}
.product-badges .product-badge {
    position: static;
    top: auto;
    left: auto;
}

/* New arrival badge */
.product-badge.new {
    background: linear-gradient(135deg, #1a73e8, #1557b0);
    color: #fff;
    box-shadow: 0 3px 10px rgba(26, 115, 232, 0.5);
}

/* ===== Category Chip — on image, bottom-right ===== */
.product-category-chip {
    position: absolute;
    bottom: 10px;
    right: 10px;
    z-index: 6;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 30px;
    background: rgba(15, 15, 15, 0.72);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(212, 175, 55, 0.35);
    font-size: 0.68rem;
    color: rgba(212, 175, 55, 0.9);
    font-family: var(--font-arabic);
    font-weight: 600;
    transition: all 0.25s ease;
    pointer-events: none;
}
.product-card:hover .product-category-chip {
    background: rgba(212, 175, 55, 0.18);
    color: var(--primary-gold);
    border-color: rgba(212, 175, 55, 0.55);
}
.product-category-chip i {
    font-size: 0.58rem;
    opacity: 0.7;
}

/* ===== Improved Rating Box ===== */
.product-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: rgba(212, 175, 55, 0.04);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.05);
    width: fit-content;
}

/* ===== Product Actions — flex row ===== */
.product-actions {
    display: flex;
    gap: 8px;
}
.product-actions .btn-add-to-cart,
.product-actions .btn-disabled {
    flex: 1;
    width: auto;
    min-width: 0;
}

/* Eye icon "View Product" button */
.btn-view-product {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    min-width: 44px;
    height: auto;
    align-self: stretch;
    background: rgba(212, 175, 55, 0.08);
    color: var(--primary-gold);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: var(--radius-md);
    text-decoration: none;
    font-size: 1rem;
    transition: all 0.3s ease;
    flex-shrink: 0;
}
.btn-view-product:hover {
    background: rgba(212, 175, 55, 0.2);
    color: var(--primary-gold);
    border-color: var(--primary-gold);
    transform: scale(1.06);
    box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.35), 0 4px 14px rgba(212, 175, 55, 0.3);
}

/* ===== Related Grid — compact card styles ===== */
.related-grid .product-info {
    padding: 10px;
    gap: 4px;
}
.related-grid .product-name {
    font-size: 0.9rem;
    min-height: unset;
    -webkit-line-clamp: 2;
    line-clamp: 2;
}
.related-grid .product-description {
    font-size: 0.78rem;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    margin-bottom: 0;
}
.related-grid .price-current,
.related-grid .price-discount {
    font-size: 1.25rem;
}
.related-grid .price-original {
    font-size: 0.82rem;
}
.related-grid .product-actions {
    padding: 0 var(--spacing-sm) var(--spacing-sm);
}
.related-grid .btn-add-to-cart {
    font-size: 0.82rem;
    padding: 8px 10px;
}
.related-grid .btn-view-product {
    width: 38px;
    min-width: 38px;
    height: auto;
    align-self: stretch;
    font-size: 0.9rem;
}
