/* Orient C Decor - Modern E-commerce Styles */

:root {
    --primary-color: #000000;
    --secondary-color: #1a1a1a;
    --accent-color: #2C2C2C;
    --dark-color: #2C2C2C;
    --light-color: #F5F5F5;
    --white: #FFFFFF;
    --success: #28a745;
    --danger: #dc3545;
    --warning: #FFD700;
    --admin-header-bg: linear-gradient(135deg, #2a2a2a, #3a3a3a);
    --admin-primary: #2a2a2a;
    --admin-gray-light: #f5f5f5;
    --admin-gray-medium: #e0e0e0;
    --admin-gray-dark: #888;
    --admin-border: #d0d0d0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--dark-color);
    background-color: var(--light-color);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    overflow-x: hidden;
}

main.container {
    min-width: 0;
}

/* Product page - adaptar ao container, sem cortar */
.product-detail-grid {
    min-width: 0;
    width: 100%;
}

.product-detail-grid > div {
    min-width: 0;
    overflow: visible;
}

.product-detail-grid .product-detail-carousel,
.product-detail-grid .product-detail-info {
    max-width: 100%;
}

.product-detail-grid img {
    max-width: 100%;
    height: auto;
    object-fit: contain !important;
}

.product-detail-grid .product-detail-carousel > div:first-child {
    max-width: 100%;
}

.product-detail-grid .product-detail-carousel img {
    object-fit: contain !important;
}

/* Cart - containers cupom e frete */
.cart-page .product-card {
    min-width: 0;
}

.cart-page .product-card > div {
    min-width: 0;
}

.cart-page .form-container,
.cart-page .cart-cupom,
.cart-page .cart-frete,
.cart-page .cart-checkout {
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
}

/* Frete e Cupom - adaptar ao container (product + cart) */
.frete-container,
.cupom-container {
    max-width: 100%;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.frete-input-row,
.cupom-input-row {
    min-width: 0;
}

.frete-input-row input,
.cupom-input-row input {
    min-width: 0;
    max-width: 100%;
}

.cart-page .cart-cupom > div,
.cart-page .cart-frete > div {
    flex-wrap: wrap;
}

.cart-page .form-container input {
    min-width: 0;
}

/* Header Styles */
header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header-top {
    padding: 1rem 0;
}

.header-top .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.header-left {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
}

.logo {
    font-size: 1.8rem;
    font-weight: bold;
    text-decoration: none;
    color: var(--white);
    transition: opacity 0.3s;
}

.logo:hover {
    opacity: 0.9;
}

.logo-img {
    display: block;
    max-height: 50px;
}

.logo span {
    color: #FFD700;
}

.header-center {
    flex: 1;
    display: flex;
    justify-content: center;
}

.header-bottom {
    background: rgba(0,0,0,0.2);
    padding: 0.5rem 0;
}

.header-bottom .container {
    display: flex;
    align-items: center;
}

.nav-categories {
    display: flex;
    gap: 1.5rem;
    width: 100%;
    justify-content: center;
}

.nav-link {
    color: var(--white);
    text-decoration: none;
    font-size: 0.95rem;
    padding: 0.5rem 0;
    transition: color 0.3s;
    font-weight: 500;
}

.nav-link:hover {
    color: #FFD700;
}

.nav-category-dropdown {
    position: relative;
    display: flex;
    align-items: center;
}

.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--white);
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    border-radius: 5px;
    min-width: 200px;
    padding: 0.5rem 0;
    z-index: 1000;
}

.nav-category-dropdown:hover .nav-dropdown-menu {
    display: block;
}

.nav-dropdown-menu a {
    display: block;
    padding: 0.75rem 1.5rem;
    color: var(--dark-color);
    text-decoration: none;
    transition: background 0.3s;
}

.nav-dropdown-menu a:hover {
    background: var(--light-color);
    color: var(--primary-color);
}

.nav-dropdown-menu .dropdown-all {
    border-bottom: 2px solid var(--primary-color);
    font-weight: bold;
}

/* Search Form */
.search-form {
    display: flex;
    width: 100%;
    max-width: 500px;
    gap: 0;
}

.search-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 5px 0 0 5px;
    font-size: 1rem;
    outline: none;
}

.search-btn {
    padding: 0.75rem 1.5rem;
    background: var(--accent-color);
    border: none;
    border-radius: 0 5px 5px 0;
    color: var(--white);
    cursor: pointer;
    font-size: 1.2rem;
    transition: background 0.3s;
}

.search-btn:hover {
    background: var(--secondary-color);
}

/* Filters mobile toggle - esconder no desktop */
.filters-mobile-toggle,
.search-filters-mobile .search-filters-toggle {
    display: none;
}


.header-right {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 1.5rem;
    flex: 0 0 auto;
}

.icon-link {
    color: var(--white);
    text-decoration: none;
    font-size: 1.5rem;
    transition: all 0.3s;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
}

.icon-link:hover {
    opacity: 0.8;
    transform: scale(1.1);
}

.badge {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--danger);
    color: var(--white);
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
    font-weight: bold;
}

nav a {
    color: var(--white);
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.3s;
}

nav a:hover {
    opacity: 0.8;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--white);
    font-size: 2rem;
    cursor: pointer;
    padding: 0.5rem;
}

/* Auth Pages */
.auth-container {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 0;
}

.auth-box {
    background: var(--white);
    padding: 3rem;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 450px;
}

.auth-box h2 {
    color: var(--primary-color);
    margin-bottom: 2rem;
    text-align: center;
    font-size: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--dark-color);
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.btn {
    display: inline-block;
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    transition: all 0.3s;
}

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

.btn-primary:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(139,69,19,0.3);
}

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

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

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

/* Messages */
.message {
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-radius: 5px;
    text-align: center;
}

.message-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Product Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.product-card {
    background: var(--white);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.product-image {
    width: 100%;
    height: 200px;
    background: var(--light-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 3rem;
}

.product-info {
    padding: 1.5rem;
}

.product-name {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--dark-color);
}

.product-price {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

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

.product-stock {
    font-size: 0.85rem;
    color: var(--success);
    margin-bottom: 1rem;
}

/* Forms */
.form-container {
    background: var(--white);
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    margin: 2rem 0;
}

.form-container h2 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

/* Dashboard */
.dashboard {
    padding: 2rem 0;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.dashboard-header h1 {
    color: var(--primary-color);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--white);
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    text-align: center;
}

.stat-card h3 {
    color: var(--primary-color);
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.stat-card p {
    color: #666;
    font-weight: 600;
}

/* Table */
.table-container {
    background: var(--white);
    border-radius: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

table {
    width: 100%;
    border-collapse: collapse;
}

table th,
table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

table th {
    background: var(--primary-color);
    color: var(--white);
    font-weight: 600;
}

table tr:hover {
    background: #f9f9f9;
}

/* Footer */
footer {
    background: var(--dark-color);
    color: var(--white);
    text-align: center;
    padding: 2rem 0;
    margin-top: 4rem;
}

/* Mobile Menu Styles */
.mobile-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    z-index: 1000;
}

.mobile-menu.active {
    display: block;
}

.mobile-menu ul {
    list-style: none;
    padding: 1rem 0;
    margin: 0;
}

.mobile-menu li {
    border-bottom: 1px solid rgba(255,255,255,0.2);
}

.mobile-menu a {
    display: block;
    color: var(--white);
    text-decoration: none;
    padding: 1rem 2rem;
    font-weight: 500;
    transition: background 0.3s;
}

.mobile-menu a:hover {
    background: rgba(255,255,255,0.1);
}

.mobile-submenu {
    display: none;
    background: rgba(0,0,0,0.2);
}

.mobile-submenu.active {
    display: block;
}

.mobile-submenu li {
    border-bottom: none;
}

.mobile-submenu a {
    padding-left: 3rem;
    font-size: 0.9em;
}

/* Responsive */
@media (max-width: 768px) {
    header {
        position: relative;
    }

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

    .header-left {
        flex: 0 0 auto;
        min-width: 0;
    }

    .header-left .logo-img {
        height: 45px !important;
        min-width: 90px !important;
    }

    .logo {
        font-size: 1.5rem;
    }

    .mobile-menu-toggle {
        display: block;
    }

    .header-center {
        order: 3;
        flex: 1 1 100%;
        min-width: 0;
    }

    .search-form {
        flex-direction: row;
    }
    
    .header-bottom {
        display: none;
    }

    .header-right {
        display: flex;
        justify-content: flex-end;
        align-items: center;
        gap: 0.5rem;
    }

    .products-grid {
        grid-template-columns: 1fr;
    }

    /* Home header button */
    [style*="justify-content: space-between"][style*="Mais Vendidos"] {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 1rem !important;
    }

    [style*="justify-content: space-between"][style*="Mais Vendidos"] a {
        align-self: flex-end !important;
    }

    /* Filters layout - colapsável no mobile */
    .filters-products-grid {
        grid-template-columns: 1fr !important;
    }

    .filters-products-grid > div:first-child {
        position: relative !important;
        top: 0 !important;
    }

    .filters-sidebar-mobile .filters-mobile-toggle {
        display: flex !important;
        width: 100%;
        justify-content: space-between;
        align-items: center;
        padding: 0.75rem 1rem;
        background: #1a1a1a;
        color: white;
        border: none;
        border-radius: 8px;
        font-size: 1rem;
        font-weight: 600;
        cursor: pointer;
    }

    .filters-sidebar-mobile .filters-mobile-toggle .filters-arrow {
        transition: transform 0.3s;
    }

    .filters-sidebar-mobile .filters-mobile-toggle.active .filters-arrow {
        transform: rotate(180deg);
    }

    .filters-sidebar-mobile .filters-sidebar-content {
        display: none;
        padding-top: 1rem;
    }

    .filters-sidebar-mobile.expanded .filters-sidebar-content {
        display: block;
    }

    .filters-mobile-toggle {
        margin-bottom: 0;
    }

    /* Search filters colapsável */
    .search-filters-mobile {
        margin-bottom: 1rem;
    }

    .search-filters-mobile .search-filters-toggle {
        display: flex !important; /* mostra no mobile */
        width: 100%;
        padding: 0.6rem 1rem;
        background: #1a1a1a;
        color: white;
        border: none;
        border-radius: 8px;
        font-size: 0.95rem;
        font-weight: 600;
        cursor: pointer;
        margin-bottom: 0;
    }

    .search-filters-mobile .search-filters-toggle {
        margin-bottom: 0.5rem;
    }

    .search-filters-mobile .search-filters-inner {
        display: none;
    }

    .search-filters-mobile.expanded .search-filters-inner {
        display: grid;
    }

    /* Home Mais Vendidos menor no mobile */
    .home-mais-vendidos h2 {
        font-size: 1.3rem !important;
    }

    .home-mais-vendidos a {
        font-size: 0.8rem !important;
        padding: 0.35rem 0.85rem !important;
    }

    /* Product page - adaptar sem cortar */
    .product-detail-grid {
        width: 100%;
    }

    .product-detail-grid > div {
        min-width: 0;
    }

    .product-detail-grid img {
        max-width: 100%;
        height: auto;
        object-fit: contain;
    }

    /* Cart - cupom e frete dentro do container */
    .cart-page .form-container {
        max-width: 100%;
        box-sizing: border-box;
    }

    .cart-page .cart-items-grid .product-card {
        min-width: 0;
    }

    .cart-page .product-card img {
        max-width: 100%;
    }

    .cart-page .product-card > div {
        min-width: 0;
    }

    .auth-box {
        padding: 2rem;
        margin: 1rem;
    }

    .dashboard-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .table-container {
        overflow-x: auto;
    }

    table {
        min-width: 600px;
    }

    .form-container form > div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }

    /* Product page layout */
    [style*="grid-template-columns: 1fr 1fr"][style*="gap: 3rem"][style*="padding: 2rem"] {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
        padding: 1rem !important;
    }

    /* Product carousel */
    [style*="width: 100%"][style*="height: 400px"][style*="carousel"] {
        height: 300px !important;
    }

    /* Cart items */
    .product-card[style*="display: flex"][style*="flex-direction: row"] {
        flex-direction: column !important;
        align-items: flex-start !important;
    }

    .product-card[style*="display: flex"][style*="flex-direction: row"] > div:first-child {
        width: 100% !important;
        margin-right: 0 !important;
        margin-bottom: 1rem !important;
    }

    .hero {
        padding: 2rem 1rem !important;
    }

    .hero h1 {
        font-size: 2rem !important;
    }

    .hero p {
        font-size: 1.1rem !important;
    }

    /* Home sections responsivity */
    .html-section-grid {
        grid-template-columns: 1fr !important;
        padding: 2rem 1rem !important;
        max-height: none !important;
    }

    .about-section-grid {
        grid-template-columns: 1fr !important;
        padding: 2rem 1rem !important;
        min-height: auto !important;
    }

    /* Title and button adjustments */
    .html-section-grid h2 {
        font-size: 1.8rem !important;
    }

    .about-section-grid h2 {
        font-size: 1.8rem !important;
    }

    /* Instagram title */
    [style*="instagram"] h2 {
        font-size: 1.5rem !important;
    }

    /* Footer grid */
    footer [style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }

    /* Footer newsletter form */
    footer form[style*="display: flex"] {
        flex-direction: column !important;
        gap: 1rem !important;
    }

    footer form[style*="display: flex"] button {
        width: 100% !important;
    }

    footer h3 {
        font-size: 1.2rem !important;
    }

    /* Footer policy links */
    footer [style*="display: flex"][style*="justify-content: center"] {
        gap: 1rem !important;
    }

    footer [style*="display: flex"][style*="justify-content: center"] a {
        font-size: 0.9rem !important;
    }

    /* Footer padding */
    footer {
        padding: 2rem 0 !important;
    }
}

@media (max-width: 640px) {
    .header-top .container {
        gap: 0.5rem;
    }

    .header-center {
        order: 3;
        width: 100%;
        min-width: 0;
    }

    .search-form {
        flex-direction: row;
        max-width: none;
        width: 100%;
    }

    .search-input {
        border-radius: 5px 0 0 5px;
        min-width: 0;
    }

    .search-btn {
        border-radius: 0 5px 5px 0;
        padding: 0.75rem 1rem;
        flex-shrink: 0;
    }

    .header-right {
        flex: 0 0 auto;
        justify-content: flex-end;
        gap: 0.5rem;
    }

    .header-left {
        order: 1;
        flex-shrink: 0;
    }

    .header-right {
        order: 2;
    }

    .header-left .logo-img {
        height: 40px !important;
        min-width: 80px !important;
    }

    .header-right .mobile-menu-toggle {
        margin-left: 0;
    }
}

@media (max-width: 480px) {
    nav ul {
        flex-direction: column;
        gap: 0.5rem;
    }

    .logo {
        font-size: 1.5rem;
    }

    .header-right {
        gap: 0.5rem;
    }

    .icon-link {
        font-size: 1.3rem;
        padding: 0.3rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .auth-box {
        padding: 1.5rem;
    }

    .product-card .btn {
        padding: 0.6rem 1.5rem;
        font-size: 0.9rem;
    }

    .dashboard-header h1 {
        font-size: 1.5rem;
    }

    table th, table td {
        padding: 0.5rem;
        font-size: 0.9rem;
    }
}

/* Admin Menu */
.admin-header {
    position: relative;
    background: var(--admin-header-bg);
    color: var(--white);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.admin-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
}

.admin-menu-toggle {
    display: none;
    background: transparent;
    border: none;
    color: var(--white);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
}

.admin-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
}

.admin-nav ul {
    list-style: none;
    display: flex;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
    align-items: center;
}

.admin-nav-main {
    flex: 1;
}

.admin-nav-right {
    margin-left: auto;
}

.admin-nav a {
    color: var(--white);
    text-decoration: none;
    padding: 0.5rem 0.75rem;
    border-radius: 5px;
    transition: all 0.3s;
    white-space: nowrap;
    font-size: 0.9rem;
    font-weight: 500;
}

.admin-nav a:hover {
    background: rgba(255,255,255,0.1);
    color: #FFD700;
}

.admin-nav .view-site-btn {
    background: #FFD700;
    color: #1a1a1a;
    font-weight: 600;
}

.admin-nav .view-site-btn:hover {
    background: #e6c200;
    color: #1a1a1a;
}

@media (max-width: 905px) {
    .admin-menu-toggle {
        display: block;
    }

    .admin-header .container {
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .admin-header .logo {
        flex: 1 1 auto;
    }

    .admin-nav {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--admin-header-bg);
        box-shadow: 0 4px 10px rgba(0,0,0,0.1);
        z-index: 1000;
        padding: 1rem;
    }

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

    .admin-nav ul {
        flex-direction: column;
        gap: 0;
    }

    .admin-nav-main {
        margin-bottom: 1rem;
        border-bottom: 1px solid rgba(255,255,255,0.2);
        padding-bottom: 1rem;
    }

    .admin-nav li {
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }

    .admin-nav a {
        display: block;
        padding: 1rem 2rem;
    }
}

/* Admin-specific button overrides */
.admin-header ~ main .btn-primary {
    background: var(--admin-primary);
}

.admin-header ~ main .btn-primary:hover {
    background: #3a3a3a;
}

