:root{
    --yellow: #f8e324;
    --blackish: #282727;
    --border: #55504f;
}

*{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
html, body{
    width: 100%;
    overflow-x: hidden;
}

body{
    font-family: sans-serif;
    background: #d5d5d5;
    scroll-behavior: smooth;    
}

/* Header */
header{
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 50px;
    background: var(--yellow);
    border-radius: 20px;
    border: 3px solid var(--border);
    margin: 10px;
    padding: 5px 20px;
}

header h1{
    font-size: 40px;
}

.logo{
    width: 50px;
    height: 50px;
}
.right-logo{
    width: 80px;
    height: 80px;
}
/* Intro */
.intro{
    text-align: center;
    background: var(--blackish);
    color: #f3f2f2;
    border-radius: 20px;
    margin: 10px;
    padding: 15px;
    border: 3px solid var(--border);
}

/* Menu */
a{
    text-decoration: none;
}
.menu{
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: 20px 0;
}

.menu-item{
    position: relative;
}

.menu-item img{
    width: 280px;
    border-radius: 20px;
    filter: brightness(30%);
    transition: 0.4s;
    object-fit: cover;
}

.menu-item:hover img{
    filter: brightness(50%);
    transform: scale(1.05);
}

.overlay-text{
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-weight: 600;
    font-size: 25px;
    white-space: nowrap;
}

/* Section Titles */
.section-title{
    text-align: center;
    background: white;
    border-radius: 20px;
    margin: 10px auto;
    padding: 5px;
    padding-bottom: 10px;
    border: 3px solid var(--border);
}

/* Products */
.products{
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin: 15px 10px;
}

.card{
    background: white;
    text-align: center;
    border-radius: 20px;
    padding: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transition: 0.3s;
    flex-direction: column;
    height: 300px;
}

.card:hover{
    transform: translateY(-5px);
}

.card img{
    max-width: 100%;
    height: 150px;
    object-fit: contain;
    border-radius: 15px;
}
.card h3{
    font-size: 18px;
    margin: 10px 0 5px 0;
    min-height: 40px;
}
.btn{
    text-decoration: none;
    background: var(--yellow);
    color: black;
    border-radius: 10px;
    padding: 5px 10px;
    display: inline-block;
    margin-top: 5px;
    transition: transform 0.3s;
}

.btn:hover{
    transform: scale(1.1);
}

/* Accessories */
.accessories-title{
    text-align: center;
    background: white;
    border-radius: 20px;
    padding: 10px;
    margin: 20px auto 10px;
    width: fit-content;
}

.accessories{
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
}
.accessory{
    text-align: center;
}

.accessory img{
    height: 60px;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
.alarm-accessories{
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    gap: 20px;
    padding: 20px;
    border-radius: 20px;
    margin: 10px;
}
.alarm-accessories .accessory{
    width: 100px;
    text-align: center;
}
.alarm-accessories .accessory img {
    background: white;
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 50%;
    padding: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
.portfolio .row {
    display: flex;
    gap: 30px;
    justify-content: center;
    margin-top: 20px;
}

.column {
    flex: 1;
    max-width: 500px; /* اندازه جمع و جور */
}

/* فیلتر */
.filters {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 10px;
}

.filter-btn {
    border: 2px solid var(--border);
    background: white;
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 20px;
    cursor: pointer;
    transition: 0.3s;
}
.filter-btn:hover { background: var(--yellow); }
.filter-btn.is-active {
    background: var(--yellow);
    font-weight: bold;
}

/* اسلایدشو */
.carousel {
    display: grid;
    grid-template-columns: 40px 1fr 40px;
    align-items: center;
    gap: 10px;
}

.nav {
    height: 40px;
    width: 40px;
    border-radius: 50%;
    border: 2px solid var(--border);
    background: white;
    font-size:24px;
    cursor: pointer;
}
.nav:hover { background: var(--yellow); }

.stage {
    position: relative;
    border: 2px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    min-height: 200px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.stage img {
    max-width: 100%;
    max-height: 200px;
    object-fit: cover;
}

.caption {
    position: absolute;
    bottom: 5px;
    left: 5px;
    background: rgba(0,0,0,0.5);
    color: white;
    padding: 4px 8px;
    border-radius: 5px;
    font-size: 12px;
}
/* Contact */
#contactus{
    text-align: center;
    padding: 40px 10px;
    margin-bottom: 30px;
}
#contactus ul{
    list-style: none;
    margin-top: 10px;
}
#contactus li{
    margin: 5px 0;
}
hr{
    margin-top: 30px;
    height: 5px;
    background-color: var(--border);
}
/* Contact Section */
#contactus{
    text-align: center;
    padding: 40px 20px;
    margin: 20px;
    background: white;
    border-radius: 20px;
    border: 3px solid var(--border);
}

#contactus p{
    margin: 10px 0 30px;
    color: var(--blackish);
    font-size: 16px;
}

.contact-cards{
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.contact-card{
    background: var(--yellow);
    border: 2px solid var(--border);
    border-radius: 15px;
    padding: 20px;
    width: 250px;
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
}

.contact-card:hover{
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.2);
}

.contact-card a{
    text-decoration: none;
    color: inherit;
    display: block;
}

.contact-card img{
    width: 50px;
    height: 50px;
    margin-bottom: 10px;
}

.contact-card h3{
    margin: 10px 0;
    font-size: 18px;
    color: var(--blackish);
}

.contact-card p{
    font-size: 15px;
    color: #333;
}

/* 🔹 Media Queries */
/* 📱 نسخه موبایل */
@media (max-width: 576px) {

    /* هدر */
    header{
        gap: 10px;
        padding: 5px;
    }
    header h1{
        font-size: 22px;
        white-space: nowrap;
    }
    .logo{
        width: 40px;
        height: 40px;
    }
    .right-logo{
        width: 55px;
        height: 55px;
    }

    /* متن زیر هدر */
    .intro h2{
        font-size: 15px;
        white-space: normal; /* اجازه میده خط دوم هم بیفته */
        line-height: 1.2;
    }

    /* منو: ۲ ستون × ۲ ردیف با سایز بزرگتر */
    .menu{
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        justify-items: center;
    }
    .menu-item img{
        width: 160px;
        height: 130px;
    }
    .overlay-text{
        font-size: 16px;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        white-space: nowrap;
    }

    /* محصولات (دوربین و دزدگیر) */
    .products{
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .card{
        height: auto; /* کوتاه تر بشه */
        padding: 5px;
    }
    .card img{
        height: 90px;
        object-fit: contain;
    }
    .card h3{
        font-size: 13px;
        min-height: auto;
    }
    .btn{
        font-size: 12px;
        padding: 3px 6px;
    }

    /* لوازم جانبی دوربین: توی یک خط */
    .accessories{
        flex-wrap: nowrap;
        justify-content: center;
        gap: 8px;
    }
    .accessories .accessory{
        width: 22%;
    }
    .accessories .accessory img{
        width: 50px;
        height: 50px;
    }
    .accessories .accessory p{
        font-size: 12px;
    }

    /* لوازم جانبی دزدگیر: ۴ ستون × ۲ ردیف */
    .alarm-accessories{
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
    }
    .alarm-accessories .accessory{
        width: 22%;
    }
    .alarm-accessories .accessory img{
        width: 50px;
        height: 50px;
        padding: 5px;
    }
    .alarm-accessories .accessory p{
        font-size: 11px;
    }

    /* نمونه کارها: عمودی */
    .portfolio .row{
        flex-direction: column;
        gap: 20px;
    }

    /* تماس با ما */
    .contact-cards{
        display: flex;
        flex-direction: row; /* کنار هم */
        justify-content: space-between; /* فاصله مساوی */
        flex-wrap: nowrap; /* اجازه نده بره خط بعد */
        gap: 5px; /* فاصله کم بین کارت‌ها */
        width: 100%;
        box-sizing: border-box;
    }
    .contact-card h3{
        font-size: 14px;
    }
    .contact-card p{
        font-size: 12px;
    }
    .contact-card img{
        width: 30px;
        height: 30px;
    }
    .contact-card{
        width: 40%;
        margin: 0;
        padding: 0 5px;
    }
}
/* 📲 نسخه تبلت */
@media (min-width: 577px) and (max-width: 992px) {

    /* هدر */
    header h1{
        font-size: 28px;
    }
    .logo{
        width: 45px;
        height: 45px;
    }
    .right-logo{
        width: 65px;
        height: 65px;
    }

    /* متن زیر هدر */
    .intro h2{
        font-size: 18px;
    }

    /* منو */
    .menu-item img{
        width: 140px;
        height: 140px;
    }
    .overlay-text{
        font-size: 16px;
    }

    /* کارت محصولات */
    .products{
        grid-template-columns: repeat(2, 1fr);
    }
    .card img{
        height: 120px;
    }
    .card h3{
        font-size: 16px;
    }

    /* لوازم جانبی */
    .accessories,
    .alarm-accessories{
        flex-wrap: wrap;
        gap: 15px;
    }
    .accessory img{
        width: 70px;
        height: 70px;
    }
    .alarm-accessories .accessory img{
        width: 70px;
        height: 70px;
    }

    /* نمونه کارها */
    .portfolio .row{
        flex-direction: row;
        gap: 20px;
        justify-content: center;
    }
    .column{
        max-width: 400px;
    }

    /* تماس با ما */
    .contact-cards{
        display: flex;
        flex-wrap: nowrap;
        justify-content: center;
        gap: 10px;
    }
    .contact-card{
        width: 30%;
        padding: 10px;
    }
    .contact-card h3{
        font-size: 14px;
    }
    .contact-card p{
        font-size: 12px;
    }
    .contact-card img{
        width: 50px;
        height: 50px;
    }
}