/**
 * Main Stylesheet
 * File: assets/css/style.css
 */

:root {
    --primary-color: #ee4d2d;
    --primary-hover: #d73211;
    --secondary-color: #f6f6f6;
    --accent-color: #ffba00;
    --success-color: #26aa99;
    --text-dark: #222222;
    --text-muted: #666666;
    --border-color: #e8e8e8;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.1);
    --shadow-md: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.12);
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
}

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

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f5f5f5;
    color: var(--text-dark);
    line-height: 1.6;
}

/* ===== TOP BAR ===== */
.top-bar {
    font-size: 0.85rem;
}

.top-bar a:hover {
    color: var(--accent-color) !important;
}

/* ===== NAVBAR ===== */
.navbar {
    padding: 0.75rem 0;
}

.navbar-brand {
    font-weight: 700;
}

.logo-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

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

.tagline {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 400;
}

.nav-link {
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color) !important;
    background-color: rgba(238, 77, 45, 0.1);
}

.nav-link.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.nav-link.btn-primary:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
}

/* ===== BUTTONS ===== */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

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

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-success {
    background-color: #25d366;
    border-color: #25d366;
}

.btn-success:hover {
    background-color: #128c7e;
    border-color: #128c7e;
}

/* ===== CARDS ===== */
.card {
    border: none;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    overflow: hidden;
}

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

.card-product {
    background: white;
    cursor: pointer;
}

.card-product .card-img-wrapper {
    position: relative;
    padding-top: 100%;
    overflow: hidden;
    background: #f8f8f8;
}

.card-product .card-img-top {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

.card-product .card-body {
    padding: 0.75rem;
}

.card-product .product-name {
    font-size: 0.875rem;
    color: var(--text-dark);
    line-height: 1.4;
    height: 2.5rem;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    margin-bottom: 0.5rem;
}

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

.card-product .product-original-price {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-decoration: line-through;
    margin-left: 0.5rem;
}

.card-product .product-discount {
    font-size: 0.7rem;
    background: var(--primary-color);
    color: white;
    padding: 0.125rem 0.375rem;
    border-radius: var(--radius-sm);
    margin-left: 0.5rem;
}

.card-product .product-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.card-product .product-rating {
    color: var(--accent-color);
}

.card-product .product-sold {
    color: var(--text-muted);
}

.card-product .product-location {
    color: var(--text-muted);
}

.card-product .badge-featured {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    background: var(--accent-color);
    color: var(--text-dark);
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
}

/* ===== PRODUCT DETAIL ===== */
.product-detail-image {
    border-radius: var(--radius-md);
    overflow: hidden;
    background: white;
}

.product-detail-image .main-image {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
}

.product-detail-image .thumbnail-list {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.product-detail-image .thumbnail {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.product-detail-image .thumbnail:hover,
.product-detail-image .thumbnail.active {
    border-color: var(--primary-color);
}

.product-detail-info {
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius-md);
}

.product-detail-info .product-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.product-detail-info .product-price-box {
    background: #fafafa;
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
}

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

.product-detail-info .product-original-price {
    font-size: 1rem;
    color: var(--text-muted);
    text-decoration: line-through;
    margin-left: 0.75rem;
}

.product-detail-info .product-discount {
    font-size: 0.875rem;
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    margin-left: 0.75rem;
}

.product-detail-info .product-meta {
    display: flex;
    gap: 2rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.product-detail-info .product-meta-item {
    color: var(--text-muted);
}

.product-detail-info .product-meta-item span {
    color: var(--text-dark);
    font-weight: 500;
}

.product-detail-info .product-description {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

/* ===== VARIATIONS ===== */
.variation-section {
    margin-bottom: 1rem;
}

.variation-section .variation-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.variation-section .variation-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.variation-section .variation-option {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
}

.variation-section .variation-option:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.variation-section .variation-option.active {
    border-color: var(--primary-color);
    background: rgba(238, 77, 45, 0.1);
    color: var(--primary-color);
    font-weight: 500;
}

.variation-section .variation-option.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ===== QUANTITY SELECTOR ===== */
.quantity-selector {
    display: flex;
    align-items: center;
    gap: 0;
}

.quantity-selector button {
    width: 36px;
    height: 36px;
    border: 1px solid var(--border-color);
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quantity-selector button:hover {
    background: var(--secondary-color);
}

.quantity-selector button:first-child {
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.quantity-selector button:last-child {
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.quantity-selector input {
    width: 60px;
    height: 36px;
    border: 1px solid var(--border-color);
    border-left: none;
    border-right: none;
    text-align: center;
    font-weight: 500;
}

/* ===== ACTION BUTTONS ===== */
.action-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.action-buttons .btn {
    flex: 1;
    padding: 0.875rem 1.5rem;
    font-weight: 600;
}

.action-buttons .btn-whatsapp {
    background: #25d366;
    color: white;
    border: none;
}

.action-buttons .btn-whatsapp:hover {
    background: #128c7e;
    color: white;
}

/* ===== TEMPLATE GALLERY ===== */
.template-folder-card {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
}

.template-folder-card .folder-image {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.template-folder-card:hover .folder-image {
    transform: scale(1.05);
}

.template-folder-card .folder-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    padding: 2rem 1rem 1rem;
    color: white;
}

.template-folder-card .folder-name {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.template-folder-card .folder-count {
    font-size: 0.875rem;
    opacity: 0.9;
}

.template-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.template-item {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.template-item:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.template-item img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
}

.template-item .template-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    padding: 2rem 0.75rem 0.75rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.template-item:hover .template-overlay {
    opacity: 1;
}

.template-item .template-name {
    color: white;
    font-size: 0.875rem;
    font-weight: 500;
}

/* ===== HERO SECTION ===== */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    padding: 4rem 0;
    color: white;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 60%;
    height: 200%;
    background: rgba(255,255,255,0.05);
    transform: rotate(30deg);
}

.hero-section .hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.hero-section .hero-subtitle {
    font-size: 1.125rem;
    opacity: 0.9;
    margin-bottom: 2rem;
}

.hero-section .hero-stats {
    display: flex;
    gap: 3rem;
    margin-top: 2rem;
}

.hero-section .stat-item {
    text-align: center;
}

.hero-section .stat-number {
    font-size: 2rem;
    font-weight: 700;
}

.hero-section .stat-label {
    font-size: 0.875rem;
    opacity: 0.9;
}

/* ===== CATEGORY SECTION ===== */
.category-section {
    padding: 3rem 0;
}

.category-card {
    background: white;
    border-radius: var(--radius-md);
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid var(--border-color);
}

.category-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.category-card .category-icon {
    width: 60px;
    height: 60px;
    background: rgba(238, 77, 45, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    color: var(--primary-color);
    font-size: 1.5rem;
}

.category-card .category-name {
    font-weight: 600;
    color: var(--text-dark);
}

/* ===== SEARCH BAR ===== */
.search-bar {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

.search-bar input {
    width: 100%;
    padding: 0.875rem 3rem 0.875rem 1.25rem;
    border: 2px solid var(--border-color);
    border-radius: 50px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

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

.search-bar button {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-bar button:hover {
    background: var(--primary-hover);
}

/* ===== SECTION TITLE ===== */
.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.section-title h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
    position: relative;
    padding-left: 1rem;
}

.section-title h2::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 24px;
    background: var(--primary-color);
    border-radius: 2px;
}

.section-title .view-all {
    color: var(--primary-color);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
}

.section-title .view-all:hover {
    text-decoration: underline;
}

/* ===== FOOTER ===== */
.footer {
    background: #1a1a1a !important;
}

.footer h5 {
    font-size: 1rem;
    font-weight: 600;
}

.footer a:hover {
    color: var(--accent-color) !important;
}

.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.social-links a:hover {
    background: var(--primary-color);
    transform: translateY(-2px);
}

/* ===== FLOATING WHATSAPP ===== */
.btn-whatsapp-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: #25d366;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
    z-index: 999;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-whatsapp-float:hover {
    background: #128c7e;
    color: white;
    transform: scale(1.1);
}

/* ===== ALERTS ===== */
.alert {
    border-radius: var(--radius-md);
    border: none;
}

.alert-success {
    background: #d4edda;
    color: #155724;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
}

/* ===== PAGINATION ===== */
.pagination .page-link {
    color: var(--primary-color);
    border-color: var(--border-color);
}

.pagination .page-link:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.pagination .page-item.active .page-link {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

/* ===== BREADCRUMB ===== */
.breadcrumb {
    background: transparent;
    padding: 0;
    font-size: 0.875rem;
}

.breadcrumb-item a {
    color: var(--text-muted);
    text-decoration: none;
}

.breadcrumb-item a:hover {
    color: var(--primary-color);
}

.breadcrumb-item.active {
    color: var(--text-dark);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 991.98px) {
    .hero-section .hero-title {
        font-size: 2rem;
    }
    
    .hero-section .hero-stats {
        gap: 2rem;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .template-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}

@media (max-width: 767.98px) {
    .hero-section {
        padding: 2.5rem 0;
    }
    
    .hero-section .hero-title {
        font-size: 1.75rem;
    }
    
    .hero-section .hero-stats {
        gap: 1.5rem;
    }
    
    .hero-section .stat-number {
        font-size: 1.5rem;
    }
    
    .section-title h2 {
        font-size: 1.25rem;
    }
    
    .btn-whatsapp-float {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
        bottom: 20px;
        right: 20px;
    }
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

/* ===== LOADING ===== */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ===== UTILITIES ===== */
.text-primary {
    color: var(--primary-color) !important;
}

.bg-primary {
    background-color: var(--primary-color) !important;
}

.border-primary {
    border-color: var(--primary-color) !important;
}

.shadow-sm {
    box-shadow: var(--shadow-sm) !important;
}

.shadow-md {
    box-shadow: var(--shadow-md) !important;
}

.shadow-lg {
    box-shadow: var(--shadow-lg) !important;
}

.rounded-md {
    border-radius: var(--radius-md) !important;
}

/* ===== ADMIN PANEL ===== */
.admin-sidebar {
    background: #1a1a2e;
    min-height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    width: 260px;
    z-index: 1000;
    transition: all 0.3s ease;
}

.admin-sidebar .sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.admin-sidebar .sidebar-brand {
    color: white;
    font-size: 1.25rem;
    font-weight: 700;
    text-decoration: none;
}

.admin-sidebar .nav-link {
    color: rgba(255,255,255,0.7);
    padding: 0.875rem 1.5rem !important;
    border-radius: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.admin-sidebar .nav-link:hover,
.admin-sidebar .nav-link.active {
    background: rgba(238, 77, 45, 0.2);
    color: white !important;
}

.admin-sidebar .nav-link i {
    width: 20px;
    text-align: center;
}

.admin-content {
    margin-left: 260px;
    min-height: 100vh;
    background: #f5f5f5;
}

.admin-navbar {
    background: white;
    padding: 1rem 1.5rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-card {
    background: white;
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.stat-card .stat-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-dark);
}

.stat-card .stat-label {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* ===== TABLE ===== */
.table-admin {
    background: white;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.table-admin th {
    background: #f8f8f8;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table-admin td {
    vertical-align: middle;
    font-size: 0.875rem;
}

.table-admin .product-thumb {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: var(--radius-sm);
}

/* ===== FORM ===== */
.form-label {
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text-dark);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(238, 77, 45, 0.25);
}

/* ===== MODAL ===== */
.modal-content {
    border: none;
    border-radius: var(--radius-lg);
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
    padding: 1.25rem;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid var(--border-color);
    padding: 1.25rem;
}

/* ===== IMAGE UPLOAD ===== */
.image-upload {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.image-upload:hover {
    border-color: var(--primary-color);
    background: rgba(238, 77, 45, 0.05);
}

.image-upload i {
    font-size: 3rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.image-preview {
    position: relative;
    display: inline-block;
}

.image-preview img {
    max-width: 200px;
    max-height: 200px;
    border-radius: var(--radius-md);
}

.image-preview .remove-image {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 30px;
    height: 30px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
}
