/* ============================================================
   app.css — Custom styles to complement Tailwind CSS
   French e-commerce platform
   ============================================================ */


/* ============================================================
   BUTTONS
   ============================================================ */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.625rem 1.25rem;
    background-color: #2563eb;
    color: #ffffff;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 0.5rem;
    border: 2px solid transparent;
    cursor: pointer;
    transition: background-color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
    text-decoration: none;
    white-space: nowrap;
    line-height: 1.25;
}

.btn-primary:hover {
    background-color: #1d4ed8;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
    transform: translateY(-1px);
}

.btn-primary:active {
    background-color: #1e40af;
    transform: translateY(0);
    box-shadow: none;
}

.btn-primary:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.625rem 1.25rem;
    background-color: transparent;
    color: #374151;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 0.5rem;
    border: 2px solid #d1d5db;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
    text-decoration: none;
    white-space: nowrap;
    line-height: 1.25;
}

.btn-secondary:hover {
    background-color: #f3f4f6;
    border-color: #9ca3af;
    color: #111827;
    transform: translateY(-1px);
}

.btn-secondary:active {
    background-color: #e5e7eb;
    transform: translateY(0);
}

.btn-secondary:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}


/* ============================================================
   CARD
   ============================================================ */
.card {
    background-color: #ffffff;
    border-radius: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(229, 231, 235, 0.8);
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}

.card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1), 0 1px 4px rgba(0, 0, 0, 0.06);
}

.card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #f3f4f6;
    font-weight: 600;
    color: #111827;
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #f3f4f6;
    background-color: #f9fafb;
}


/* ============================================================
   PRODUCT CARDS
   ============================================================ */
.product-card {
    background-color: #ffffff;
    border-radius: 1rem;
    border: 1px solid rgba(229, 231, 235, 0.8);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    transition: box-shadow 0.25s ease, transform 0.25s ease;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    transform: translateY(-3px);
}

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

.product-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Wishlist heart overlay button */
.product-card .wishlist-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.2s ease, transform 0.2s ease, background-color 0.15s ease;
    border: none;
    cursor: pointer;
    color: #ef4444;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.product-card:hover .wishlist-btn {
    opacity: 1;
    transform: scale(1);
}

.product-card .wishlist-btn:hover {
    background-color: #fee2e2;
}

/* Line-clamp utility */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-1 {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}


/* ============================================================
   BADGES
   ============================================================ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.65rem;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 9999px;
    letter-spacing: 0.02em;
    line-height: 1.2;
    text-transform: uppercase;
}

.badge-success {
    background-color: #dcfce7;
    color: #166534;
}

.badge-warning {
    background-color: #fef9c3;
    color: #854d0e;
}

.badge-info {
    background-color: #dbeafe;
    color: #1e40af;
}

.badge-danger {
    background-color: #fee2e2;
    color: #991b1b;
}

.badge-secondary {
    background-color: #f3f4f6;
    color: #374151;
}

.badge-indigo {
    background-color: #e0e7ff;
    color: #3730a3;
}


/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
.toast {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.18), 0 2px 8px rgba(0, 0, 0, 0.12);
    font-size: 0.875rem;
    font-weight: 500;
    max-width: 20rem;
    width: 100%;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Toast container positioning (complementary to Tailwind fixed classes) */
#toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
    max-width: 22rem;
    width: 100%;
}

@media (max-width: 640px) {
    #toast-container {
        bottom: 1rem;
        right: 0.75rem;
        left: 0.75rem;
        max-width: none;
    }
}


/* ============================================================
   SMOOTH TRANSITIONS
   ============================================================ */

/* All interactive elements get smooth transitions */
a,
button,
input,
select,
textarea,
[role="button"] {
    transition-property: color, background-color, border-color, box-shadow, opacity, transform;
    transition-duration: 0.15s;
    transition-timing-function: ease;
}

/* Focus ring standardization */
input:focus,
select:focus,
textarea:focus,
button:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Smooth page links */
html {
    scroll-behavior: smooth;
}


/* ============================================================
   SCROLLBAR — hide for nav overflow (hide-scrollbar utility)
   ============================================================ */
.hide-scrollbar::-webkit-scrollbar {
    display: none;
}

.hide-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}


/* ============================================================
   HERO SLIDER
   ============================================================ */
.slider-slide {
    transition: opacity 0.7s ease;
}

@keyframes scrollBrands {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.animate-scroll {
    animation: scrollBrands 25s linear infinite;
}

.animate-scroll:hover {
    animation-play-state: paused;
}


/* ============================================================
   FORMS
   ============================================================ */
.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    color: #111827;
    background-color: #ffffff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    line-height: 1.5;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: #9ca3af;
}

.form-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.375rem;
}

.form-error {
    font-size: 0.75rem;
    color: #ef4444;
    margin-top: 0.25rem;
}


/* ============================================================
   TABLE STYLES
   ============================================================ */
.table-clean {
    width: 100%;
    border-collapse: collapse;
}

.table-clean thead tr {
    background-color: #f9fafb;
}

.table-clean th {
    padding: 0.75rem 1.25rem;
    text-align: left;
    font-size: 0.7rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 1px solid #f3f4f6;
}

.table-clean td {
    padding: 0.875rem 1.25rem;
    font-size: 0.875rem;
    color: #374151;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
}

.table-clean tbody tr:last-child td {
    border-bottom: none;
}

.table-clean tbody tr:hover {
    background-color: #f9fafb;
}


/* ============================================================
   QUANTITY CONTROL STYLING
   ============================================================ */
.qty-control {
    display: inline-flex;
    align-items: center;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    overflow: hidden;
    background-color: #ffffff;
}

.qty-control button {
    width: 2rem;
    height: 2.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 0.875rem;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.qty-control button:hover {
    background-color: #f3f4f6;
    color: #111827;
}

.qty-control input[type="number"] {
    width: 3rem;
    text-align: center;
    border: none;
    border-left: 1px solid #e5e7eb;
    border-right: 1px solid #e5e7eb;
    font-size: 0.875rem;
    font-weight: 600;
    color: #111827;
    padding: 0.4rem 0;
    -moz-appearance: textfield;
    outline: none;
}

.qty-control input[type="number"]::-webkit-outer-spin-button,
.qty-control input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
}


/* ============================================================
   PAGINATION
   ============================================================ */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.25rem;
    height: 2.25rem;
    padding: 0 0.5rem;
    font-size: 0.875rem;
    border-radius: 0.5rem;
    text-decoration: none;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.pagination a {
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    color: #374151;
}

.pagination a:hover {
    background-color: #eff6ff;
    border-color: #bfdbfe;
    color: #2563eb;
}

.pagination span.active {
    background-color: #2563eb;
    color: #ffffff;
    font-weight: 600;
    border: 1px solid #2563eb;
}


/* ============================================================
   SKELETON LOADING ANIMATION
   ============================================================ */
@keyframes shimmer {
    0%   { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.skeleton {
    background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 0.375rem;
}


/* ============================================================
   UTILITY CLASSES
   ============================================================ */

/* Prevent layout shift during image load */
.img-placeholder {
    background-color: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Text selection color */
::selection {
    background-color: #bfdbfe;
    color: #1e40af;
}

/* Visually hidden (accessible) */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Aspect ratio helper */
.aspect-w-4 { position: relative; padding-bottom: 75%; }
.aspect-w-4 > * { position: absolute; inset: 0; }
.aspect-square { aspect-ratio: 1 / 1; }
