/* ==========================================================================
   TASK 1: GLOBAL BASE RESETS & LAYOUT INSURANCE
   ========================================================================== */
html {
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
}

body {
    overflow-x: hidden;
    max-width: 100%;
}

*,
*:before,
*:after {
    box-sizing: border-box;
}

img,
svg,
video,
iframe {
    max-width: 100%;
    height: auto;
}

p, h1, h2, h3, h4, h5, h6, a {
    overflow-wrap: break-word;
}

/* ==========================================================================
   TASK 2: PAGE BUILDER & WOOCOMMERCE ACCESSIBILITY DEFAULTS
   ========================================================================== */
.elementor,
.elementor-section,
.elementor-container,
.elementor-column,
.elementor-widget-wrap {
    max-width: 100%;
}

.woocommerce img {
    max-width: 100%;
    height: auto;
}

.woocommerce table {
    width: 100%;
}

.woocommerce table.shop_table {
    display: block;
    overflow-x: auto;
}

.woocommerce form {
    width: 100%;
}

.woocommerce input,
.woocommerce select,
.woocommerce textarea {
    max-width: 100%;
}

/* ==========================================================================
   TASK 3: INTEGRATED WOOCOMMERCE PRODUCT CARD DESIGN (DESKTOP & MOBILE)
   ========================================================================== */
/* Keep product card container background white (removes theme overlays) */
.woocommerce ul.products li.product,
.woocommerce ul.products li.product:hover,
.woocommerce-page ul.products li.product:hover,
.product:hover,
.type-product:hover,
.wp-block-post-template li:hover {
    background: #ffffff !important;
    background-color: #ffffff !important;
}

/* Prevent hover overlays masking the text area */
.woocommerce ul.products li.product:hover h2,
.woocommerce ul.products li.product:hover h3,
.woocommerce ul.products li.product:hover .woocommerce-loop-product__title,
.woocommerce ul.products li.product a:hover,
.woocommerce ul.products li.product a:hover * {
    background: transparent !important;
    background-color: transparent !important;
}

/* Unified Product Title Styling with Line Clamping & Gold Color */
.woocommerce ul.products li.product .woocommerce-loop-product__title,
.woocommerce ul.products li.product h2,
.woocommerce ul.products li.product h3,
.woocommerce ul.products li.product a:hover .woocommerce-loop-product__title,
.woocommerce ul.products li.product a:hover h2,
.woocommerce ul.products li.product a:hover h3 {
    color: #c5a059 !important; /* Elegant metallic/warm gold */
    font-size: 0.9rem !important;
    margin: 18px 20px 12px;
    text-align: center;
    font-weight: 700;
    line-height: 1.25;
    word-break: normal;
    overflow-wrap: anywhere;
    hyphens: auto;

    /* Perfect line equal height constraints */
    height: 3.75em; /* Exactly 3 lines */
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
}

/* ==========================================================================
   TASK 4: THE ULTRA-SKINNY RECTANGULAR ADD TO CART BUTTON
   ========================================================================== */
.woocommerce ul.products li.product .button,
.woocommerce ul.products li.product .add_to_cart_button,
.woocommerce-page ul.products li.product .button,
.woocommerce .products li.product .button {
    display: block !important;         /* Forces a block layout on its own line */
    position: static !important;       /* Overrides old absolute corner configurations */
    width: 65% !important;            /* Extra skinny width to stay far away from card borders */
    max-width: 200px !important;      /* Safe maximum width break for mobile devices */
    box-sizing: border-box !important;/* Keeps boundaries tight and calculated */

    /* Crisp rectangle & minimal spacing */
    border-radius: 3px !important;    /* Tight, rectangular edges */
    padding: 5px 2px !important;      /* Stripped down to clean minimal height */
    font-size: 0.80rem !important;    /* Elegant micro-typography */

    /* Horizontal Centering Engine */
    margin-left: auto !important;
    margin-right: auto !important;
    margin-top: 10px !important;
    margin-bottom: 10px !important;

    white-space: normal !important;   /* Allows text to wrap into multiple rows safely if screen is thin */
    word-wrap: break-word !important;
    text-align: center !important;
    float: none !important;           /* Blocks broken theme floats */
}

/* Add to Cart button Hover States */
.woocommerce ul.products li.product .button:hover,
.woocommerce ul.products li.product .add_to_cart_button:hover,
.woocommerce ul.products li.product .added_to_cart:hover {
    background: #000000 !important;
    background-color: #000000 !important;
    color: #ffffff !important;
    border-color: #000000 !important;
}

/* ==========================================================================
   TASK 5: RESPONSIVE MEDIA QUERIES (TABLETS & PHONES)
   ========================================================================== */
/* Tablets and below (max-width: 991px) */
@media (max-width: 991px) {
    .elementor-column {
        width: 100% !important;
    }

    .elementor-container {
        flex-wrap: wrap;
    }

    .woocommerce ul.products {
        gap: 20px;
    }

    .woocommerce ul.products li.product {
        width: 100%;
    }
}

/* Mobile Phones (max-width: 767px) */
@media (max-width: 767px) {
    .elementor-section {
        padding-left: 15px;
        padding-right: 15px;
    }

    h1 { font-size: 34px; line-height: 1.2; }
    h2 { font-size: 28px; line-height: 1.25; }
    h3 { font-size: 24px; }
    p { font-size: 16px; line-height: 1.7; }

    /* Target inputs/buttons globally EXCEPT our WooCommerce loop buttons */
    input,
    textarea,
    select,
    body button:not(.add_to_cart_button),
    body .button:not(.add_to_cart_button),
    .elementor-button {
        width: 100%;
        min-height: 48px;
    }
}


/* Contact Form 7 Newsletter Styling */
.newsletter-wrapper {
  --text-dark: #2d3748;
  --accent-color: #f6ad55;

  background-color: #4a4893;
  padding: 40px 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  width: 100%;
  box-sizing: border-box;
}

.newsletter-wrapper * {
  box-sizing: border-box;
}

.newsletter-container {
  width: 100%;
  max-width: 640px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.newsletter-header {
  text-align: left;
  color: #ffffff;
}

.newsletter-tag {
  color: var(--accent-color);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 13px;
  letter-spacing: 1px;
  display: inline-block;
  margin-bottom: 4px;
}

.newsletter-title {
  font-size: 36px;
  font-weight: 800;
  margin: 0 0 8px 0;
  line-height: 1.2;
  color: #ffffff;
}

.newsletter-subtitle {
  font-size: 15px;
  line-height: 1.5;
  margin: 0;
  opacity: 0.9;
}

.newsletter-card {
  background: linear-gradient(135deg, #5c5aa7 0%, #434182 100%);
  border-radius: 12px;
  padding: 30px 30px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.card-title {
  font-size: 22px;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 6px 0;
}

.card-text {
  font-size: 14px;
  color: #e2e8f0;
  line-height: 1.5;
  margin: 0 0 20px 0;
}

.form-row {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}

.form-group {
  flex: 1;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 6px;
}

.form-group label .optional {
  font-weight: 400;
  color: #cbd5e0;
}

.form-group label .required {
  color: var(--accent-color);
}

.newsletter-wrapper input[type="text"],
.newsletter-wrapper input[type="email"] {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  font-size: 14px;
  color: var(--text-dark);
  background-color: #ffffff;
  transition: all 0.2s ease;
}

.newsletter-wrapper input:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(246, 173, 85, 0.3);
}

.form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 4px;
}

.newsletter-wrapper .submit-btn {
  background-color: #ffffff;
  color: #434182;
  border: none;
  padding: 12px 28px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.newsletter-wrapper .submit-btn:hover {
  background-color: var(--accent-color);
  color: var(--text-dark);
  transform: translateY(-1px);
}

.privacy-note {
  font-size: 11px;
  color: #cbd5e0;
  margin: 0;
  line-height: 1.4;
  text-align: right;
  max-width: 320px;
}

@media (max-width: 600px) {
  .form-row {
    flex-direction: column;
    gap: 16px;
  }
  .form-footer {
    flex-direction: column;
    gap: 16px;
    align-items: stretch;
  }
  .newsletter-wrapper .submit-btn {
    width: 100%;
    order: 1;
  }
  .privacy-note {
    text-align: center;
    max-width: 100%;
    order: 2;
  }
}