/**
 * Everest Peptides - Custom CSS
 * Additional styles that complement Tailwind CSS
 */

/* ==========================================================================
   Color Fallbacks (when Tailwind CDN blocked or fails - ad blockers, slow
   networks, different regions). Ensures brand colors still display correctly.
   ========================================================================== */

.bg-\[\#6bb3fb\] { background-color: #6bb3fb !important; }
.bg-\[\#6bb3fb\]:hover, .hover\:bg-\[\#9dcbfd\]:hover { background-color: #9dcbfd !important; }
.bg-\[\#03284f\] { background-color: #03284f !important; }
.bg-\[\#011a2e\] { background-color: #011a2e !important; }
.bg-\[\#0a1628\] { background-color: #0a1628 !important; }
.bg-\[\#064272\] { background-color: #064272 !important; }
.bg-\[\#162d4a\] { background-color: #162d4a !important; }
.bg-\[\#28B7D9\] { background-color: #28B7D9 !important; }
.text-\[\#011a2e\] { color: #011a2e !important; }
.border-\[\#0a5a9e\] { border-color: #0a5a9e !important; }
.border-\[\#234567\] { border-color: #234567 !important; }

/* Add to cart / CTA buttons */
button.bg-\[\#6bb3fb\],
a.bg-\[\#6bb3fb\] { background-color: #6bb3fb !important; color: #011a2e !important; }

/* ==========================================================================
   Typography Enhancements
   ========================================================================== */

.font-display {
    font-family: 'Plus Jakarta Sans', sans-serif;
}

.font-body {
    font-family: 'Inter', sans-serif;
}

/* Line Clamp Support */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ==========================================================================
   WooCommerce Overrides
   ========================================================================== */

/* Remove default WooCommerce styles */
.woocommerce-result-count {
    margin: 0 !important;
    padding: 0 !important;
    color: #a3c4d9;
    font-size: 0.875rem;
}

.woocommerce-ordering {
    margin: 0 !important;
}

.woocommerce-ordering select {
    background-color: #162d4a;
    border: 1px solid #234567;
    border-radius: 0.5rem;
    padding: 0.625rem 2.5rem 0.625rem 1rem;
    color: #a3c4d9;
    font-size: 0.875rem;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236a8fa8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem;
    transition: border-color 0.2s ease;
}

.woocommerce-ordering select:hover,
.woocommerce-ordering select:focus {
    border-color: rgba(40, 183, 217, 0.5);
    outline: none;
}

/* Pagination */
.woocommerce-pagination ul,
.page-numbers {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.woocommerce-pagination ul li,
.page-numbers li {
    margin: 0;
}

.woocommerce-pagination ul li a,
.woocommerce-pagination ul li span,
.page-numbers a,
.page-numbers span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    height: 2.5rem;
    padding: 0 0.75rem;
    background-color: #162d4a;
    border: 1px solid #234567;
    border-radius: 0.5rem;
    color: #a3c4d9;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

.woocommerce-pagination ul li a:hover,
.page-numbers a:hover {
    border-color: #28B7D9;
    color: #28B7D9;
}

.woocommerce-pagination ul li span.current,
.page-numbers span.current {
    background-color: #28B7D9;
    border-color: #28B7D9;
    color: #0a1628;
}

.woocommerce-pagination ul li .prev,
.woocommerce-pagination ul li .next,
.page-numbers .prev,
.page-numbers .next {
    padding: 0;
}

/* Quantity Input */
.woocommerce .quantity {
    display: flex;
    align-items: center;
}

.woocommerce .quantity .qty {
    width: 4rem;
    padding: 0.5rem;
    text-align: center;
    background-color: #0f2137;
    border: 1px solid #234567;
    border-radius: 0.5rem;
    color: #ffffff;
    font-size: 1rem;
    -moz-appearance: textfield;
}

.woocommerce .quantity .qty::-webkit-outer-spin-button,
.woocommerce .quantity .qty::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.woocommerce .quantity .qty:focus {
    outline: none;
    border-color: #28B7D9;
}

/* WooCommerce Messages */
.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
    background-color: #162d4a !important;
    border: 1px solid #234567 !important;
    border-radius: 0.75rem !important;
    padding: 1rem 1.5rem !important;
    margin-bottom: 1.5rem !important;
    color: #a3c4d9 !important;
}

.woocommerce-message::before,
.woocommerce-info::before,
.woocommerce-error::before {
    color: #28B7D9 !important;
}

.woocommerce-message {
    border-left: 3px solid #10b981 !important;
}

.woocommerce-message::before {
    color: #10b981 !important;
}

.woocommerce-error {
    border-left: 3px solid #ef4444 !important;
}

.woocommerce-error::before {
    color: #ef4444 !important;
}

.woocommerce-message a,
.woocommerce-info a,
.woocommerce-error a {
    color: #28B7D9 !important;
}

/* ==========================================================================
   Form Styles
   ========================================================================== */

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="url"],
input[type="search"],
textarea,
select {
    background-color: #162d4a;
    border: 1px solid #234567;
    border-radius: 0.75rem;
    padding: 0.875rem 1rem;
    color: #ffffff;
    font-size: 1rem;
    transition: border-color 0.2s ease;
    width: 100%;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="tel"]:focus,
input[type="url"]:focus,
input[type="search"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #28B7D9;
}

input::placeholder,
textarea::placeholder {
    color: #6a8fa8;
}

/* Checkbox & Radio */
input[type="checkbox"],
input[type="radio"] {
    width: 1.25rem;
    height: 1.25rem;
    background-color: #162d4a;
    border: 2px solid #234567;
    border-radius: 0.25rem;
    cursor: pointer;
    appearance: none;
    transition: all 0.2s ease;
}

input[type="radio"] {
    border-radius: 50%;
}

input[type="checkbox"]:checked,
input[type="radio"]:checked {
    background-color: #28B7D9;
    border-color: #28B7D9;
}

input[type="checkbox"]:checked::after {
    content: '';
    display: block;
    width: 0.375rem;
    height: 0.625rem;
    border: solid #0a1628;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin: 0.125rem auto;
}

input[type="radio"]:checked::after {
    content: '';
    display: block;
    width: 0.5rem;
    height: 0.5rem;
    background-color: #0a1628;
    border-radius: 50%;
    margin: 0.25rem auto;
}

/* Labels */
label {
    display: block;
    margin-bottom: 0.5rem;
    color: #a3c4d9;
    font-size: 0.875rem;
    font-weight: 500;
}

/* ==========================================================================
   Custom Scrollbar
   ========================================================================== */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #0a1628;
}

::-webkit-scrollbar-thumb {
    background: #234567;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #2d5a85;
}

/* ==========================================================================
   Alpine.js Collapse Plugin Fallback
   ========================================================================== */

[x-cloak] {
    display: none !important;
}

/* ==========================================================================
   Prose/Content Styling
   ========================================================================== */

.prose {
    color: #a3c4d9;
}

.prose h1,
.prose h2,
.prose h3,
.prose h4,
.prose h5,
.prose h6 {
    color: #ffffff;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 700;
}

.prose a {
    color: #28B7D9;
    text-decoration: none;
}

.prose a:hover {
    color: #3fcbe8;
    text-decoration: underline;
}

.prose strong {
    color: #ffffff;
}

.prose code {
    background-color: #162d4a;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-size: 0.875em;
}

.prose pre {
    background-color: #162d4a;
    border: 1px solid #234567;
    border-radius: 0.75rem;
    padding: 1rem;
}

.prose blockquote {
    border-left: 3px solid #28B7D9;
    padding-left: 1rem;
    color: #6a8fa8;
    font-style: italic;
}

.prose ul,
.prose ol {
    padding-left: 1.5rem;
}

.prose li {
    margin-bottom: 0.5rem;
}

.prose ul li::marker {
    color: #28B7D9;
}

.prose ol li::marker {
    color: #28B7D9;
}

.prose hr {
    border-color: #234567;
}

.prose table {
    width: 100%;
    border-collapse: collapse;
}

.prose th,
.prose td {
    padding: 0.75rem;
    border: 1px solid #234567;
}

.prose th {
    background-color: #162d4a;
    color: #ffffff;
    font-weight: 600;
    text-align: left;
}

/* ==========================================================================
   Loading Skeleton
   ========================================================================== */

.skeleton {
    background: linear-gradient(
        90deg,
        #162d4a 0%,
        #1c3a5c 50%,
        #162d4a 100%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

/* ==========================================================================
   Selection Styling
   ========================================================================== */

::selection {
    background-color: rgba(40, 183, 217, 0.3);
    color: #ffffff;
}

::-moz-selection {
    background-color: rgba(40, 183, 217, 0.3);
    color: #ffffff;
}

/* ==========================================================================
   Focus Visible (Accessibility)
   ========================================================================== */

:focus-visible {
    outline: 2px solid #28B7D9;
    outline-offset: 2px;
}

button:focus-visible,
a:focus-visible {
    outline: 2px solid #28B7D9;
    outline-offset: 2px;
}

/* ==========================================================================
   Image Handling
   ========================================================================== */

.wp-post-image,
.woocommerce-product-gallery__image img,
.attachment-product-card,
.attachment-product-hero {
    object-fit: cover;
}

/* ==========================================================================
   Cart Styles
   ========================================================================== */

.woocommerce-cart-form .product-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0.5rem;
}

/* Remove default table styling from cart */
.woocommerce-cart-form table.shop_table {
    border: none;
}

.woocommerce-cart-form table.shop_table td,
.woocommerce-cart-form table.shop_table th {
    border: none;
    padding: 0;
}

/* ==========================================================================
   Mobile Menu Animation
   ========================================================================== */

@media (max-width: 1023px) {
    .mobile-menu-open {
        overflow: hidden;
    }
}

/* ==========================================================================
   Custom Logo Styles
   ========================================================================== */

.custom-logo-link {
    display: flex;
    align-items: center;
}

.custom-logo {
    height: 40px;
    width: auto;
    max-width: 180px;
    object-fit: contain;
}

@media (min-width: 640px) {
    .custom-logo {
        height: 48px;
        max-width: 220px;
    }
}

/* ==========================================================================
   Checkout Place Order Button
   ========================================================================== */

#place_order,
.woocommerce-checkout #place_order,
button#place_order {
    width: 100% !important;
    padding: 1.25rem 2rem !important;
    font-size: 1.125rem !important;
    font-weight: 700 !important;
    background: #6bb3fb !important;
    color: #011a2e !important;
    border: none !important;
    border-radius: 0.75rem !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    margin-top: 1.5rem !important;
}

#place_order:hover,
.woocommerce-checkout #place_order:hover,
button#place_order:hover {
    background: #9dcbfd !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 10px 25px rgba(107, 179, 251, 0.3) !important;
}

#place_order:disabled,
.woocommerce-checkout #place_order:disabled {
    opacity: 0.6 !important;
    cursor: not-allowed !important;
}

/* Payment methods styling */
.wc_payment_methods {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 0 1rem 0 !important;
}

.wc_payment_method {
    background: #064272 !important;
    border: 1px solid #0a5a9e !important;
    border-radius: 0.75rem !important;
    margin-bottom: 0.75rem !important;
    overflow: hidden !important;
}

.wc_payment_method label {
    display: flex !important;
    align-items: center !important;
    gap: 0.75rem !important;
    padding: 1rem !important;
    cursor: pointer !important;
    color: #ffffff !important;
    font-weight: 600 !important;
    margin: 0 !important;
}

.wc_payment_method .payment_box {
    padding: 1rem !important;
    background: #03284f !important;
    border-top: 1px solid #0a5a9e !important;
    color: #b8d4ed !important;
    font-size: 0.875rem !important;
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    body {
        background: white;
        color: black;
    }
    
    header,
    footer,
    .no-print {
        display: none !important;
    }
}
