/* home.css - Premium Styles for Maktabty */

:root {
    --primary-color: #4F46E5;
    /* Indigo */
    --primary-light: #818CF8;
    --primary-dark: #3730A3;
    --secondary-color: #F97316;
    /* Orange */
    --text-main: #1F2937;
    --text-muted: #6B7280;
    --bg-main: #F9FAFB;
    --bg-white: #FFFFFF;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

    --radius-md: 0.5rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;

    --transition: all 0.3s ease;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Utilities */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
    border: none;
}

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

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background-color: white;
    color: var(--text-main);
    box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

/* Navbar */
.navbar {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
    padding: 1rem 0;
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.search-bar {
    flex: 1;
    max-width: 500px;
    display: flex;
    align-items: center;
    background: var(--bg-main);
    border-radius: 999px;
    padding: 0.5rem 1.5rem;
    border: 1px solid #E5E7EB;
    transition: var(--transition);
}

.search-bar:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.search-bar input {
    width: 100%;
    border: none;
    background: transparent;
    outline: none;
    font-family: inherit;
    font-size: 0.95rem;
}

.search-bar button {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.1rem;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-main);
    font-weight: 600;
    transition: var(--transition);
}

.nav-links a:hover {
    color: var(--primary-color);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.cart-btn {
    position: relative;
    color: var(--text-main);
    font-size: 1.25rem;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-btn:hover {
    color: var(--primary-color);
    transform: scale(1.05);
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -10px;
    background: var(--secondary-color);
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
    height: 18px;
    min-width: 18px;
    border-radius: 99px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

.login-btn {
    text-decoration: none;
    color: var(--primary-color);
    font-weight: 600;
    border: 2px solid var(--primary-color);
    padding: 0.4rem 1.2rem;
    border-radius: 99px;
    transition: var(--transition);
}

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

/* Header Right Actions */
.header-right-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.header-right-actions .lang-btn {
    margin: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--text-main);
    font-weight: 600;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-family: inherit;
    transition: var(--transition);
}

.header-right-actions .lang-btn:hover {
    color: var(--primary-color);
}


/* Hero Section */
.hero {
    padding: 5rem 0;
    overflow: hidden;
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.hero-text h1 {
    font-size: 3.5rem;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    color: var(--text-main);
}

.hero-text .highlight {
    color: var(--primary-color);
    position: relative;
}

.hero-text p {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
}

.hero-image {
    position: relative;
}

.hero-main-visual {
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    transform: rotate(3deg);
    transition: var(--transition);
}

.hero-main-visual:hover {
    transform: rotate(0);
}

.hero-main-visual img {
    width: 100%;
    display: block;
}

.glass-card {
    position: absolute;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    padding: 1rem 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
    z-index: 10;
    animation: float 4s ease-in-out infinite;
}

.decor-card-1 {
    top: -20px;
    left: -30px;
    animation-delay: 0s;
}

.decor-card-2 {
    bottom: -20px;
    right: -30px;
    animation-delay: 2s;
}

.text-blue {
    color: #3B82F6;
}

.text-purple {
    color: #8B5CF6;
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }

    100% {
        transform: translateY(0px);
    }
}

/* Categories Section */
.section-title {
    font-size: 2rem;
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--primary-color);
    margin: 0.5rem auto 0;
    border-radius: 2px;
}

.categories {
    padding: 4rem 0;
    background: white;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
}

.cat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2.5rem 1.5rem;
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: var(--text-main);
    background: var(--bg-main);
    transition: var(--transition);
    border: 1px solid transparent;
}

.cat-card i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    border-radius: 50%;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.cat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
    border-color: rgba(0, 0, 0, 0.05);
}

.cat-card:hover i {
    transform: scale(1.1);
}

.color-1 i {
    color: #EF4444;
}

.color-2 i {
    color: #F59E0B;
}

.color-3 i {
    color: #10B981;
}

.color-4 i {
    color: #3B82F6;
}

/* Bestsellers */
.bestsellers {
    padding: 5rem 0;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.product-card {
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border: 1px solid #F3F4F6;
}

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

.product-img {
    position: relative;
    height: 250px;
    overflow: hidden;
}

.product-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

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

.badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 99px;
    font-size: 0.8rem;
    font-weight: 600;
    z-index: 2;
}

.badge-sale {
    background: var(--secondary-color);
}

.add-to-cart-quick {
    position: absolute;
    bottom: -50px;
    right: 1rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    z-index: 2;
}

.product-card:hover .add-to-cart-quick {
    bottom: 1rem;
}

.add-to-cart-quick:hover {
    background: var(--primary-dark);
    transform: scale(1.1);
}

.product-info {
    padding: 1.5rem;
}

.product-category {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 0.05em;
}

.product-title {
    font-size: 1.1rem;
    margin: 0.5rem 0;
    color: var(--text-main);
}

.product-rating {
    color: #FBBF24;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.product-rating span {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-left: 0.5rem;
}

.product-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
}

.old-price {
    color: var(--text-muted);
    text-decoration: line-through;
    font-size: 0.9rem;
    font-weight: 400;
    margin-right: 0.5rem;
}

/* Newsletter */
.newsletter {
    background: var(--primary-color);
    padding: 4rem 0;
    color: white;
}

.newsletter-content {
    text-align: center;
    max-width: 600px;
}

.newsletter h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.newsletter p {
    margin-bottom: 2rem;
    opacity: 0.9;
}

.newsletter-form {
    display: flex;
    gap: 0.5rem;
    background: white;
    padding: 0.5rem;
    border-radius: var(--radius-md);
}

.newsletter-form input {
    flex: 1;
    border: none;
    padding: 0.5rem 1rem;
    outline: none;
    font-family: inherit;
    font-size: 1rem;
}

/* Footer */
footer {
    background: white;
    padding: 4rem 0 2rem;
    border-top: 1px solid #E5E7EB;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-brand p {
    color: var(--text-muted);
    line-height: 1.6;
    margin-top: 1rem;
    max-width: 300px;
}

.footer-links h4,
.footer-contact h4 {
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
}

.footer-links ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 0.75rem;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--primary-color);
}

.footer-contact p {
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.footer-bottom {
    text-align: center;
    color: var(--text-muted);
    padding-top: 2rem;
    border-top: 1px solid #E5E7EB;
}

/* Enhanced Responsive Tweaks */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-main);
    cursor: pointer;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 2rem;
}

@media (max-width: 992px) {
    .navbar {
        padding: 0.75rem 0;
    }

    .nav-container {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .search-bar {
        order: 3;
        max-width: 100%;
        margin-top: 0.75rem;
        flex-basis: 100%;
        padding: 0.4rem 1.25rem;
    }

    .hero-content {
        gap: 2rem;
    }

    .hero-text h1 {
        font-size: 3rem;
    }
}

@media (max-width: 768px) {
    .navbar {
        padding: 0.5rem 0;
    }

    .logo {
        font-size: 1.25rem;
    }

    .header-right-actions {
        gap: 0.75rem;
    }

    .header-right-actions .lang-btn {
        font-size: 0.9rem;
    }

    .cart-btn {
        font-size: 1.15rem;
    }

    .mobile-menu-btn {
        display: block;
        font-size: 1.25rem;
    }

    .nav-container {
        justify-content: space-between;
    }

    .nav-menu {
        display: none;
        flex-direction: column;
        width: 100%;
        order: 4;
        margin-top: 0.75rem;
        gap: 1rem;
        background: white;
        padding: 1rem;
        border-radius: var(--radius-md);
        box-shadow: var(--shadow-md);
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-links {
        flex-direction: column;
        align-items: center;
        width: 100%;
        gap: 1rem;
    }

    .nav-actions {
        width: 100%;
        justify-content: center;
        margin-top: 0.5rem;
        padding-top: 1rem;
        border-top: 1px solid #E5E7EB;
    }

    .hero {
        padding: 2.5rem 0;
    }

    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
    }

    .hero-text h1 {
        font-size: 2.5rem;
    }

    .hero-buttons {
        justify-content: center;
    }

    .hero-main-visual {
        transform: none;
    }

    .decor-card-1,
    .decor-card-2 {
        display: none;
    }

    .section-title {
        font-size: 1.75rem;
        margin-bottom: 2rem;
    }

    .categories {
        padding: 3rem 0;
    }

    .bestsellers {
        padding: 3rem 0;
    }

    .category-grid {
        gap: 0.75rem;
    }

    .cat-card {
        padding: 1.5rem 1rem;
    }

    .cat-card i {
        width: 60px;
        height: 60px;
        font-size: 1.75rem;
        margin-bottom: 0.75rem;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }

    .footer-brand p {
        margin: 1rem auto;
    }

    .footer-contact p {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .hero-text h1 {
        font-size: 2.2rem;
    }

    .hero-buttons {
        flex-direction: column;
        gap: 0.5rem;
    }

    .hero-buttons .btn {
        width: 100%;
    }

    .newsletter h2 {
        font-size: 2rem;
    }

    .newsletter-form {
        flex-direction: column;
        background: transparent;
        padding: 0;
    }

    .newsletter-form input {
        border-radius: var(--radius-md);
        padding: 1rem;
    }

    .newsletter-form button {
        width: 100%;
        border-radius: var(--radius-md);
        padding: 1rem;
    }

    /* 2-column mobile layout for products */
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .product-card {
        border-radius: var(--radius-md);
    }

    .product-img {
        height: 160px;
    }

    .product-info {
        padding: 0.75rem;
    }

    .product-category {
        font-size: 0.7rem;
    }

    .product-title {
        font-size: 0.9rem;
        margin: 0.25rem 0;
        line-height: 1.3;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        height: 2.6em;
    }

    .product-rating {
        font-size: 0.75rem;
        margin-bottom: 0.5rem;
    }

    .product-rating span {
        display: none;
    }

    .product-price {
        font-size: 1rem;
    }

    .old-price {
        font-size: 0.8rem;
        margin-right: 0.25rem;
    }

    .badge {
        font-size: 0.65rem;
        padding: 0.15rem 0.5rem;
        top: 0.5rem;
        left: 0.5rem;
    }

    .add-to-cart-quick {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
        bottom: 0.5rem;
        right: 0.5rem;
    }

    .product-card:hover .add-to-cart-quick {
        bottom: 0.5rem;
    }
}

/* RTL Support */
html[dir="rtl"] {
    font-family: 'Outfit', 'Cairo', sans-serif;
}

html[dir="rtl"] .logo i {
    margin-left: 0.5rem;
    margin-right: 0;
}

html[dir="rtl"] .search-bar input {
    margin-right: 0.5rem;
}

html[dir="rtl"] .cart-btn .cart-count {
    right: auto;
    left: -10px;
}

html[dir="rtl"] .hero-text {
    text-align: right;
}

html[dir="rtl"] .glass-card {
    flex-direction: row;
}

html[dir="rtl"] .decor-card-1 {
    left: auto;
    right: -30px;
}

html[dir="rtl"] .decor-card-2 {
    right: auto;
    left: -30px;
}

html[dir="rtl"] .badge {
    left: auto;
    right: 1rem;
}

html[dir="rtl"] .add-to-cart-quick {
    right: auto;
    left: 1rem;
}

html[dir="rtl"] .product-rating span {
    margin-left: 0;
    margin-right: 0.5rem;
}

html[dir="rtl"] .old-price {
    margin-right: 0;
    margin-left: 0.5rem;
}

html[dir="rtl"] .footer-contact i {
    margin-right: 0;
    margin-left: 0.75rem;
}

html[dir="rtl"] .lang-btn i {
    margin-left: 0.3rem;
    margin-right: 0;
}

/* Promo Banner styling */
.promo-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: #fff;
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: var(--radius-md);
    margin: 0 auto;
    box-shadow: var(--shadow-md);
    animation: fadeInDown 0.5s ease both;
    gap: 1rem;
    flex-wrap: wrap;
}

.promo-banner-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.promo-banner-content i {
    font-size: 1.25rem;
}

.promo-banner-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.promo-banner-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: #fff;
    padding: 0.4rem 1rem;
    border-radius: 99px;
    font-size: 0.85rem;
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
    font-weight: 700;
    white-space: nowrap;
}

.promo-banner-btn:hover {
    background: #fff;
    color: var(--primary-color);
}

.promo-banner-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0.2rem;
    transition: var(--transition);
}

.promo-banner-close:hover {
    color: #fff;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}