/* =================================================
   TYPOGRAPHY
   ================================================= */

h1,
h2,
h3 {
    color: var(--text-main);
    margin-top: 0;
}

h2 {
    margin-bottom: 16px;
}

p {
    color: var(--text-soft);
}


/* =================================================
   CARDS & SECTIONS
   ================================================= */

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    padding: 16px;
    border-radius: 6px;
}


/* =================================================
   FORMS
   ================================================= */

input,
textarea,
select {
    width: 100%;
    padding: 8px 10px;

    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    border-radius: 4px;

    color: var(--text-main);
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
}

button {
    background: var(--primary);
    border: none;
    color: #ffffff;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
}

button:hover {
    background: var(--primary-hover);
}


/* =================================================
   TABLES
   ================================================= */

table {
    border-collapse: collapse;
    width: 100%;
}

th,
td {
    border: 1px solid var(--border-soft);
    padding: 10px;
}

th {
    background: var(--bg-soft);
    text-align: left;
    color: var(--text-main);
}


/* =================================================
   SHOP & CHECKOUT
   ================================================= */

.shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}

.product-card {
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    border-radius: 8px;
    padding: 16px;
    display: flex;
    flex-direction: column;
}

.product-card .price {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-main);
}

.action-bar {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 16px;
}

.action-primary {
    background: var(--primary);
    color: #ffffff;
    padding: 10px 18px;
    border-radius: 6px;
    text-decoration: none;
}

.action-primary:hover {
    background: var(--primary-hover);
    color: #ffffff;
}

.action-secondary {
    color: var(--text-muted);
}

.summary-box {
    background: var(--bg-soft);
    border: 1px solid var(--border-soft);
    border-radius: 8px;
    padding: 16px;
}


/* =================================================
   FOOTER (BRAND MATCHED)
   ================================================= */

.site-footer {
    background: var(--bg-brand-dark);
    color: var(--text-on-dark);
    margin-top: 64px;
}

/* Main footer content */
.site-footer .footer-grid {
    max-width: 1200px;
    margin: 0 auto;
    padding: 48px 24px;

    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 32px;
}

.site-footer strong {
    color: var(--text-on-dark);
}

.site-footer p,
.site-footer a {
    color: rgba(255, 255, 255, 0.82);
    font-size: 14px;
}

.site-footer a:hover {
    color: var(--accent-on-dark);
    text-decoration: none;
}

.site-footer ul {
    list-style: none;
    padding: 0;
    margin-top: 10px;
}

.site-footer {
    background: var(--bg-brand-dark);
    color: var(--text-on-dark);
}

/* -------------------------------------------------
   FOOTER BRAND
------------------------------------------------- */

.footer-brand {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-logo {
    height: 42px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    display: block;
}


/* -------------------------------------------------
   COPYRIGHT STRIP (FULL-WIDTH, EDGE-ALIGNED)
   ------------------------------------------------- */

.footer-bottom {
    width: 100%;
    margin: 0;
    padding: 14px 0;

    background: rgba(255, 255, 255, 0.60); /* visible on dark */
    border-top: 5px solid rgba(255, 255, 255, 0.30);

    text-align: center;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.75);
}

.footer-bottom {
    background: var(--bg-brand-soft);
    border-top: 1px solid rgba(255,255,255,0.12);
}

/* =================================================
   HERO SECTION – GRID-BASED (FIXED HEIGHT)
   ================================================= */

.hero-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;

    /* FIXED HEIGHT */
    height: 520px; 
    padding: 0 56px;
    overflow: hidden; /* Prevents overflow content from stretching container */

    background-image: url("/assets/images/muthu_ide_for_avr_hero_image.jpg");
    background-repeat: no-repeat;
    background-position: right center;
    background-size: cover;

    background-color: var(--bg-card);
    border: 1px solid var(--border-soft);
    border-radius: 14px;
    margin-bottom: 48px;
}

.hero-content {
    /* Tightened vertical padding */
    padding: 24px 0; 
    max-width: 640px;
    display: flex;
    flex-direction: column;
    /* Reduced gap between title, subtitle, and description */
    gap: 25px; 
}

/* Typography & Truncation Logic */
.hero-section h1 {
    font-size: 40px;
    line-height: 1.15;
    margin: 0;
}

.hero-subtitle {
    font-size: 20px;
    color: var(--text-soft);
    margin: 0;
}

.hero-description {
    color: var(--text-muted);
    margin: 0;

    /* ELLIPSIS TRUNCATION (Line Clamping) */
    display: -webkit-box;
    -webkit-line-clamp: 3; /* Shows only 3 lines of text then adds "..." */
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hero-section .action-bar {
    margin-top: 16px; /* Tightened gap for buttons */
}

/* =================================================
   MOBILE
   ================================================= */

@media (max-width: 900px) {
    .hero-section {
        grid-template-columns: 1fr;
        grid-template-rows: auto 240px;
        height: auto;
        background-position: right bottom;
        background-size: 150% auto;
    }

    .hero-content {
        padding: 24px 16px;
    }
}

/* ================================
   SHOP LAYOUT
   ================================ */

.shop-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 24px;
}

/* Sidebar */
.shop-sidebar {
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    padding: 16px;
    border-radius: 6px;
}

.shop-sidebar h4 {
    margin-bottom: 12px;
}

.category-list,
.subcategory-list {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.category-list > li {
    font-weight: 600;
    margin-top: 10px;
}

.subcategory-list {
    margin-left: 12px;
    margin-top: 4px;
}

.subcategory-list li {
    font-weight: normal;
    font-size: 14px;
    color: var(--text-soft);
    margin: 4px 0;
}

/* Products */
.shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}

.product-card {
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    padding: 16px;
    border-radius: 6px;
}

.price {
    font-weight: 600;
}

.in-stock { color: #22c55e; }
.out-stock { color: #ef4444; }

@media (max-width: 900px) {
    .shop-layout {
        grid-template-columns: 1fr;
    }
}

/* ================================
   COLLAPSIBLE CATEGORY MENU
   ================================ */

.category-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-item {
    border-bottom: 1px solid var(--border-soft);
}

/* Category button */
.category-toggle {
    width: 100%;
    background: none;
    border: none;
    padding: 10px 6px;
    font-size: 15px;
    font-weight: 600;
    text-align: left;
    color: var(--text-main);
    cursor: pointer;

    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Right arrow */
.category-toggle .arrow {
    transition: transform 0.2s ease;
    font-size: 18px;
}

/* Sub categories */
.subcategory-menu {
    list-style: none;
    padding-left: 12px;
    margin: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
}

.subcategory-menu li {
    padding: 6px 0;
    font-size: 14px;
    color: var(--text-soft);
    cursor: pointer;
}

/* Expanded state */
.category-item.active .subcategory-menu {
    max-height: 300px;
}

.category-item.active .arrow {
    transform: rotate(90deg);
}

.product-image {
    height: 160px;
    background: var(--bg-soft);
    border-radius: 4px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
}

.image-placeholder {
    font-size: 13px;
    color: var(--text-muted);
}

.product-card h3 {
    font-size: 16px;
    margin-bottom: 6px;
}

.product-card .desc {
    font-size: 14px;
    color: var(--text-soft);
    min-height: 38px;
}

.product-card .price {
    font-weight: 600;
    margin-top: 6px;
}

/* Category row layout */
.category-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Hide subcategories by default */
.subcategory-wrapper {
    display: none;
    padding-left: 14px;
}

/* Expanded state */
.category-item.active > .subcategory-wrapper {
    display: block;
}

/* Arrow rotation */
.category-item.active .arrow {
    transform: rotate(90deg);
}

.category-toggle {
    background: none;
    border: none;
    cursor: pointer;
}

.category-link {
    text-decoration: none;
    color: var(--text-main);
    flex: 1;
}

.breadcrumbs {
    font-size: 14px;
    margin-bottom: 16px;
    color: var(--text-muted);
}

.breadcrumbs a {
    color: var(--link);
    text-decoration: none;
}

.breadcrumbs a:hover {
    text-decoration: underline;
}

.breadcrumb-sep {
    margin: 0 6px;
    color: var(--text-muted);
}

.breadcrumb-current {
    color: var(--text-main);
    font-weight: 500;
}

/* =================================================
   BREADCRUMB BAR
================================================= */

.breadcrumb-bar {
    background: #f3f4f6;
    border-bottom: 1px solid #e5e7eb;
    font-size: 14px;
}

.breadcrumb-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.breadcrumb-inner a {
    color: #374151;
    text-decoration: none;
}

.breadcrumb-inner a:hover {
    text-decoration: underline;
}

.breadcrumb-sep {
    color: #9ca3af;
}

.breadcrumb-current {
    color: #111827;
    font-weight: 500;
}
