/**
 * DeshiShop eCommerce Engine - Complete Unified Stylesheet
 * Architecture: RAW PHP 8.4 High-Performance Core Compatible
 * Responsive: 100% Fully Responsive Across Mobile, Tablet, and Desktop Viewports
 * Optimization: Pure Shorthand Definitions & Box-Shadow Layout Partitions
 * Strict Constraint Compliance: Zero individual side borders (border-top/left/right/bottom) used.
 */

/* ==========================================================================
   1. Root Variables & Global Resets
   ========================================================================== */
:root {
    --primary-color: #4a148c;       /* Authentic Royal Purple */
    --primary-gradient: linear-gradient(135deg, #311b92, #6a1b9a);
    --accent-color: #ff9800;        /* Bright Flash Sale Orange */
    --accent-hover: #e68a00;
    --text-dark: #1a1a1a;
    --text-medium: #4e4e4e;
    --text-light: #757575;
    --bg-light: #f5f6fa;
    --white: #ffffff;
    --danger-color: #ff0055;        /* Premium Discount Red */
    --badge-bg: #ff0055;
    --card-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    --hover-shadow: 0 8px 24px rgba(74, 20, 140, 0.12);
    --transition-speed: 0.25s;
    --border-smooth: 1px solid #e8e8e8;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.5;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition-speed);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

button, input, select {
    font-family: inherit;
    outline: none;
}

/* ==========================================================================
   2. Top Info Utility Bar
   ========================================================================== */
.top-bar {
    background-color: var(--primary-color);
    color: var(--white);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 5%;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.2px;
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.top-divider {
    opacity: 0.3;
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 18px;
}

.top-bar-right a {
    opacity: 0.9;
}

.top-bar-right a:hover {
    opacity: 1;
    text-decoration: underline;
}

/* ==========================================================================
   3. Main Header & Search Engine
   ========================================================================== */
.main-header {
    background-color: var(--white);
    padding: 18px 5%;
    box-shadow: 0 1px 0 #e8e8e8; /* Replaces edge borders cleanly */
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 30px;
    max-width: 1440px;
    margin: 0 auto;
}

.logo-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-text h2 {
    color: var(--primary-color);
    font-size: 26px;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 2px;
    letter-spacing: -0.5px;
}

.logo-text span {
    color: var(--text-light);
    font-size: 12px;
    font-weight: 500;
}

/* Advanced Precision Search Component */
.search-form {
    flex: 1;
    max-width: 580px;
    display: flex;
    align-items: center;
    background-color: var(--bg-light);
    border: 1px solid #dddddd;
    border-radius: 8px;
    padding: 3px;
    transition: border-color var(--transition-speed);
}

.search-form:focus-within {
    border-color: var(--primary-color);
}

.search-category-wrapper select {
    background: transparent;
    border: 0;
    padding: 10px 15px;
    color: var(--text-dark);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
}

.search-divider-line {
    width: 1px;
    height: 22px;
    background-color: #cccccc;
    margin: 0 4px;
}

.search-input-wrapper {
    flex: 1;
}

.search-input-wrapper input {
    width: 100%;
    border: 0;
    background: transparent;
    padding: 10px 12px;
    font-size: 14px;
    color: var(--text-dark);
}

.search-btn {
    background-color: var(--primary-color);
    color: var(--white);
    border: 0;
    padding: 10px 24px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: background var(--transition-speed);
}

.search-btn:hover {
    background-color: #311b92;
}

/* User Operational Badges */
.user-actions {
    display: flex;
    align-items: center;
    gap: 24px;
}

.action-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-dark);
    position: relative;
}

.action-item:hover {
    color: var(--primary-color);
}

.icon-wrap {
    position: relative;
    margin-bottom: 1px;
}

.badge {
    position: absolute;
    top: -5px;
    right: -9px;
    background-color: var(--badge-bg);
    color: var(--white);
    font-size: 10px;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 10px;
    line-height: 1;
}

.action-title {
    font-size: 12px;
    font-weight: 600;
}

.account-item {
    flex-direction: row;
    gap: 10px;
}

.account-text {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.account-text strong {
    font-size: 14px;
    color: var(--text-dark);
    line-height: 1.2;
}

.account-text span {
    font-size: 11px;
    color: var(--text-light);
}

/* ==========================================================================
   4. Mega Dropdown Navigation Engine
   ========================================================================== */
.bottom-nav {
    background-color: var(--white);
    box-shadow: 0 2px 10px rgba(0,0,0,0.04), 0 1px 0 #e8e8e8;
}

.nav-container {
    display: flex;
    align-items: center;
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 5%;
}

.browse-categories-btn {
    background-color: var(--primary-color);
    color: var(--white);
    width: 260px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    border-radius: 8px 8px 0 0;
}

.nav-links-wrapper {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-left: 30px;
}

.nav-list {
    display: flex;
    list-style: none;
    gap: 28px;
}

.nav-list a {
    color: var(--text-dark);
    font-weight: 600;
    font-size: 14px;
    padding: 16px 0;
    display: inline-block;
    position: relative;
}

/* Clean Underline Design Replacement using Box-Shadow */
.nav-list a.active, .nav-list a:hover {
    color: var(--primary-color);
    box-shadow: 0 -2px 0 0 var(--primary-color) inset;
}

.flash-sale-btn {
    background-color: var(--accent-color);
    color: var(--white);
    padding: 10px 18px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background var(--transition-speed);
}

.flash-sale-btn:hover {
    background-color: var(--accent-hover);
}

/* Deep Level Category Dropdowns */
.has-dropdown {
    position: relative;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--white);
    min-width: 240px;
    list-style: none;
    border: var(--border-smooth);
    box-shadow: var(--hover-shadow);
    border-radius: 0 0 8px 8px;
    z-index: 500;
}

.dropdown-menu li {
    position: relative;
}

.dropdown-menu li a {
    display: block;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 1px 0 #f4f4f4;
}

.dropdown-menu li:hover > a {
    background-color: var(--bg-light);
    color: var(--primary-color);
    box-shadow: none;
}

.has-sub-dropdown .sub-dropdown-menu {
    display: none;
    position: absolute;
    top: 0;
    left: 100%;
    background-color: var(--white);
    min-width: 220px;
    list-style: none;
    border: var(--border-smooth);
    box-shadow: var(--hover-shadow);
    border-radius: 6px;
}

.has-dropdown:hover > .dropdown-menu,
.has-sub-dropdown:hover > .sub-dropdown-menu {
    display: block;
}

/* Responsive Hamburger Mechanism */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 22px;
    height: 16px;
    background: transparent;
    border: 0;
    cursor: pointer;
}

.mobile-menu-toggle span {
    width: 100%;
    height: 2.5px;
    background-color: var(--primary-color);
    border-radius: 2px;
    transition: var(--transition-speed);
}

/* ==========================================================================
   5. Core Layout Container & Sidebar Grid
   ========================================================================== */
.container {
    display: flex;
    padding: 30px 5%;
    gap: 30px;
    max-width: 1440px;
    margin: 0 auto;
}

.sidebar {
    width: 260px;
    background-color: var(--white);
    border: var(--border-smooth);
    border-radius: 8px;
    padding: 20px;
    align-self: flex-start;
    box-shadow: var(--card-shadow);
}

.sidebar-title {
    background: var(--primary-gradient);
    color: var(--white);
    padding: 12px;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 12px;
    text-align: center;
}

.sidebar-list {
    list-style: none;
}

.sidebar-list li a {
    display: block;
    padding: 11px 12px;
    color: var(--text-dark);
    font-weight: 500;
    font-size: 14px;
    border-radius: 6px;
    box-shadow: 0 1px 0 #fafafa;
}

.sidebar-list li:hover a {
    background-color: var(--bg-light);
    color: var(--primary-color);
    font-weight: 700;
    box-shadow: none;
}

.main-content {
    flex: 1;
}

/* ==========================================================================
   6. Hero Campaign Banner
   ========================================================================== */
.hero-banner {
    background: var(--primary-gradient);
    color: var(--white);
    border-radius: 12px;
    padding: 45px 50px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    box-shadow: var(--card-shadow);
}

.hero-content {
    max-width: 55%;
}

.hero-subtitle {
    color: var(--accent-color);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 1.2px;
    margin-bottom: 8px;
}

.hero-title {
    font-size: 40px;
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 6px;
}

.hero-discount {
    font-size: 30px;
    font-weight: 700;
    margin-bottom: 12px;
}

.hero-desc {
    font-size: 14px;
    opacity: 0.85;
    margin-bottom: 25px;
}

.btn-primary {
    padding: 12px 32px;
    background-color: var(--white);
    color: var(--primary-color);
    border: 0;
    border-radius: 25px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    transition: background var(--transition-speed), transform var(--transition-speed);
}

.btn-primary:hover {
    background-color: var(--accent-color);
    color: var(--white);
    transform: translateY(-1px);
}

/* ==========================================================================
   7. Store Value/Trust Features
   ========================================================================== */
.store-features {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 35px;
    background-color: var(--white);
    padding: 22px;
    border: var(--border-smooth);
    border-radius: 10px;
    box-shadow: var(--card-shadow);
}

.feature-box {
    text-align: center;
    box-shadow: -1px 0 0 #f0f0f0 inset; /* Internal separator mapping */
}

.feature-box:last-child {
    box-shadow: none;
}

.feature-box strong {
    display: block;
    font-size: 15px;
    color: var(--text-dark);
    margin-bottom: 2px;
}

.feature-box small {
    color: var(--text-light);
    font-size: 12px;
}

/* ==========================================================================
   8. Absolute Product Component Matrix
   ========================================================================== */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header h2 {
    font-size: 22px;
    font-weight: 700;
}

.view-all-link {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 14px;
}

.view-all-link:hover {
    color: var(--accent-color);
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 20px;
}

.product-card {
    background-color: var(--white);
    border: var(--border-smooth);
    border-radius: 8px;
    padding: 16px;
    text-align: center;
    position: relative;
    box-shadow: var(--card-shadow);
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--hover-shadow);
}

.discount-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background-color: var(--danger-color);
    color: var(--white);
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 700;
    border-radius: 4px;
    z-index: 5;
}

.product-image-wrapper {
    height: 160px;
    background-color: #fafafa;
    border-radius: 6px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    overflow: hidden;
}

.product-image-wrapper img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
    transition: transform var(--transition-speed);
}

.product-card:hover .product-image-wrapper img {
    transform: scale(1.04);
}

.product-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 6px;
    text-align: left;
    height: 38px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product-rating {
    text-align: left;
    color: #ffb300;
    font-size: 12px;
    margin-bottom: 10px;
}

.review-count {
    color: var(--text-light);
    font-size: 11px;
    margin-left: 3px;
}

.product-price-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.current-price {
    font-size: 17px;
    font-weight: 700;
    color: var(--primary-color);
}

.old-price {
    font-size: 13px;
    color: var(--text-light);
    text-decoration: line-through;
    margin-left: auto;
    margin-right: 12px;
}

.add-to-cart-btn {
    background-color: var(--primary-color);
    color: var(--white);
    border: 0;
    width: 34px;
    height: 34px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    transition: background var(--transition-speed);
}

.add-to-cart-btn:hover {
    background-color: var(--accent-color);
}

/* ==========================================================================
   9. High-End Compact Integrated Footer
   ========================================================================== */
.site-footer {
    background-color: #1c0435; /* Premium Deep Lavender Purple Accent */
    color: #dfd3ed;
    padding: 45px 5% 20px;
    margin-top: 60px;
}

.footer-container {
    display: grid;
    grid-template-columns: 1.4fr 1.1fr 1fr;
    gap: 40px;
    max-width: 1440px;
    margin: 0 auto;
}

.footer-col h3 {
    color: var(--white);
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 15px;
}

.brand-info h3 {
    color: var(--accent-color);
    font-size: 22px;
}

.footer-col p {
    font-size: 13px;
    line-height: 1.7;
    opacity: 0.85;
}

.links-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.links-grid a {
    color: #dfd3ed;
    font-size: 13px;
}

.links-grid a:hover {
    color: var(--accent-color);
}

.footer-contact p {
    margin-bottom: 8px;
}

.footer-bottom {
    margin-top: 40px;
    padding-top: 20px;
    box-shadow: 0 -1px 0 rgba(255,255,255,0.08); /* Replaces top-border seamlessly */
    text-align: center;
    font-size: 13px;
    opacity: 0.6;
}

/* ==========================================================================
   10. Advanced Responsive Grid System Configuration (Media Queries)
   ========================================================================== */

/* Tablet & iPad Pro Optimization Display Grid */
@media (max-width: 1024px) {
    .container {
        flex-direction: column;
        padding: 20px 4%;
    }

    .sidebar, .main-content {
        width: 100%;
    }

    .search-form {
        max-width: 400px;
    }
}

/* Standard Mobile Optimization Engine Layouts */
@media (max-width: 768px) {
    .top-bar {
        flex-direction: column;
        text-align: center;
        gap: 6px;
        padding: 10px;
    }

    .main-header {
        padding: 12px 4%;
    }

    .header-container {
        flex-wrap: wrap;
        gap: 12px;
    }

    .mobile-menu-toggle {
        display: flex;
        order: 1;
    }

    .logo-wrapper {
        order: 2;
    }

    .desktop-actions {
        display: none; /* Safely hides grid arrays to keep code bug free */
    }

    .search-form {
        order: 3;
        width: 100%;
        max-width: 100%;
        margin-top: 10px;
    }

    .search-category-wrapper, .search-divider-line {
        display: none; /* Responsive reduction to keep design tight */
    }

    .nav-container {
        flex-direction: column;
        align-items: flex-start;
        padding: 0;
    }

    .browse-categories-btn {
        width: 100%;
        border-radius: 0;
        justify-content: center;
    }

    .nav-links-wrapper {
        display: none;
        width: 100%;
        flex-direction: column;
        padding: 0;
    }

    /* JavaScript Toggle Interface Class */
    .nav-links-wrapper.active {
        display: flex;
    }

    .nav-list {
        flex-direction: column;
        width: 100%;
        gap: 0;
    }

    .nav-list a {
        padding: 14px 20px;
        width: 100%;
        box-shadow: 0 1px 0 #f0f0f0;
    }
    
    .nav-list a.active, .nav-list a:hover {
        box-shadow: 3px 0 0 0 var(--primary-color) inset; /* Smooth left indicator on mobile drawer */
    }

    .dropdown-menu, .has-sub-dropdown .sub-dropdown-menu {
        position: static;
        box-shadow: none;
        border: 0;
        display: block;
        padding-left: 20px;
        background-color: var(--bg-light);
    }

    .flash-sale-btn {
        margin: 15px;
        justify-content: center;
    }

    .hero-banner {
        flex-direction: column;
        text-align: center;
        padding: 30px 20px;
    }

    .hero-content {
        max-width: 100%;
        margin-bottom: 20px;
    }

    .hero-title {
        font-size: 26px;
    }

    .store-features {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        padding: 15px;
    }

    .feature-box {
        box-shadow: none;
        padding: 5px;
    }

    .product-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 Products per row exactly like standard eCommerce apps */
        gap: 12px;
    }

    .product-card {
        padding: 12px;
    }

    .product-image-wrapper {
        height: 135px;
    }

    .current-price {
        font-size: 15px;
    }

    .footer-container {
        grid-template-columns: 1fr;
        gap: 25px;
        text-align: center;
    }

    .links-grid {
        grid-template-columns: 1fr;
    }
}

/* Specific Tweak For Legacy Ultra Small Width Monitors */
@media (max-width: 360px) {
    .product-grid {
        grid-template-columns: 1fr;
    }
}